<p>An Earth-centered observer looking at that point on Earth’s surface would also be looking toward the point that is the zenith for that location on Earth.</p>
<p>Thus, you just need to find the local sidereal time (LST) for that Earth location.  That gives you the right ascension on the meridian for that place and time.  The meridian passes through the zenith, so that would give the R.A. of the desired point.</p>
<p>It looks like Skyfield has a GMST (Greenwich Mean Sidereal Time) attribute for any time object you create.  To go from that to LST, convert your longitude to hours (15 degrees per hour) and subtract if it’s west, add if it’s east.</p>
<p>So something like this:</p>
<pre><code>
from skyfield.api import load
ts = load.timescale()     # Timescale object
t = ts.now()   # Time object

RA_hours = t.gmst - west_longitude_degrees/15.
</code></pre>
<p>where you could change to a different time if you want, and you’d have to define that longitude variable.</p>
<p>You’d also want to check for negative values and make sure your answer falls into the 0-24 range, adding 24 if needed.</p>

CC BY-SA 4.0
2020-08-22T16:37:33.983Z
This is a small nit; "that is the zenith for that location on Earth" might be better phrased "that is on the [meridian](https://en.wikipedia.org/wiki/Meridian_(astronomy)) for that location. What you've written applies to a spherical earth with a spherically symmetric mass distribution, but there are up to three different zeniths; one drawn from the geocenter, another normal to Earth's ellipsoid, and a third in the direction of the local gravity gradient. This doesn't affect your answer as far as RA is concerned though.
uhoh
CC BY-SA 4.0
2020-08-22T17:46:34.997Z
Agreed, thanks for the clarification.
Eric Jensen
CC BY-SA 4.0
2020-08-22T14:01:43.060Z
2020-08-22T14:01:43.060Z
Eric Jensen
<p>I would like to calculate the right ascension of a point on earth as specified above with the <a href="https://rhodesmill.org/skyfield/" rel="nofollow noreferrer">Skyfield</a> Python library, and I can not figure out how to do this.</p>
<p>I know that calculating the geocentric position of the respective <code>Topos</code> object at a specific time  results in a <code>Geocentric</code> object that has an attribute <code>.radec</code>; however I am not confident that this delivers the right ascension in the TEME (<a href="https://en.wikipedia.org/wiki/Earth-centered_inertial" rel="nofollow noreferrer">Earth centered inertial</a> frame.</p>

CC BY-SA 4.0
2020-08-21T15:14:46.673Z
To double check; you want the apparent RA of an object on Earth's surface (a `Topos` location) as seen from the center of the Earth?
uhoh
CC BY-SA 4.0
2020-08-21T15:18:32.833Z
yes, exactly. I would like to obtain the RA wrt to the vernal equinox (obviously) in a TEME (True Equator Mean Equinox) frame. I know the geographical longitude, thus I need to know the RA of Greenwich to calculate the RA of the position of interest. I hope it is clear, what I mean
fl0ta''
CC BY-SA 4.0
2020-08-21T23:02:21.133Z
This is certainly on-topic here but may receive a better answer in [Astronomy SE](https://astronomy.stackexchange.com/). A parallel approach might be to go to Skyfield's [github issues page](https://github.com/skyfielders/python-skyfield/issues) and post a new issue. There is generally a quick response by either the package's original developer or someone else from the very active Skyfield community there.
uhoh
CC BY-SA 4.0
2020-08-22T02:43:49.230Z
oh, *this is Astronomy SE!* anyway Github may be helpful
uhoh
<python><right-ascension><skyfield>
How can I calculate the right ascension of an observer on Earth's surface in the TEME frame with python.skyfield?
fl0ta''
# How can I calculate the right ascension of an observer on Earth's surface in the TEME frame with python.skyfield?

(Asked by: username_0 on 2020-08-21)

I would like to calculate the right ascension of a point on earth as specified above with the [Skyfield](https://rhodesmill.org/skyfield/) Python library, and I can not figure out how to do this.

I know that calculating the geocentric position of the respective `Topos` object at a specific time results in a `Geocentric` object that has an attribute `.radec`; however I am not confident that this delivers the right ascension in the TEME ([Earth centered inertial](https://en.wikipedia.org/wiki/Earth-centered_inertial) frame.

**Tags:** python, right-ascension, skyfield

> **Comments:**
> **username_1**: To double check; you want the apparent RA of an object on Earth's surface (a `Topos` location) as seen from the center of the Earth?  
> **username_0**: yes, exactly. I would like to obtain the RA wrt to the vernal equinox (obviously) in a TEME (True Equator Mean Equinox) frame. I know the geographical longitude, thus I need to know the RA of Greenwich to calculate the RA of the position of interest. I hope it is clear, what I mean  
> **username_1**: This is certainly on-topic here but may receive a better answer in [Astronomy SE](https://astronomy.stackexchange.com/). A parallel approach might be to go to Skyfield's [github issues page](https://github.com/skyfielders/python-skyfield/issues) and post a new issue. There is generally a quick response by either the package's original developer or someone else from the very active Skyfield community there.  
> **username_1**: oh, *this is Astronomy SE!* anyway Github may be helpful  

---

## 1 answers

### Answer by username_2 on 2020-08-22. Score: 3 | Accepted answer

An Earth-centered observer looking at that point on Earth’s surface would also be looking toward the point that is the zenith for that location on Earth.
Thus, you just need to find the local sidereal time (LST) for that Earth location.  That gives you the right ascension on the meridian for that place and time.  The meridian passes through the zenith, so that would give the R.A. of the desired point.
It looks like Skyfield has a GMST (Greenwich Mean Sidereal Time) attribute for any time object you create.  To go from that to LST, convert your longitude to hours (15 degrees per hour) and subtract if it’s west, add if it’s east.
So something like this:

from skyfield.api import load
ts = load.timescale()     # Timescale object
t = ts.now()   # Time object

RA_hours = t.gmst - west_longitude_degrees/15.

where you could change to a different time if you want, and you’d have to define that longitude variable.
You’d also want to check for negative values and make sure your answer falls into the 0-24 range, adding 24 if needed.

> **Comments:**
> **username_1**: This is a small nit; "that is the zenith for that location on Earth" might be better phrased "that is on the [meridian](https://en.wikipedia.org/wiki/Meridian_(astronomy)) for that location. What you've written applies to a spherical earth with a spherically symmetric mass distribution, but there are up to three different zeniths; one drawn from the geocenter, another normal to Earth's ellipsoid, and a third in the direction of the local gravity gradient. This doesn't affect your answer as far as RA is concerned though.  
> **username_2**: Agreed, thanks for the clarification.  

---

