forked from geospace-code/pymap3d
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathradec2azel
More file actions
executable file
·21 lines (18 loc) · 842 Bytes
/
radec2azel
File metadata and controls
executable file
·21 lines (18 loc) · 842 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/env python
"""
Example Kitt Peak
./demo_radec2azel.py 257.96295344 15.43785495 31.9583 -111.5967 2014-12-25T22:00:00MST
"""
from pymap3d import radec2azel
if __name__ == '__main__': #selftest
from argparse import ArgumentParser
p = ArgumentParser(description="convert RightAscension,Declination to Azimuth,Elevation")
p.add_argument('ra',help='right ascension [degrees]',type=float)
p.add_argument('dec',help='declination [degrees]',type=float)
p.add_argument('lat',help='WGS84 latitude of observer [degrees]',type=float)
p.add_argument('lon',help='WGS84 latitude of observer [degrees]',type=float)
p.add_argument('time',help='UTC time of observation YYYY-mm-ddTHH:MM:SSZ')
p = p.parse_args()
az_deg, el_deg = radec2azel(p.ra, p.dec, p.lat, p.lon, p.time)
print(az_deg)
print(el_deg)