-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdefault_data.py
More file actions
29 lines (20 loc) · 968 Bytes
/
Copy pathdefault_data.py
File metadata and controls
29 lines (20 loc) · 968 Bytes
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
"""Use the data bundled with the ``taiyin`` wheel.
Run after installing py-ephemeris. No DLL path or ephemeris-data path is
required for these default calculations.
"""
import taiyin
def main() -> None:
eph = taiyin.Ephemeris()
context = eph.create_context()
jd = taiyin.JulianDate.from_double(2460310.5)
# AUTO chooses the DE442-derived major-body OPM2 product where available.
mars, mars_flags = context.position.state_at_ut1(taiyin.Body.mars, jd)
print("Mars SSB state:", mars.position_au, mars_flags)
# The selected precise asteroid OPM2 files are included too.
ceres, ceres_flags = context.position.state_at_ut1(2000001, jd)
print("Ceres SSB state:", ceres.position_au, ceres_flags)
# The bundled lite star catalog is loaded by Ephemeris().
antares, antares_flags = context.stars.at_ut1("antares", jd)
print("Antares coordinates:", antares.coordinates, antares_flags)
if __name__ == "__main__":
main()