Created
January 24, 2012 21:46
-
-
Save zonca/1672906 to your computer and use it in GitHub Desktop.
PyEphem convert Azimuth/Elevation to RA/Dec
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import datetime | |
import time | |
import numpy as np | |
import ephem | |
az = np.radians(6.8927) | |
el = np.radians(-60.7665) | |
lon = -1 * np.radians(109 + 24/60. + 53.1/60**2) | |
lat = np.radians(33 + 41/60. + 46.0/60.**2) | |
alt = 30000 | |
ut = 2455822.868055556 | |
J0 = ephem.julian_date(0) | |
observer = ephem.Observer() | |
observer.lon = lon | |
observer.lat = lat | |
observer.elevation = alt | |
observer.date = ut - J0 | |
print observer.date | |
ra,dec = observer.radec_of(az, el) | |
print "EPHEM: %f %f" % (np.degrees(ra),np.degrees(dec)) | |
print "HORIZON: %f %f" % (196.49622, -4.56939) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Output:
2011/9/18 08:50:00
EPHEM: 196.497513 -4.569323
HORIZON: 196.496220 -4.569390