Discrepancy transforming `SkyCoord` to `AltAz`
See original GitHub issueDescription
I have come across a discrepancy that I cannot explain when converting SkyCoord
(RA/Dec) to AltAz
. In short, I get slightly but significantly different results using the equation of celestial navigation (as described here) and SkyCoord.transform_to
.
Expected behavior
SkyCoord.transform_to
should match the trigonometric result from the celestial navigation equation.
Actual behavior
There is a small difference between results.
Steps to Reproduce
- Use the online celestial to horizon coordinates calculator available here to convert location + time + RA/Dec to an Alt/Az:
(Note that this calculator uses your local time as an input, rather than the observer’s).
This result is consistent with what I get using my own implementation of the celestial navigation equation.
- Use
astropy
to do the same calculation:
from datetime import datetime
from astropy import units as u
from astropy.time import Time
from astropy.coordinates import AltAz, EarthLocation, SkyCoord
location = EarthLocation(lat=0 * u.deg, lon=0 * u.deg)
skycoord = SkyCoord(ra=0 * u.deg, dec=0 * u.deg)
# Time at longitude = 0 == UTC
time = Time(datetime(2021, 1, 1, 0, 0), scale="utc", location=location)
altaz_frame = AltAz(obstime=time, location=location)
altaz = skycoord.transform_to(altaz_frame)
print(altaz.alt.to_value("deg"), altaz.az.to_value("deg"))
# Prints: -10.59990770524396 270.1166107257178
Is there an explanation for this difference? Thanks!
System Details
macOS-10.16-x86_64-i386-64bit Python 3.8.5 (default, Sep 4 2020, 02:22:02) [Clang 10.0.0 ] Numpy 1.20.1 astropy 4.2.1 Scipy 1.6.2 Matplotlib 3.4.2
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (5 by maintainers)
Top GitHub Comments
Since the problem here is with the calculator rather than Astropy and there has been no further discussion on this issue for nearly three weeks, I believe that this issue should be closed.
There is also the fact that the calculator uses UTC rather than UT1 to calculate sidereal time.