astrox-python 0.1.1__py3-none-any.whl → 0.2.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 +22 -2
- astrox/astrogator/__init__.py +8 -0
- astrox/astrogator/_api.py +60 -0
- astrox/astrogator/_models.py +1328 -0
- astrox/astrogator/_results.py +720 -0
- astrox/cat.py +465 -0
- astrox/catalog.py +175 -0
- astrox/celestial.py +153 -0
- astrox/conjunction.py +288 -0
- astrox/orbits.py +90 -1
- astrox/propagator.py +12 -18
- astrox/terrain.py +197 -0
- {astrox_python-0.1.1.dist-info → astrox_python-0.2.0.dist-info}/METADATA +1 -1
- {astrox_python-0.1.1.dist-info → astrox_python-0.2.0.dist-info}/RECORD +16 -7
- {astrox_python-0.1.1.dist-info → astrox_python-0.2.0.dist-info}/WHEEL +0 -0
- {astrox_python-0.1.1.dist-info → astrox_python-0.2.0.dist-info}/licenses/LICENSE +0 -0
astrox/__init__.py
CHANGED
|
@@ -4,7 +4,7 @@ Functions are organized by domain modules and can use package-level
|
|
|
4
4
|
configuration without requiring explicit client management:
|
|
5
5
|
|
|
6
6
|
import astrox
|
|
7
|
-
from astrox import access,
|
|
7
|
+
from astrox import access, celestial, catalog, components, coverage, lighting, orbits, propagator, terrain
|
|
8
8
|
|
|
9
9
|
astrox.configure(base_url="http://custom:8765", timeout=120)
|
|
10
10
|
orbit = orbits.keplerian(...)
|
|
@@ -26,7 +26,21 @@ Raw route access is available for advanced callers:
|
|
|
26
26
|
|
|
27
27
|
from importlib.metadata import PackageNotFoundError, version
|
|
28
28
|
|
|
29
|
-
from astrox import
|
|
29
|
+
from astrox import (
|
|
30
|
+
access,
|
|
31
|
+
astrogator,
|
|
32
|
+
catalog,
|
|
33
|
+
cat,
|
|
34
|
+
celestial,
|
|
35
|
+
conjunction,
|
|
36
|
+
components,
|
|
37
|
+
coverage,
|
|
38
|
+
lighting,
|
|
39
|
+
orbits,
|
|
40
|
+
propagator,
|
|
41
|
+
rocket,
|
|
42
|
+
terrain,
|
|
43
|
+
)
|
|
30
44
|
from astrox._http import Client, configure, get_session, raw
|
|
31
45
|
|
|
32
46
|
try:
|
|
@@ -39,11 +53,17 @@ __all__ = [
|
|
|
39
53
|
"configure",
|
|
40
54
|
"get_session",
|
|
41
55
|
"access",
|
|
56
|
+
"astrogator",
|
|
57
|
+
"catalog",
|
|
58
|
+
"cat",
|
|
59
|
+
"celestial",
|
|
60
|
+
"conjunction",
|
|
42
61
|
"coverage",
|
|
43
62
|
"components",
|
|
44
63
|
"lighting",
|
|
45
64
|
"orbits",
|
|
46
65
|
"propagator",
|
|
47
66
|
"rocket",
|
|
67
|
+
"terrain",
|
|
48
68
|
"raw",
|
|
49
69
|
]
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"""Pythonic Astrogator mission-control sequence API."""
|
|
2
|
+
|
|
3
|
+
from . import _models, _results
|
|
4
|
+
from ._api import run_mcs
|
|
5
|
+
from ._models import * # noqa: F403
|
|
6
|
+
from ._results import * # noqa: F403
|
|
7
|
+
|
|
8
|
+
__all__ = [*_models.__all__, *_results.__all__, "run_mcs"] # noqa: PLE0604
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"""Public Astrogator RunMCS endpoint."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from collections.abc import Sequence
|
|
6
|
+
|
|
7
|
+
from astrox._http import raw
|
|
8
|
+
from astrox.propagator import HpopConfig
|
|
9
|
+
|
|
10
|
+
from ._models import (
|
|
11
|
+
EngineConstant,
|
|
12
|
+
EntityPath,
|
|
13
|
+
MCSSegment,
|
|
14
|
+
_mission_wire,
|
|
15
|
+
)
|
|
16
|
+
from ._results import RunMCSResult, run_mcs_result_from_wire
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def _entities_to_wire(values: Sequence[EntityPath] | None) -> list[dict[str, object]] | None:
|
|
20
|
+
if values is None:
|
|
21
|
+
return None
|
|
22
|
+
if isinstance(values, (str, bytes)) or not isinstance(values, Sequence):
|
|
23
|
+
raise TypeError("entities must be a sequence of astrogator EntityPath values")
|
|
24
|
+
items = tuple(values)
|
|
25
|
+
if not all(isinstance(item, EntityPath) for item in items):
|
|
26
|
+
raise TypeError("entities must be a sequence of astrogator EntityPath values")
|
|
27
|
+
return [item.to_wire() for item in items]
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def run_mcs(
|
|
31
|
+
main_sequence: Sequence[MCSSegment],
|
|
32
|
+
*,
|
|
33
|
+
central_body: str = "Earth",
|
|
34
|
+
out_czml_frame_name: str = "INERTIAL",
|
|
35
|
+
compute_czml_positions: bool | None = None,
|
|
36
|
+
entities: Sequence[EntityPath] | None = None,
|
|
37
|
+
propagators: Sequence[HpopConfig] | None = None,
|
|
38
|
+
engine_models: Sequence[EngineConstant] | None = None,
|
|
39
|
+
text: str | None = None,
|
|
40
|
+
) -> RunMCSResult:
|
|
41
|
+
"""Run an ASTROX Astrogator mission-control sequence."""
|
|
42
|
+
|
|
43
|
+
payload = _mission_wire(
|
|
44
|
+
central_body=central_body,
|
|
45
|
+
main_sequence=main_sequence,
|
|
46
|
+
compute_czml_positions=compute_czml_positions,
|
|
47
|
+
out_czml_frame_name=out_czml_frame_name,
|
|
48
|
+
text=text,
|
|
49
|
+
propagators=propagators,
|
|
50
|
+
engine_models=engine_models,
|
|
51
|
+
)
|
|
52
|
+
entity_values = _entities_to_wire(entities)
|
|
53
|
+
if entity_values is not None:
|
|
54
|
+
payload["Entities"] = entity_values
|
|
55
|
+
|
|
56
|
+
result = raw.post("/Astrogator/RunMCS", json=payload)
|
|
57
|
+
return run_mcs_result_from_wire(result)
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
__all__ = ["run_mcs"]
|