keplemon 0.1.9__cp313-cp313-win_amd64.whl → 2.0.2__cp313-cp313-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- keplemon/__init__.py +28 -10
- keplemon/__init__.pyi +24 -0
- keplemon/_keplemon.cp313-win_amd64.pyd +0 -0
- keplemon/bodies.pyi +190 -19
- keplemon/catalogs.pyi +6 -5
- keplemon/elements.py +16 -0
- keplemon/elements.pyi +161 -5
- keplemon/estimation.pyi +7 -4
- keplemon/events.py +12 -1
- keplemon/events.pyi +77 -3
- keplemon/exceptions.py +5 -0
- keplemon/propagation.py +3 -1
- keplemon/propagation.pyi +8 -0
- keplemon/saal/__init__.py +10 -0
- keplemon/saal/__init__.pyi +562 -0
- keplemon/saal/astro_func_interface.py +71 -0
- keplemon/saal/astro_func_interface.pyi +251 -0
- keplemon/saal/sat_state_interface.py +5 -0
- keplemon/saal/sat_state_interface.pyi +9 -0
- keplemon/saal/sgp4_prop_interface.py +7 -0
- keplemon/saal/sgp4_prop_interface.pyi +9 -0
- keplemon/saal/time_func_interface.py +17 -0
- keplemon/saal/time_func_interface.pyi +70 -0
- keplemon/time.py +25 -9
- keplemon/time.pyi +25 -1
- keplemon-2.0.2.dist-info/METADATA +21 -0
- {keplemon-0.1.9.dist-info → keplemon-2.0.2.dist-info}/RECORD +30 -21
- {keplemon-0.1.9.dist-info → keplemon-2.0.2.dist-info}/WHEEL +1 -1
- keplemon/saal.py +0 -15
- keplemon/saal.pyi +0 -8
- keplemon-0.1.9.dist-info/METADATA +0 -101
- /keplemon/{SGP4_Open_License.txt → assets/SGP4_Open_License.txt} +0 -0
- {keplemon-0.1.9.dist-info → keplemon-2.0.2.dist-info}/entry_points.txt +0 -0
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
from keplemon._keplemon.saal.astro_func_interface import ( # type: ignore
|
|
2
|
+
teme_to_topo,
|
|
3
|
+
ra_dec_to_az_el_time,
|
|
4
|
+
ra_dec_to_az_el,
|
|
5
|
+
mean_motion_to_sma,
|
|
6
|
+
sma_to_mean_motion,
|
|
7
|
+
kozai_to_brouwer,
|
|
8
|
+
brouwer_to_kozai,
|
|
9
|
+
topo_date_to_equinox,
|
|
10
|
+
topo_equinox_to_date,
|
|
11
|
+
theta_teme_to_lla,
|
|
12
|
+
time_teme_to_lla,
|
|
13
|
+
XA_TOPO_RA,
|
|
14
|
+
XA_TOPO_DEC,
|
|
15
|
+
XA_TOPO_AZ,
|
|
16
|
+
XA_TOPO_EL,
|
|
17
|
+
XA_TOPO_RANGE,
|
|
18
|
+
XA_TOPO_RADOT,
|
|
19
|
+
XA_TOPO_DECDOT,
|
|
20
|
+
XA_TOPO_AZDOT,
|
|
21
|
+
XA_TOPO_ELDOT,
|
|
22
|
+
XA_TOPO_RANGEDOT,
|
|
23
|
+
XA_TOPO_SIZE,
|
|
24
|
+
YROFEQNX_2000,
|
|
25
|
+
YROFEQNX_CURR,
|
|
26
|
+
get_jpl_sun_and_moon_position,
|
|
27
|
+
XA_RAE_RANGE,
|
|
28
|
+
XA_RAE_AZ,
|
|
29
|
+
XA_RAE_EL,
|
|
30
|
+
XA_RAE_RANGEDOT,
|
|
31
|
+
XA_RAE_AZDOT,
|
|
32
|
+
XA_RAE_ELDOT,
|
|
33
|
+
XA_RAE_SIZE,
|
|
34
|
+
horizon_to_teme,
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
__all__ = [
|
|
38
|
+
"teme_to_topo",
|
|
39
|
+
"ra_dec_to_az_el_time",
|
|
40
|
+
"ra_dec_to_az_el",
|
|
41
|
+
"theta_teme_to_lla",
|
|
42
|
+
"time_teme_to_lla",
|
|
43
|
+
"XA_TOPO_RA",
|
|
44
|
+
"XA_TOPO_DEC",
|
|
45
|
+
"XA_TOPO_AZ",
|
|
46
|
+
"XA_TOPO_EL",
|
|
47
|
+
"XA_TOPO_RANGE",
|
|
48
|
+
"XA_TOPO_RADOT",
|
|
49
|
+
"XA_TOPO_DECDOT",
|
|
50
|
+
"XA_TOPO_AZDOT",
|
|
51
|
+
"XA_TOPO_ELDOT",
|
|
52
|
+
"XA_TOPO_RANGEDOT",
|
|
53
|
+
"XA_TOPO_SIZE",
|
|
54
|
+
"mean_motion_to_sma",
|
|
55
|
+
"topo_date_to_equinox",
|
|
56
|
+
"YROFEQNX_2000",
|
|
57
|
+
"YROFEQNX_CURR",
|
|
58
|
+
"topo_equinox_to_date",
|
|
59
|
+
"get_jpl_sun_and_moon_position",
|
|
60
|
+
"kozai_to_brouwer",
|
|
61
|
+
"brouwer_to_kozai",
|
|
62
|
+
"sma_to_mean_motion",
|
|
63
|
+
"XA_RAE_RANGE",
|
|
64
|
+
"XA_RAE_AZ",
|
|
65
|
+
"XA_RAE_EL",
|
|
66
|
+
"XA_RAE_RANGEDOT",
|
|
67
|
+
"XA_RAE_AZDOT",
|
|
68
|
+
"XA_RAE_ELDOT",
|
|
69
|
+
"XA_RAE_SIZE",
|
|
70
|
+
"horizon_to_teme",
|
|
71
|
+
]
|
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
# flake8: noqa: F401
|
|
2
|
+
|
|
3
|
+
def mean_motion_to_sma(mean_motion: float) -> float:
|
|
4
|
+
"""
|
|
5
|
+
Convert mean motion to semi-major axis in kilometers.
|
|
6
|
+
|
|
7
|
+
Args:
|
|
8
|
+
mean_motion: Mean motion in revolutions/day.
|
|
9
|
+
"""
|
|
10
|
+
...
|
|
11
|
+
|
|
12
|
+
def sma_to_mean_motion(sma: float) -> float:
|
|
13
|
+
"""
|
|
14
|
+
Convert semi-major axis to mean motion in revolutions/day.
|
|
15
|
+
|
|
16
|
+
Args:
|
|
17
|
+
sma: Semi-major axis in kilometers.
|
|
18
|
+
"""
|
|
19
|
+
...
|
|
20
|
+
|
|
21
|
+
def kozai_to_brouwer(e_kozai: float, i_kozai: float, n_kozai: float) -> float:
|
|
22
|
+
"""
|
|
23
|
+
Convert Kozai orbital elements to Brouwer orbital elements.
|
|
24
|
+
|
|
25
|
+
Args:
|
|
26
|
+
e_kozai: Eccentricity (unitless).
|
|
27
|
+
i_kozai: Inclination in degrees.
|
|
28
|
+
n_kozai: Mean motion in revolutions/day.
|
|
29
|
+
"""
|
|
30
|
+
...
|
|
31
|
+
|
|
32
|
+
def brouwer_to_kozai(e_brouwer: float, i_brouwer: float, n_brouwer: float) -> float:
|
|
33
|
+
"""
|
|
34
|
+
Convert Brouwer orbital elements to Kozai orbital elements.
|
|
35
|
+
|
|
36
|
+
Args:
|
|
37
|
+
e_brouwer: Eccentricity (unitless).
|
|
38
|
+
i_brouwer: Inclination in degrees.
|
|
39
|
+
n_brouwer: Mean motion in revolutions/day.
|
|
40
|
+
"""
|
|
41
|
+
...
|
|
42
|
+
|
|
43
|
+
def ra_dec_to_az_el(
|
|
44
|
+
theta: float,
|
|
45
|
+
lat: float,
|
|
46
|
+
long: float,
|
|
47
|
+
ra: float,
|
|
48
|
+
dec: float,
|
|
49
|
+
) -> tuple[float, float]:
|
|
50
|
+
"""
|
|
51
|
+
Convert right ascension and declination to azimuth and elevation.
|
|
52
|
+
|
|
53
|
+
Args:
|
|
54
|
+
theta: Greenwich angle in radians.
|
|
55
|
+
lat: Sensor latitude in degrees.
|
|
56
|
+
long: Sensor longitude in degrees.
|
|
57
|
+
ra: TEME right ascension in degrees.
|
|
58
|
+
dec: TEME declination in degrees.
|
|
59
|
+
|
|
60
|
+
Returns:
|
|
61
|
+
A tuple containing azimuth and elevation in degrees.
|
|
62
|
+
"""
|
|
63
|
+
...
|
|
64
|
+
|
|
65
|
+
def ra_dec_to_az_el_time(
|
|
66
|
+
ds50_utc: float,
|
|
67
|
+
lat: float,
|
|
68
|
+
long: float,
|
|
69
|
+
ra: float,
|
|
70
|
+
dec: float,
|
|
71
|
+
) -> tuple[float, float]:
|
|
72
|
+
"""
|
|
73
|
+
Convert right ascension and declination to azimuth and elevation.
|
|
74
|
+
|
|
75
|
+
Args:
|
|
76
|
+
ds50_utc: Epoch in DS50 UTC format.
|
|
77
|
+
lat: Sensor latitude in degrees.
|
|
78
|
+
long: Sensor longitude in degrees.
|
|
79
|
+
ra: Right ascension in degrees.
|
|
80
|
+
dec: Declination in degrees.
|
|
81
|
+
|
|
82
|
+
Returns:
|
|
83
|
+
A tuple containing azimuth and elevation in degrees.
|
|
84
|
+
"""
|
|
85
|
+
...
|
|
86
|
+
|
|
87
|
+
def teme_to_topo(
|
|
88
|
+
theta: float,
|
|
89
|
+
lat: float,
|
|
90
|
+
sen_pos: list[float],
|
|
91
|
+
sat_pos: list[float],
|
|
92
|
+
sat_vel: list[float],
|
|
93
|
+
) -> list[float]:
|
|
94
|
+
"""
|
|
95
|
+
Convert TEME coordinates to topocentric coordinates.
|
|
96
|
+
|
|
97
|
+
Args:
|
|
98
|
+
theta: Greenwich angle plus the sensor longitude in radians.
|
|
99
|
+
lat: Latitude in degrees.
|
|
100
|
+
sen_pos: Sensor TEME position in kilometers.
|
|
101
|
+
sat_pos: Satellite TEME position in kilometers.
|
|
102
|
+
sat_vel: Satellite TEME velocity in kilometers/second.
|
|
103
|
+
|
|
104
|
+
Returns:
|
|
105
|
+
Topocentric coordinates as a list of floats.
|
|
106
|
+
"""
|
|
107
|
+
...
|
|
108
|
+
|
|
109
|
+
def horizon_to_teme(theta: float, lat: float, sen_pos: list[float], xa_rae: list[float]) -> list[float]:
|
|
110
|
+
"""
|
|
111
|
+
Convert horizon coordinates to TEME coordinates.
|
|
112
|
+
|
|
113
|
+
Args:
|
|
114
|
+
theta: Greenwich angle plus the sensor longitude in radians.
|
|
115
|
+
lat: Sensor latitude in degrees.
|
|
116
|
+
sen_pos: Sensor TEME position in kilometers.
|
|
117
|
+
xa_rae: RAE coordinates as a list of floats.
|
|
118
|
+
|
|
119
|
+
Returns:
|
|
120
|
+
TEME coordinates as a list of floats.
|
|
121
|
+
"""
|
|
122
|
+
...
|
|
123
|
+
|
|
124
|
+
def topo_date_to_equinox(yr_of_equinox: int, ds50utc: float, ra: float, dec: float) -> tuple[float, float]:
|
|
125
|
+
"""
|
|
126
|
+
Convert topocentric right ascension and declination to equinox coordinates for a given year of equinox.
|
|
127
|
+
|
|
128
|
+
Args:
|
|
129
|
+
yr_of_equinox: Year of the equinox (using YROFEQNX_ constants).
|
|
130
|
+
ds50utc: Epoch in DS50 UTC format.
|
|
131
|
+
ra: Topocentric right ascension in degrees.
|
|
132
|
+
dec: Topocentric declination in degrees.
|
|
133
|
+
|
|
134
|
+
Returns:
|
|
135
|
+
A tuple containing the equinox right ascension and declination in degrees.
|
|
136
|
+
"""
|
|
137
|
+
...
|
|
138
|
+
|
|
139
|
+
def topo_equinox_to_date(yr_of_equinox: int, ds50utc: float, ra: float, dec: float) -> tuple[float, float]:
|
|
140
|
+
"""
|
|
141
|
+
Convert equinox right ascension and declination to topocentric coordinates for a given year of equinox.
|
|
142
|
+
|
|
143
|
+
Args:
|
|
144
|
+
yr_of_equinox: Year of the equinox (using YROFEQNX_ constants).
|
|
145
|
+
ds50utc: Epoch in DS50 UTC format.
|
|
146
|
+
ra: Equinox right ascension in degrees.
|
|
147
|
+
dec: Equinox declination in degrees.
|
|
148
|
+
|
|
149
|
+
Returns:
|
|
150
|
+
A tuple containing the topocentric right ascension and declination in degrees.
|
|
151
|
+
"""
|
|
152
|
+
...
|
|
153
|
+
|
|
154
|
+
def theta_teme_to_lla(theta: float, lat: float, long: float, ra: float, dec: float) -> tuple[float, float]:
|
|
155
|
+
"""
|
|
156
|
+
Convert TEME coordinates to latitude, longitude, and altitude.
|
|
157
|
+
|
|
158
|
+
Args:
|
|
159
|
+
theta: Greenwich angle in radians.
|
|
160
|
+
lat: Sensor latitude in degrees.
|
|
161
|
+
long: Sensor longitude in degrees.
|
|
162
|
+
ra: TEME right ascension in degrees.
|
|
163
|
+
dec: TEME declination in degrees.
|
|
164
|
+
"""
|
|
165
|
+
...
|
|
166
|
+
|
|
167
|
+
def get_jpl_sun_and_moon_position(ds50_utc: float) -> tuple[list[float], list[float]]:
|
|
168
|
+
"""
|
|
169
|
+
Get the JPL ephemeris positions of the Sun and Moon in TEME coordinates.
|
|
170
|
+
|
|
171
|
+
Args:
|
|
172
|
+
ds50_utc: Epoch in DS50 UTC format.
|
|
173
|
+
|
|
174
|
+
Returns:
|
|
175
|
+
A tuple containing two lists:
|
|
176
|
+
- Sun position in TEME coordinates [x, y, z] in kilometers.
|
|
177
|
+
- Moon position in TEME coordinates [x, y, z] in kilometers.
|
|
178
|
+
"""
|
|
179
|
+
...
|
|
180
|
+
|
|
181
|
+
def time_teme_to_lla(ds50_utc: float, lat: float, long: float, ra: float, dec: float) -> tuple[float, float]:
|
|
182
|
+
"""
|
|
183
|
+
Convert TEME coordinates to latitude, longitude, and altitude.
|
|
184
|
+
|
|
185
|
+
Args:
|
|
186
|
+
ds50_utc: Epoch in DS50 UTC format.
|
|
187
|
+
lat: Sensor latitude in degrees.
|
|
188
|
+
long: Sensor longitude in degrees.
|
|
189
|
+
ra: TEME right ascension in degrees.
|
|
190
|
+
dec: TEME declination in degrees.
|
|
191
|
+
"""
|
|
192
|
+
|
|
193
|
+
XA_TOPO_AZ: int
|
|
194
|
+
"""Index for topocentric azimuth in degrees."""
|
|
195
|
+
|
|
196
|
+
XA_TOPO_EL: int
|
|
197
|
+
"""Index for topocentric elevation in degrees."""
|
|
198
|
+
|
|
199
|
+
XA_TOPO_RANGE: int
|
|
200
|
+
"""Index for topocentric range in kilometers."""
|
|
201
|
+
|
|
202
|
+
XA_TOPO_RADOT: int
|
|
203
|
+
"""Index for topocentric right ascension dot in degrees/second."""
|
|
204
|
+
|
|
205
|
+
XA_TOPO_DECDOT: int
|
|
206
|
+
"""Index for topocentric declination dot in degrees/second."""
|
|
207
|
+
|
|
208
|
+
XA_TOPO_AZDOT: int
|
|
209
|
+
"""Index for topocentric azimuth dot in degrees/second."""
|
|
210
|
+
|
|
211
|
+
XA_TOPO_ELDOT: int
|
|
212
|
+
"""Index for topocentric elevation dot in degrees/second."""
|
|
213
|
+
|
|
214
|
+
XA_TOPO_RANGEDOT: int
|
|
215
|
+
"""Index for topocentric range dot in kilometers/second."""
|
|
216
|
+
|
|
217
|
+
XA_TOPO_RA: int
|
|
218
|
+
"""Index for topocentric right ascension in degrees."""
|
|
219
|
+
|
|
220
|
+
XA_TOPO_DEC: int
|
|
221
|
+
"""Index for topocentric declination in degrees."""
|
|
222
|
+
|
|
223
|
+
XA_TOPO_SIZE: int
|
|
224
|
+
"""Size of XA_TOPO_ array"""
|
|
225
|
+
|
|
226
|
+
YROFEQNX_2000: int
|
|
227
|
+
"""Year of equinox 2000 constant"""
|
|
228
|
+
|
|
229
|
+
YROFEQNX_CURR: int
|
|
230
|
+
"""Year of current equinox constant"""
|
|
231
|
+
|
|
232
|
+
XA_RAE_RANGE: int
|
|
233
|
+
"""Index for RAE range in kilometers."""
|
|
234
|
+
|
|
235
|
+
XA_RAE_AZ: int
|
|
236
|
+
"""Index for RAE azimuth in degrees."""
|
|
237
|
+
|
|
238
|
+
XA_RAE_EL: int
|
|
239
|
+
"""Index for RAE elevation in degrees."""
|
|
240
|
+
|
|
241
|
+
XA_RAE_RANGEDOT: int
|
|
242
|
+
"""Index for RAE range rate in kilometers/second."""
|
|
243
|
+
|
|
244
|
+
XA_RAE_AZDOT: int
|
|
245
|
+
"""Index for RAE azimuth rate in degrees/second."""
|
|
246
|
+
|
|
247
|
+
XA_RAE_ELDOT: int
|
|
248
|
+
"""Index for RAE elevation rate in degrees/second."""
|
|
249
|
+
|
|
250
|
+
XA_RAE_SIZE: int
|
|
251
|
+
"""Size of XA_RAE_ array"""
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
def get_relative_state(state_1: list[float], state_2: list[float], utc_ds50: float) -> list[float]:
|
|
2
|
+
"""Calculate the relative state between two satellites
|
|
3
|
+
|
|
4
|
+
Args:
|
|
5
|
+
state_1: primary satellite TEME state vector [x, y, z, vx, vy, vz] in km and km/s
|
|
6
|
+
state_2: secondary satellite TEME state vector [x, y, z, vx, vy, vz] in km and km/s
|
|
7
|
+
utc_ds50: UTC time in days since 1950
|
|
8
|
+
"""
|
|
9
|
+
...
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
from keplemon._keplemon.saal.time_func_interface import ( # type: ignore
|
|
2
|
+
time_constants_loaded,
|
|
3
|
+
load_time_constants,
|
|
4
|
+
ds50_utc_to_ut1,
|
|
5
|
+
get_fk4_greenwich_angle,
|
|
6
|
+
get_fk5_greenwich_angle,
|
|
7
|
+
ymd_components_to_ds50,
|
|
8
|
+
)
|
|
9
|
+
|
|
10
|
+
__all__ = [
|
|
11
|
+
"time_constants_loaded",
|
|
12
|
+
"load_time_constants",
|
|
13
|
+
"ds50_utc_to_ut1",
|
|
14
|
+
"get_fk4_greenwich_angle",
|
|
15
|
+
"get_fk5_greenwich_angle",
|
|
16
|
+
"ymd_components_to_ds50",
|
|
17
|
+
]
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# flake8: noqa: F401
|
|
2
|
+
|
|
3
|
+
def ymd_components_to_ds50(year: int, month: int, day: int, hour: int, minute: int, second: float) -> float:
|
|
4
|
+
"""
|
|
5
|
+
Convert year, month, day, hour, minute, and second components to a DS50 time.
|
|
6
|
+
|
|
7
|
+
Args:
|
|
8
|
+
year: Year component.
|
|
9
|
+
month: Month component (1-12).
|
|
10
|
+
day: Day component (1-31).
|
|
11
|
+
hour: Hour component (0-23).
|
|
12
|
+
minute: Minute component (0-59).
|
|
13
|
+
second: Second component (0.0-59.999...).
|
|
14
|
+
|
|
15
|
+
Returns:
|
|
16
|
+
DS50 time as a float.
|
|
17
|
+
"""
|
|
18
|
+
...
|
|
19
|
+
|
|
20
|
+
def time_constants_loaded() -> bool:
|
|
21
|
+
"""
|
|
22
|
+
Returns:
|
|
23
|
+
True if time constants have been loaded to the SAAL binaries, False otherwise.
|
|
24
|
+
"""
|
|
25
|
+
...
|
|
26
|
+
|
|
27
|
+
def load_time_constants(file_path: str) -> None:
|
|
28
|
+
"""
|
|
29
|
+
Load time constants into from a file for use by the SAAL binaries.
|
|
30
|
+
|
|
31
|
+
Args:
|
|
32
|
+
Path to the SAAL-formatted time constants file.
|
|
33
|
+
"""
|
|
34
|
+
...
|
|
35
|
+
|
|
36
|
+
def ds50_utc_to_ut1(ds50: float) -> float:
|
|
37
|
+
"""
|
|
38
|
+
Convert a DS50 UTC time to UT1.
|
|
39
|
+
|
|
40
|
+
Args:
|
|
41
|
+
DS50 UTC time
|
|
42
|
+
|
|
43
|
+
Returns:
|
|
44
|
+
UT1 time
|
|
45
|
+
"""
|
|
46
|
+
...
|
|
47
|
+
|
|
48
|
+
def get_fk4_greenwich_angle(ds50_ut1: float) -> float:
|
|
49
|
+
"""
|
|
50
|
+
Get the FK4 Greenwich angle.
|
|
51
|
+
|
|
52
|
+
Args:
|
|
53
|
+
ds50_ut1: Epoch in DS50 UT1 format
|
|
54
|
+
|
|
55
|
+
Returns:
|
|
56
|
+
FK4 Greenwich angle in radians.
|
|
57
|
+
"""
|
|
58
|
+
...
|
|
59
|
+
|
|
60
|
+
def get_fk5_greenwich_angle(ds50_ut1: float) -> float:
|
|
61
|
+
"""
|
|
62
|
+
Get the FK5 Greenwich angle.
|
|
63
|
+
|
|
64
|
+
Args:
|
|
65
|
+
ds50_ut1: Epoch in DS50 UT1 format
|
|
66
|
+
|
|
67
|
+
Returns:
|
|
68
|
+
FK5 Greenwich angle in radians.
|
|
69
|
+
"""
|
|
70
|
+
...
|
keplemon/time.py
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
from keplemon._keplemon.time import ( # type: ignore
|
|
2
|
-
load_time_constants,
|
|
3
2
|
TimeSpan,
|
|
4
3
|
TimeComponents,
|
|
5
4
|
Epoch,
|
|
6
5
|
)
|
|
7
6
|
import requests # type: ignore
|
|
8
|
-
from datetime import datetime
|
|
7
|
+
from datetime import datetime, timezone
|
|
9
8
|
from keplemon._keplemon.enums import TimeSystem # type: ignore
|
|
10
9
|
|
|
11
10
|
__all__ = [
|
|
12
|
-
"load_time_constants",
|
|
13
11
|
"TimeSpan",
|
|
14
12
|
"TimeComponents",
|
|
15
13
|
"Epoch",
|
|
@@ -17,14 +15,32 @@ __all__ = [
|
|
|
17
15
|
]
|
|
18
16
|
|
|
19
17
|
|
|
18
|
+
def _from_datetime(dt: datetime) -> Epoch:
|
|
19
|
+
if dt.tzinfo is None:
|
|
20
|
+
dt = dt.replace(tzinfo=timezone.utc)
|
|
21
|
+
elif dt.tzinfo != timezone.utc:
|
|
22
|
+
dt = dt.astimezone(timezone.utc)
|
|
23
|
+
return Epoch.from_iso(dt.strftime("%Y-%m-%dT%H:%M:%S.%fZ"), TimeSystem.UTC)
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def _now() -> Epoch:
|
|
27
|
+
return _from_datetime(datetime.now(timezone.utc))
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def _to_datetime(epoch: Epoch) -> datetime:
|
|
31
|
+
iso_str = epoch.to_iso()
|
|
32
|
+
return datetime.fromisoformat(iso_str.replace("Z", "+00:00"))
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
Epoch.now = staticmethod(_now)
|
|
36
|
+
Epoch.from_datetime = staticmethod(_from_datetime)
|
|
37
|
+
Epoch.to_datetime = _to_datetime
|
|
38
|
+
|
|
39
|
+
|
|
20
40
|
def request_time_constants_update(output_path: str) -> None:
|
|
21
|
-
finals = requests.get(
|
|
22
|
-
"https://maia.usno.navy.mil/ser7/finals.all"
|
|
23
|
-
).text.splitlines()
|
|
41
|
+
finals = requests.get("https://maia.usno.navy.mil/ser7/finals.all").text.splitlines()
|
|
24
42
|
|
|
25
|
-
leap_seconds = requests.get(
|
|
26
|
-
"https://maia.usno.navy.mil/ser7/tai-utc.dat"
|
|
27
|
-
).text.splitlines()
|
|
43
|
+
leap_seconds = requests.get("https://maia.usno.navy.mil/ser7/tai-utc.dat").text.splitlines()
|
|
28
44
|
|
|
29
45
|
month_map = {
|
|
30
46
|
"JAN": 1,
|
keplemon/time.pyi
CHANGED
|
@@ -3,6 +3,7 @@ from __future__ import annotations
|
|
|
3
3
|
from pathlib import Path
|
|
4
4
|
from keplemon.enums import TimeSystem
|
|
5
5
|
from typing import overload, Any
|
|
6
|
+
from datetime import datetime
|
|
6
7
|
|
|
7
8
|
def request_time_constants_update(output_path: str | Path) -> None:
|
|
8
9
|
"""
|
|
@@ -145,6 +146,29 @@ class Epoch:
|
|
|
145
146
|
day_of_year: float
|
|
146
147
|
"""Decimal day of the year (1-365.999...)"""
|
|
147
148
|
|
|
149
|
+
def to_datetime(self) -> datetime:
|
|
150
|
+
"""
|
|
151
|
+
Returns:
|
|
152
|
+
Aware datetime object in UTC time system
|
|
153
|
+
"""
|
|
154
|
+
...
|
|
155
|
+
|
|
156
|
+
@classmethod
|
|
157
|
+
def from_datetime(cls, dt: datetime) -> Epoch:
|
|
158
|
+
"""
|
|
159
|
+
Args:
|
|
160
|
+
dt: Aware or naive datetime object (assumed to be UTC if naive)
|
|
161
|
+
"""
|
|
162
|
+
...
|
|
163
|
+
|
|
164
|
+
@classmethod
|
|
165
|
+
def now(cls) -> Epoch:
|
|
166
|
+
"""
|
|
167
|
+
Returns:
|
|
168
|
+
Current epoch in UTC time system
|
|
169
|
+
"""
|
|
170
|
+
...
|
|
171
|
+
|
|
148
172
|
@classmethod
|
|
149
173
|
def from_days_since_1950(cls, days: float, time_system: TimeSystem) -> Epoch:
|
|
150
174
|
"""
|
|
@@ -164,7 +188,7 @@ class Epoch:
|
|
|
164
188
|
...
|
|
165
189
|
|
|
166
190
|
@classmethod
|
|
167
|
-
def
|
|
191
|
+
def from_time_components(cls, components: TimeComponents, time_system: TimeSystem) -> Epoch:
|
|
168
192
|
"""
|
|
169
193
|
Args:
|
|
170
194
|
components: Epoch represented as individual components
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: keplemon
|
|
3
|
+
Version: 2.0.2
|
|
4
|
+
Requires-Dist: requests
|
|
5
|
+
Requires-Dist: click
|
|
6
|
+
Requires-Dist: maturin>=1.0,<2.0 ; extra == 'dev'
|
|
7
|
+
Requires-Dist: keplemon[test] ; extra == 'dev'
|
|
8
|
+
Requires-Dist: mkdocstrings[python] ; extra == 'dev'
|
|
9
|
+
Requires-Dist: mkdocs-material ; extra == 'dev'
|
|
10
|
+
Requires-Dist: markdown-include ; extra == 'dev'
|
|
11
|
+
Requires-Dist: tomli ; python_full_version < '3.11' and extra == 'dev'
|
|
12
|
+
Requires-Dist: pytest ; extra == 'test'
|
|
13
|
+
Provides-Extra: dev
|
|
14
|
+
Provides-Extra: test
|
|
15
|
+
Summary: Citra Space Corporation's Rust-accelerated astrodynamics library.
|
|
16
|
+
Author-email: Brandon Sexton <brandon@citra.space>
|
|
17
|
+
License-Expression: MIT
|
|
18
|
+
Requires-Python: >=3.9
|
|
19
|
+
Project-URL: Documentation, https://keplemon.citra.space
|
|
20
|
+
Project-URL: Repository, https://github.com/citra-space/keplemon.git
|
|
21
|
+
Project-URL: Issues, https://github.com/citra-space/keplemon/issues
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
keplemon-0.
|
|
2
|
-
keplemon-0.
|
|
3
|
-
keplemon-0.
|
|
1
|
+
keplemon-2.0.2.dist-info/METADATA,sha256=AWalszVe4jE3DXG797-dAgJlLM8XYP59NtjcwMnPIh8,863
|
|
2
|
+
keplemon-2.0.2.dist-info/WHEEL,sha256=lraoTyulw0EpTbLV2AtR5kXAJRP7w3nUqalBgpOHvcQ,97
|
|
3
|
+
keplemon-2.0.2.dist-info/entry_points.txt,sha256=eYbCkvQvWfRDQ0LzaCELov1xeLAxQEHlfdgNq-LXyb0,49
|
|
4
4
|
keplemon/AstroFunc.dll,sha256=RwDLeYGuSd3MxQ3O_Ljb0maS5KoDL8HZLpAvcQhDmnQ,357376
|
|
5
5
|
keplemon/AstroFunc.lib,sha256=q0Ob5NGUgbywJg6XqH48QLNmFv8T5p8NVLSx2kKkL4A,56480
|
|
6
6
|
keplemon/DllMain.dll,sha256=vYgOfGAUHn2z1MrVu9wV-k_LRdtuF8RuWrbuu2xk7jk,121344
|
|
@@ -13,7 +13,6 @@ keplemon/ExtEphem.dll,sha256=w5MHBNwWNzN-g-ktRpMl4e30na4ImVkb53Pz0C_kqP0,189440
|
|
|
13
13
|
keplemon/ExtEphem.lib,sha256=eHAH2Z9fIjWGIQ5APwvMVjTOwam46FvXBratKtI3nQ8,23564
|
|
14
14
|
keplemon/Obs.dll,sha256=32n3P_s2kyCt_Tdx9R4L7Zf-J9zP4qCKP2bFopKr_4M,508416
|
|
15
15
|
keplemon/Obs.lib,sha256=HtMrLI6WpUOfyLj-1g1Xej07IPhoXV9laMftqu2BTOo,47006
|
|
16
|
-
keplemon/SGP4_Open_License.txt,sha256=ThQ87DpbbXt-9K0-0U13tcZqsndte_UkaG3S0nLsfNY,8695
|
|
17
16
|
keplemon/SatState.dll,sha256=IVtdIIwq1X_5NN-V-OpbPH4ypWJEG7ES29IxttQMLvU,180224
|
|
18
17
|
keplemon/SatState.lib,sha256=h8WbZgcjyfZ8RnMPw7XJLN55KmW8cSm_XffvmBImwAI,18270
|
|
19
18
|
keplemon/Sensor.dll,sha256=MRmMoJfQPZEH0iKk4_haF5AxOeFfx1PH_Vne_rKx4eE,882688
|
|
@@ -28,10 +27,10 @@ keplemon/Tle.dll,sha256=Yt6hY3-PoJFFgB2idJQFC_Ia49grYhpSe_gPAmVswMs,195584
|
|
|
28
27
|
keplemon/Tle.lib,sha256=6NCJPR7JQ63mxCISyvYteq4-oHcqs3Ib8bwhTjJfk-I,23622
|
|
29
28
|
keplemon/Vcm.dll,sha256=EWx2eZAdBa1F2yGSUYzgAItnP6-nJT35sfJsrBW1Vfs,274432
|
|
30
29
|
keplemon/Vcm.lib,sha256=q2FPbH_DJXjIzNIzli2f1uV2faHHBjLbffZrL3Nagpw,19404
|
|
31
|
-
keplemon/__init__.py,sha256=
|
|
32
|
-
keplemon/__init__.pyi,sha256=
|
|
30
|
+
keplemon/__init__.py,sha256=2OlT1xsx5c_QHS1Mxg3wPmxMejkrx9d_gJ2NqPL6frk,1069
|
|
31
|
+
keplemon/__init__.pyi,sha256=PgtL8CNupZCJibx07RLmFf56gMkCFx7voUIxBpeADO8,1349
|
|
33
32
|
keplemon/__main__.py,sha256=Bbbzny3eE3NOikVCEVFAGJiSRGooAkLzPwoSz-rpaxc,689
|
|
34
|
-
keplemon/_keplemon.cp313-win_amd64.pyd,sha256=
|
|
33
|
+
keplemon/_keplemon.cp313-win_amd64.pyd,sha256=vS21AKryNrmYPtNOKw6E4m_mdkN7GKmfaIHNYTbNIww,1763840
|
|
35
34
|
keplemon/assets/EGM-2008.GEO,sha256=K2nG8HGLATIHZYMfw3GSClYOTCuZ7rq4RdCeUNgCw5A,148770
|
|
36
35
|
keplemon/assets/EGM-96.GEO,sha256=VBkILuvEMwAPuWmUHy2PeyEfULOwJ4PEJLNf5hr84mU,148770
|
|
37
36
|
keplemon/assets/GEM_5-22.GEO,sha256=stemYLn1ChXa-VdLGHYfa15AXZa_xxGZQ65p4c3gffI,6852
|
|
@@ -40,28 +39,38 @@ keplemon/assets/JGM2-70.GEO,sha256=7NCW-clrb7PddiBOf_GWrJ0Qf_ZjM823jU9mDIOVLG0,1
|
|
|
40
39
|
keplemon/assets/JPLcon_1950_2050.405,sha256=IRfVZmBTDAKGdMGTyZr06KSBY0N5PxRgEcljPrZB_iU,31222725
|
|
41
40
|
keplemon/assets/NWL8C-12.GEO,sha256=ZwDKiFC5AxrSIkDPBUnQMmZeSaA5272V-z8yn6bKjOs,4788
|
|
42
41
|
keplemon/assets/SEM68R-8.GEO,sha256=vJTCLrviQ9HonN9BojX8PbH0vPkL4qgpBxUc9X43sjI,2482
|
|
42
|
+
keplemon/assets/SGP4_Open_License.txt,sha256=ThQ87DpbbXt-9K0-0U13tcZqsndte_UkaG3S0nLsfNY,8695
|
|
43
43
|
keplemon/assets/WGS84-70.GEO,sha256=ARjEC_5s2SVd0Kh9udbTy1ztBwTeuBYPOhUVJgIqit8,148510
|
|
44
44
|
keplemon/assets/time_constants.dat,sha256=3nsYjFgq0QnTUHPxuQPdtMG-AqxShVbvmG2zPcZfdcA,1246208
|
|
45
45
|
keplemon/bodies.py,sha256=MjdAGL25eF5pA3KHo5ipjz0DDql5EEEbBqR735M254g,217
|
|
46
|
-
keplemon/bodies.pyi,sha256=
|
|
46
|
+
keplemon/bodies.pyi,sha256=dZxvvC1eAO07yEzIQUC1McbssOkKQlhOxFutN3L0x_Y,11666
|
|
47
47
|
keplemon/catalogs.py,sha256=AKONH7zWBOnUZI0ty0lYiYZtrdILfKivoUgk1nU3PZ8,107
|
|
48
|
-
keplemon/catalogs.pyi,sha256=
|
|
49
|
-
keplemon/elements.py,sha256=
|
|
50
|
-
keplemon/elements.pyi,sha256=
|
|
48
|
+
keplemon/catalogs.pyi,sha256=UxwRVMfuySXNYOQ7KuCXtwHcu3zL3Fgo1sBP77qUKaU,606
|
|
49
|
+
keplemon/elements.py,sha256=rt7imppVLQis245zAuaHC7sU8g78T-9_JrXm5PFPqyo,778
|
|
50
|
+
keplemon/elements.pyi,sha256=LrQnC0XGZIZ-RYOQKOfaI9yHxx03_hQN2urMl4MKL58,12495
|
|
51
51
|
keplemon/enums.py,sha256=5MejXeSwXPtfpIYeNuFQH3LSIRf4aTFZTK2Q1AYyaEg,325
|
|
52
52
|
keplemon/enums.pyi,sha256=OSS71WesYTgzWGUSjpxaYtzj6XmoyLBXq_Zd13IBwyQ,2418
|
|
53
53
|
keplemon/estimation.py,sha256=Of0rHiapW4s1wRipBCZrp4oOiIzs794w1nhqM7AVrGs,236
|
|
54
|
-
keplemon/estimation.pyi,sha256=
|
|
55
|
-
keplemon/events.py,sha256=
|
|
56
|
-
keplemon/events.pyi,sha256=
|
|
54
|
+
keplemon/estimation.pyi,sha256=aih6VgvowhnwgYS6x3I9UACcnjkMV-HWpRiWjsFMceQ,5781
|
|
55
|
+
keplemon/events.py,sha256=gl2eqYWkTtMxLPstZziIbNbeVHJzEiMPyhrFaC-gcmA,376
|
|
56
|
+
keplemon/events.pyi,sha256=TBE_hK4iummmhL0ERaJu9uzHz4LV4rZAF5LQZmFbD0U,3146
|
|
57
|
+
keplemon/exceptions.py,sha256=kdFwToNBHfbpzj311wHfTDztdgwRg2-OM3sHYhmd3AI,107
|
|
57
58
|
keplemon/libifcoremd.dll,sha256=x8iFLCgtUCJjWdfdmQycUx9BlXcNCW-Q3MeGpcIN12k,1885224
|
|
58
59
|
keplemon/libiomp5md.dll,sha256=C2O3Lj2yJYPGTyH0Z1c4FSrflnSzxHARp6y0dE3H2ZI,2030632
|
|
59
60
|
keplemon/libmmd.dll,sha256=Qf9bE3FoMllIyq4gRjhGK-Al9PVonTI0O5GP-dwuhb4,4449832
|
|
60
|
-
keplemon/propagation.py,sha256=
|
|
61
|
-
keplemon/propagation.pyi,sha256=
|
|
61
|
+
keplemon/propagation.py,sha256=Seec61RMvwbD3JOlCs4VTqtYwr7j_a4qDE7Cuoe11rY,246
|
|
62
|
+
keplemon/propagation.pyi,sha256=BjBIlp_8fdEb5gii5OsvLtXfIzV_Mo2pLlX75bZ1SDo,715
|
|
62
63
|
keplemon/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
63
|
-
keplemon/saal.py,sha256
|
|
64
|
-
keplemon/saal.pyi,sha256=
|
|
65
|
-
keplemon/
|
|
66
|
-
keplemon/
|
|
67
|
-
keplemon
|
|
64
|
+
keplemon/saal/__init__.py,sha256=4ton18W0K7sV9RRDRQPH09ZGWjx35pFYZwqTdPNW9Po,292
|
|
65
|
+
keplemon/saal/__init__.pyi,sha256=zrWhHHb9EFscQwgb02srkeCFhsd270ya5vv3sK0-0wI,17213
|
|
66
|
+
keplemon/saal/astro_func_interface.py,sha256=_KUk0nRjdaUgGoOHye_UQoN4NnOOh2II5qfsuqh97iI,1571
|
|
67
|
+
keplemon/saal/astro_func_interface.pyi,sha256=ZqVC8jFEJIgW0-y5VYD40zLWj8az-D-YGmxIfE_26Xc,7166
|
|
68
|
+
keplemon/saal/sat_state_interface.py,sha256=iiL_qIAaqXWlBu5FIdxhPWK4K9E7OmMzYIxkZPsShSo,139
|
|
69
|
+
keplemon/saal/sat_state_interface.pyi,sha256=w3KGIYiRuhpY1bx7Hp8F9gKbfDhi0ofBRSYcMw1glR0,423
|
|
70
|
+
keplemon/saal/sgp4_prop_interface.py,sha256=biuhXWIsauR4BO8chsWILfb8-E8OdRNWT5cSL3OYsVQ,134
|
|
71
|
+
keplemon/saal/sgp4_prop_interface.pyi,sha256=9NpOUhf03VQYVEyq1Kutqp6J6bZ3x0NCFSBlVY-Nb9s,244
|
|
72
|
+
keplemon/saal/time_func_interface.py,sha256=C18Q_PIMUFBcB0pHN6wlVj35Vrt83VQNKOEmHDHvZSA,438
|
|
73
|
+
keplemon/saal/time_func_interface.pyi,sha256=3QKtsuxMoTgG--bDvbVNcJyD8vfcAUlw2n69g1m0kNM,1578
|
|
74
|
+
keplemon/time.py,sha256=rjS9bRLlfdcELE25e72sjqTw5I2Igb50rNqeStpFC-k,3528
|
|
75
|
+
keplemon/time.pyi,sha256=IDSNfQa0zy4YspWSjdUAMzrGUrHzZUDWLBKz9WZ4ZA0,7067
|
|
76
|
+
keplemon-2.0.2.dist-info/RECORD,,
|
keplemon/saal.py
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
from keplemon._keplemon.saal import ( # type: ignore
|
|
2
|
-
get_key_mode,
|
|
3
|
-
set_key_mode,
|
|
4
|
-
topo_date_to_epoch,
|
|
5
|
-
topo_epoch_to_date,
|
|
6
|
-
topo_equinox_to_date,
|
|
7
|
-
)
|
|
8
|
-
|
|
9
|
-
__all__ = [
|
|
10
|
-
"get_key_mode",
|
|
11
|
-
"set_key_mode",
|
|
12
|
-
"topo_date_to_epoch",
|
|
13
|
-
"topo_epoch_to_date",
|
|
14
|
-
"topo_equinox_to_date",
|
|
15
|
-
]
|