astrox-python 0.1.0__py3-none-any.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.
- astrox/__init__.py +49 -0
- astrox/_http.py +504 -0
- astrox/access.py +173 -0
- astrox/components/__init__.py +202 -0
- astrox/components/_axes.py +508 -0
- astrox/components/_common.py +141 -0
- astrox/components/_constraints.py +138 -0
- astrox/components/_objects.py +167 -0
- astrox/components/_positions.py +673 -0
- astrox/components/_rotations.py +115 -0
- astrox/components/_sensors.py +134 -0
- astrox/components/_vgt.py +337 -0
- astrox/coverage/__init__.py +41 -0
- astrox/coverage/_core.py +552 -0
- astrox/coverage/_fom.py +125 -0
- astrox/coverage/coverage_time.py +83 -0
- astrox/coverage/number_of_assets.py +160 -0
- astrox/coverage/response_time.py +160 -0
- astrox/coverage/revisit_time.py +160 -0
- astrox/coverage/simple_coverage.py +152 -0
- astrox/exceptions.py +92 -0
- astrox/lighting.py +121 -0
- astrox/orbits.py +499 -0
- astrox/propagator.py +1072 -0
- astrox/rocket.py +82 -0
- astrox_python-0.1.0.dist-info/METADATA +82 -0
- astrox_python-0.1.0.dist-info/RECORD +29 -0
- astrox_python-0.1.0.dist-info/WHEEL +4 -0
- astrox_python-0.1.0.dist-info/licenses/LICENSE +21 -0
astrox/rocket.py
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"""Rocket analysis functions."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from collections.abc import Sequence
|
|
6
|
+
from numbers import Real
|
|
7
|
+
from typing import Any
|
|
8
|
+
|
|
9
|
+
from astrox._http import raw
|
|
10
|
+
|
|
11
|
+
__all__ = [
|
|
12
|
+
"landing_zone",
|
|
13
|
+
]
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def _number_sequence_to_list(value: Sequence[float], *, parameter: str) -> list[float]:
|
|
17
|
+
if isinstance(value, (str, bytes)) or not isinstance(value, Sequence):
|
|
18
|
+
raise TypeError(f"{parameter} must be a sequence of numbers")
|
|
19
|
+
items = list(value)
|
|
20
|
+
if not all(isinstance(item, Real) and not isinstance(item, bool) for item in items):
|
|
21
|
+
raise TypeError(f"{parameter} must be a sequence of numbers")
|
|
22
|
+
return items
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def landing_zone(
|
|
26
|
+
*,
|
|
27
|
+
launch_longitude_deg: float,
|
|
28
|
+
launch_latitude_deg: float,
|
|
29
|
+
launch_height_m: float,
|
|
30
|
+
impact_longitude_deg: float,
|
|
31
|
+
impact_latitude_deg: float,
|
|
32
|
+
impact_height_m: float,
|
|
33
|
+
zone_xys_km: Sequence[float],
|
|
34
|
+
) -> dict[str, Any]:
|
|
35
|
+
"""Compute rocket landing-zone boundary geodetic coordinates.
|
|
36
|
+
|
|
37
|
+
Parameters match the ASTROX ``/LandingZone`` endpoint. ``zone_xys_km`` is a
|
|
38
|
+
flat sequence of local downrange/crossrange offsets in kilometres, given in
|
|
39
|
+
``[+X1, +Y1, +X2, +Y2, ...]`` pairs.
|
|
40
|
+
|
|
41
|
+
Cross-validation shows ASTROX builds a local right-handed frame at the
|
|
42
|
+
impact point: ``+X`` is the southward-facing member of the launch-to-impact
|
|
43
|
+
geodesic azimuth at the impact point and its supplement, and ``+Y`` is
|
|
44
|
+
``+X`` rotated 90 degrees clockwise. For cardinal tracks this coincides with
|
|
45
|
+
the OpenAPI "forward/right" description; for diagonal tracks it does not.
|
|
46
|
+
|
|
47
|
+
The function returns the raw ASTROX response dict, including ``IsSuccess``,
|
|
48
|
+
``Message``, and ``cartographicDegrees``.
|
|
49
|
+
|
|
50
|
+
Example:
|
|
51
|
+
>>> from astrox import rocket
|
|
52
|
+
>>> result = rocket.landing_zone(
|
|
53
|
+
... launch_longitude_deg=100.0,
|
|
54
|
+
... launch_latitude_deg=30.0,
|
|
55
|
+
... launch_height_m=0.0,
|
|
56
|
+
... impact_longitude_deg=101.0,
|
|
57
|
+
... impact_latitude_deg=30.5,
|
|
58
|
+
... impact_height_m=100.0,
|
|
59
|
+
... zone_xys_km=[1.0, 0.5, -1.0, 0.5, -1.0, -0.5, 1.0, -0.5],
|
|
60
|
+
... )
|
|
61
|
+
>>> result["IsSuccess"]
|
|
62
|
+
True
|
|
63
|
+
"""
|
|
64
|
+
zone_xys = _number_sequence_to_list(zone_xys_km, parameter="zone_xys_km")
|
|
65
|
+
if len(zone_xys) % 2 != 0:
|
|
66
|
+
raise ValueError("zone_xys_km must contain an even number of values")
|
|
67
|
+
|
|
68
|
+
payload: dict[str, Any] = {
|
|
69
|
+
"FaSheDian": [
|
|
70
|
+
launch_longitude_deg,
|
|
71
|
+
launch_latitude_deg,
|
|
72
|
+
launch_height_m,
|
|
73
|
+
],
|
|
74
|
+
"LuoDian": [
|
|
75
|
+
impact_longitude_deg,
|
|
76
|
+
impact_latitude_deg,
|
|
77
|
+
impact_height_m,
|
|
78
|
+
],
|
|
79
|
+
"ZoneXYs": zone_xys,
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
return raw.post("/LandingZone", json=payload)
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: astrox-python
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Python SDK for the ASTROX Web API.
|
|
5
|
+
Project-URL: Homepage, https://github.com/Mtrya/astrox-python
|
|
6
|
+
Project-URL: Repository, https://github.com/Mtrya/astrox-python.git
|
|
7
|
+
Project-URL: Issues, https://github.com/Mtrya/astrox-python/issues
|
|
8
|
+
Project-URL: Documentation, https://github.com/Mtrya/astrox-python/tree/main/docs
|
|
9
|
+
Author-email: Mtrya <erchanmion20@outlook.com>
|
|
10
|
+
License-Expression: MIT
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Keywords: astrodynamics,astrox,orbit,propagation,sdk,space
|
|
13
|
+
Classifier: Development Status :: 3 - Alpha
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Intended Audience :: Science/Research
|
|
16
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
17
|
+
Classifier: Operating System :: OS Independent
|
|
18
|
+
Classifier: Programming Language :: Python :: 3
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
23
|
+
Classifier: Topic :: Scientific/Engineering :: Astronomy
|
|
24
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
25
|
+
Requires-Python: >=3.10
|
|
26
|
+
Requires-Dist: requests>=2.34.2
|
|
27
|
+
Description-Content-Type: text/markdown
|
|
28
|
+
|
|
29
|
+
# astrox-python
|
|
30
|
+
|
|
31
|
+
Python SDK for the ASTROX Web API.
|
|
32
|
+
|
|
33
|
+
## Installation
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
pip install astrox-python
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Requires Python 3.10 or later.
|
|
40
|
+
|
|
41
|
+
## Quickstart
|
|
42
|
+
|
|
43
|
+
Propagate a simple Keplerian orbit with J2 perturbations:
|
|
44
|
+
|
|
45
|
+
```python
|
|
46
|
+
from astrox import orbits, propagator
|
|
47
|
+
|
|
48
|
+
orbit = orbits.keplerian(
|
|
49
|
+
semi_major_axis_m=6778137.0,
|
|
50
|
+
eccentricity=0.001,
|
|
51
|
+
inclination_deg=28.5,
|
|
52
|
+
argument_of_periapsis_deg=0.0,
|
|
53
|
+
raan_deg=0.0,
|
|
54
|
+
true_anomaly_deg=0.0,
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
period_s, position = propagator.j2(
|
|
58
|
+
start="2026-01-01T00:00:00Z",
|
|
59
|
+
stop="2026-01-01T01:00:00Z",
|
|
60
|
+
orbit_epoch="2026-01-01T00:00:00Z",
|
|
61
|
+
orbit=orbit,
|
|
62
|
+
)
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Documentation
|
|
66
|
+
|
|
67
|
+
- SDK guides and API notes: [`docs/sdk/`](./docs/sdk/)
|
|
68
|
+
- Runnable examples: [`examples/`](./examples/)
|
|
69
|
+
|
|
70
|
+
## Development
|
|
71
|
+
|
|
72
|
+
Install from a checkout:
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
uv sync --group dev
|
|
76
|
+
uv build --no-build-isolation
|
|
77
|
+
uv run python -m pytest -q tests/sdk
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## License
|
|
81
|
+
|
|
82
|
+
MIT — see [LICENSE](./LICENSE).
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
astrox/__init__.py,sha256=a-QdWpMqbGR4ZYqJ2M_tSaQv5-YlmnmhUAcCpuQ8RnI,1283
|
|
2
|
+
astrox/_http.py,sha256=ZZDkJ6qPG4VbMDRZO7xonIib88aYS6PPTVRxRYwXU3A,15606
|
|
3
|
+
astrox/access.py,sha256=pjyCher_yQNmkoojf2sWpG1HRDnLLK9gI90jM1iEoTo,5817
|
|
4
|
+
astrox/exceptions.py,sha256=apClRT1r-N3XY1ibXxkW3oxpsJgiHos4tC0cMJ8eBRk,2592
|
|
5
|
+
astrox/lighting.py,sha256=aWMty64rU3wv1H1Q5q-yXG5mINbIY31omyd-pjdNaVs,3876
|
|
6
|
+
astrox/orbits.py,sha256=scbs5EsMytlP8cFoDF3UGqNqgROYR5CfGlsRz7kpDs4,14996
|
|
7
|
+
astrox/propagator.py,sha256=igdFZFz2kDdhKtVjTDziMiY99jdBjfo35MNnfITgOB0,37471
|
|
8
|
+
astrox/rocket.py,sha256=tb6wXc4bZ0EMAd9bVzva_7k3I9S2lsYA7Q2RD6byqfk,2755
|
|
9
|
+
astrox/components/__init__.py,sha256=X7Owt7Ou5tRShjucx9QkYPF-tEYJ0bMrxBRhw61LC6I,4455
|
|
10
|
+
astrox/components/_axes.py,sha256=ZabN28oH77_3kqU2jFBfqxPh_5GYa3XAp-SU9L8btC0,15642
|
|
11
|
+
astrox/components/_common.py,sha256=EejS6mxPojEm-KLD3T3eB8IlkPA4i7FGNM8-IjS00pk,4564
|
|
12
|
+
astrox/components/_constraints.py,sha256=6WUNCQsy5WpXoEr7PJgeH_zQkIZolPYGA0-z9BrD2pw,4692
|
|
13
|
+
astrox/components/_objects.py,sha256=wl61rFCY5jigdNPgjO6TLLtZevOUfKEWYXKc2BRZT0U,5805
|
|
14
|
+
astrox/components/_positions.py,sha256=9w1AbVkM0_Fqw8SED_PTxTvM9Ro4Lo9qXB8b-JrXkqw,23345
|
|
15
|
+
astrox/components/_rotations.py,sha256=BojDBogMkD3MYG2pRDRSm2zvfTommXtzybVX_UU-h3c,3039
|
|
16
|
+
astrox/components/_sensors.py,sha256=0jQRgLewUmF1Kl7q_8l17-wAjrrkfreF763PIIU8dmQ,4216
|
|
17
|
+
astrox/components/_vgt.py,sha256=gU60Sc6fluUn04LAG_c1OUnMOz3TK-MhTexiLhm5qRc,10617
|
|
18
|
+
astrox/coverage/__init__.py,sha256=h5DpTK7j4CJdtfP7wGZLkS7VO_tVdI0cYj4O-My8TQw,853
|
|
19
|
+
astrox/coverage/_core.py,sha256=o5qV5dpaAEIbTUJituomx6sqMkFX9eNVGuCVcvC4hrI,18607
|
|
20
|
+
astrox/coverage/_fom.py,sha256=QumQrm6oTexShYqcc_-lPQmxbJgK1AZQepgthRh0Kqk,3924
|
|
21
|
+
astrox/coverage/coverage_time.py,sha256=RaTmtcFdawAkTXoQNntVMzCl4nN2JL8iCJ3EtYwfCck,2684
|
|
22
|
+
astrox/coverage/number_of_assets.py,sha256=Bf1OQRu1r9lunyARyQoV4x7KetkgY_7OMNcEcDCeS64,5187
|
|
23
|
+
astrox/coverage/response_time.py,sha256=yLnv8eEDL6CS0PJHC1JIKBCoOachOwo3m8dNoHH3HfQ,5164
|
|
24
|
+
astrox/coverage/revisit_time.py,sha256=R5vF2egixCF9elvsGYXzpgWbD5lfcQW8uZqi1ifIDX8,5155
|
|
25
|
+
astrox/coverage/simple_coverage.py,sha256=ZPj3HrP3M59rG47pz4eHt1rq-vTlk-oZ7c2ZBmFsz1U,4992
|
|
26
|
+
astrox_python-0.1.0.dist-info/METADATA,sha256=nYmEBu5MJlV82ndyO0bRLFbpnVlvHJbexWtCSyTFy_g,2179
|
|
27
|
+
astrox_python-0.1.0.dist-info/WHEEL,sha256=mffPy8wBnZQn2VnJUU5jE99KsxaSfiyMHV9Yt0aLVxs,87
|
|
28
|
+
astrox_python-0.1.0.dist-info/licenses/LICENSE,sha256=Fbt55lCQnv_n5yGhbG_VDlowjaV_FPHBQWsJIyuBpDk,1062
|
|
29
|
+
astrox_python-0.1.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Mtrya
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|