[AstroPy] Question about ecliptic coordinate calculations

Ar Kay arkay7777 at gmail.com
Mon Jul 20 23:07:43 EDT 2020


Hello,

I am an amateur who is learning my way through basic astronomy. I was
interested in learning how to calculate the position of the moon given a
time and location. I would like to compare these results to those from JPL
Horizons. to make sure that I am on the right track To that end, I ran the
following code:

import astropy.units as u
from astropy.coordinates import GeocentricTrueEcliptic, EarthLocation,
AltAz, GCRS, get_moon, HeliocentricTrueEcliptic
from astropy.time import Time
import pendulum as pnd

# greenwich observatory
observerTime = Time(pnd.datetime(2020,7,21,18,0,tz=pnd.timezone('UTC')))
# observerLoc = EarthLocation(lat=(51+28/60+38.6/3600)*u.deg, lon=0*u.deg,
height=65.8*u.meter)
observerLoc = EarthLocation(lat=51.4773207*u.deg, lon=0*u.deg,
height=67.0693*u.meter)

# print observer information
print(observerTime)
print(observerLoc)
print(observerLoc.geodetic)
print("="*40, sep="")

# get moon coordinates in GCRS
moon_greenwich = get_moon(time=observerTime, location=observerLoc)
print(moon_greenwich)
print("="*40, sep="")

# transform to various frames
print(moon_greenwich.transform_to(AltAz(obstime=observerTime,
location=observerLoc, pressure=1010*u.mbar, temperature=15*u.deg_C,
obswl=0.5*u.micrometer)))
# (270.91328479, 24.99375504, 3.70873971e+08)
print("="*40, sep="")
print(moon_greenwich.transform_to(GeocentricTrueEcliptic(equinox='J2000')))
# (132.26275734, 3.59188144, 373604.2078838)
print("="*40, sep="")
print(moon_greenwich.transform_to(HeliocentricTrueEcliptic(equinox='J2000')))
# (299.10543868, 0.0123854, 1.51638686e+08)
print("="*40, sep="")

I am comparing the results with JPL Horizons, set up as follows:

Ephemeris Type [change] : OBSERVER
Target Body [change] : Moon [Luna] [301]
Observer Location [change] : Greenwich [000] ( 0°00'00.0''E, 51°28'38.6''N,
65.8 m )
Time Span [change] : discrete time(s)=2020-07-21 18:00
Table Settings [change] : QUANTITIES=4,10,18,31; refraction model=REFRACTED
Display/Output [change] : default (formatted HTML)

which produces:

*****************************************************************************************************
 Date__(UT)__HR:MN:SC.fff     Azi_(r-apprnt)_Elev     Illu% hEcl-Lon
hEcl-Lat  r-ObsEcLon  r-ObsEcLat
*****************************************************************************************************
$$SOE
 2020-Jul-21 18:00:00.000 *m  270.91314  24.99602   1.29926 299.1093
0.0110 132.1879950   2.8266398
$$EOE
*****************************************************************************************************

The AltAz and HeliocentricTrueEcliptic results compare nicely with JPL
Horizons, better than 10 arcsec. However, the GeocentricTrueEcliptic
results diverge. I can see that we're calculating GeocentricTrueEcliptic
and JPL Horizons is calculating the observer (topocentric) ecliptic.
However, when I switch the observer to geocentric (Body = 500) in JPL
Horizon the ecliptic longitude results are still not as accurate (>1000
arcsec) as I would have expected. Refraction does not make a difference,
which makes sense to me.

*****************************************************************************************************
 Date__(UT)__HR:MN:SC.fff     Azi_(r-apprnt)_Elev     Illu% hEcl-Lon
hEcl-Lat  r-ObsEcLon  r-ObsEcLat
*****************************************************************************************************
$$SOE
 2020-Jul-21 18:00:00.000          n.a.      n.a.   1.41112 299.1093
0.0110 132.5498898   3.5949470
$$EOE
*****************************************************************************************************

Which brings me to my questions:

1) Why is there an apparent discrepancy between Astropy and JPL Horizons
when it comes to the ecliptic longitude only?
2) How do I transform the GeocentricTrueEcliptic coordinates into
topocentric (observer) ecliptic coordinates?

Thank you for making Astropy so awesome!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/astropy/attachments/20200720/7d2d00ac/attachment.html>


More information about the AstroPy mailing list