-
Notifications
You must be signed in to change notification settings - Fork 73
/
Copy pathculminate.py
executable file
·34 lines (32 loc) · 1.34 KB
/
culminate.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/env python3
#
# culminate.py - Don Cross - 2019-08-10
#
# Example program for Astronomy Engine:
# https://github.com/cosinekitty/astronomy
#
# This example program shows how to calculate the time
# the Sun, Moon, and planets will next reach their highest point in the sky
# as seen by an observer at a given location on the Earth.
# This is called culmination, and is found by finding when
# each body's "hour angle" is 0.
#
# Having an hour angle of 0 is another way of saying that the body is
# crossing the meridian, the imaginary semicircle in the sky that passes
# from due north on the horizon, through the zenith (straight up),
# toward due south on the horizon. At this moment the body appears to
# have an azimuth of either 180 degrees (due south) or 0 (due north).
import sys
from astronomy import Body, SearchHourAngle
from astro_demo_common import ParseArgs
if __name__ == '__main__':
observer, time = ParseArgs(sys.argv)
body_list = [
Body.Sun, Body.Moon, Body.Mercury, Body.Venus, Body.Mars,
Body.Jupiter, Body.Saturn, Body.Uranus, Body.Neptune, Body.Pluto
]
print('search :', time)
for body in body_list:
evt = SearchHourAngle(body, observer, 0.0, time)
print('{:<8s} : {} altitude={:6.2f} azimuth={:7.2f}'.format(body.name, evt.time, evt.hor.altitude, evt.hor.azimuth))
sys.exit(0)