Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from skyfield import almanac
- def main():
- ephemeris = api.load('de441.bsp')
- ts = api.load.timescale()
- utc = pytz.timezone("UTC")
- start = ts.utc(2023, 10, 1) # April 1, 2023
- stop = ts.utc(2023, 12, 31) # June 30, 2024
- # Get the function for moon's ascending node
- f = almanac.moon_nodes(ephemeris)
- # Find times when the function transitions from negative to positive
- t, y = almanac.find_discrete(start, stop, f)
- # Filter times by y == 1 (ascending node)
- ascending_node_times = t[y == 1]
- print('\n'.join(str(t.astimezone(utc)) for t in ascending_node_times))
- if __name__ == '__main__':
- main()
- python skyfieldnode3.py
- 2023-10-28 03:13:52.258425+00:00
- 2023-11-24 11:01:59.968357+00:00
- 2023-12-21 13:53:36.815745+00:00
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement