satnogs-predict 1.1__tar.gz → 1.2__tar.gz
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.
- {satnogs_predict-1.1 → satnogs_predict-1.2}/CHANGELOG.md +16 -0
- {satnogs_predict-1.1 → satnogs_predict-1.2}/PKG-INFO +1 -1
- {satnogs_predict-1.1 → satnogs_predict-1.2}/src/satnogs_predict/tle.py +16 -2
- {satnogs_predict-1.1 → satnogs_predict-1.2}/src/satnogs_predict.egg-info/PKG-INFO +1 -1
- satnogs_predict-1.2/src/satnogs_predict.egg-info/scm_version.json +8 -0
- {satnogs_predict-1.1 → satnogs_predict-1.2}/tests/test_tle.py +41 -0
- satnogs_predict-1.1/src/satnogs_predict.egg-info/scm_version.json +0 -8
- {satnogs_predict-1.1 → satnogs_predict-1.2}/.gitignore +0 -0
- {satnogs_predict-1.1 → satnogs_predict-1.2}/.gitlab-ci.yml +0 -0
- {satnogs_predict-1.1 → satnogs_predict-1.2}/.pre-commit-config.yaml +0 -0
- {satnogs_predict-1.1 → satnogs_predict-1.2}/.python-version +0 -0
- {satnogs_predict-1.1 → satnogs_predict-1.2}/CONTRIBUTING.md +0 -0
- {satnogs_predict-1.1 → satnogs_predict-1.2}/LICENSE +0 -0
- {satnogs_predict-1.1 → satnogs_predict-1.2}/README.md +0 -0
- {satnogs_predict-1.1 → satnogs_predict-1.2}/docs/docs.md +0 -0
- {satnogs_predict-1.1 → satnogs_predict-1.2}/pyproject.toml +0 -0
- {satnogs_predict-1.1 → satnogs_predict-1.2}/setup.cfg +0 -0
- {satnogs_predict-1.1 → satnogs_predict-1.2}/setup.py +0 -0
- {satnogs_predict-1.1 → satnogs_predict-1.2}/src/satnogs_predict/__init__.py +0 -0
- {satnogs_predict-1.1 → satnogs_predict-1.2}/src/satnogs_predict/constraints/__init__.py +0 -0
- {satnogs_predict-1.1 → satnogs_predict-1.2}/src/satnogs_predict/constraints/constraints.py +0 -0
- {satnogs_predict-1.1 → satnogs_predict-1.2}/src/satnogs_predict/core/__init__.py +0 -0
- {satnogs_predict-1.1 → satnogs_predict-1.2}/src/satnogs_predict/core/engine.py +0 -0
- {satnogs_predict-1.1 → satnogs_predict-1.2}/src/satnogs_predict/domain/__init__.py +0 -0
- {satnogs_predict-1.1 → satnogs_predict-1.2}/src/satnogs_predict/domain/constraints.py +0 -0
- {satnogs_predict-1.1 → satnogs_predict-1.2}/src/satnogs_predict/domain/geometry.py +0 -0
- {satnogs_predict-1.1 → satnogs_predict-1.2}/src/satnogs_predict/domain/observer.py +0 -0
- {satnogs_predict-1.1 → satnogs_predict-1.2}/src/satnogs_predict/domain/orbit.py +0 -0
- {satnogs_predict-1.1 → satnogs_predict-1.2}/src/satnogs_predict/domain/planner.py +0 -0
- {satnogs_predict-1.1 → satnogs_predict-1.2}/src/satnogs_predict/domain/time.py +0 -0
- {satnogs_predict-1.1 → satnogs_predict-1.2}/src/satnogs_predict/domain/validation.py +0 -0
- {satnogs_predict-1.1 → satnogs_predict-1.2}/src/satnogs_predict/domain/window.py +0 -0
- {satnogs_predict-1.1 → satnogs_predict-1.2}/src/satnogs_predict/planning/__init__.py +0 -0
- {satnogs_predict-1.1 → satnogs_predict-1.2}/src/satnogs_predict/planning/planner.py +0 -0
- {satnogs_predict-1.1 → satnogs_predict-1.2}/src/satnogs_predict/propagation/__init__.py +0 -0
- {satnogs_predict-1.1 → satnogs_predict-1.2}/src/satnogs_predict/propagation/propagator.py +0 -0
- {satnogs_predict-1.1 → satnogs_predict-1.2}/src/satnogs_predict/py.typed +0 -0
- {satnogs_predict-1.1 → satnogs_predict-1.2}/src/satnogs_predict/utils.py +0 -0
- {satnogs_predict-1.1 → satnogs_predict-1.2}/src/satnogs_predict.egg-info/SOURCES.txt +0 -0
- {satnogs_predict-1.1 → satnogs_predict-1.2}/src/satnogs_predict.egg-info/dependency_links.txt +0 -0
- {satnogs_predict-1.1 → satnogs_predict-1.2}/src/satnogs_predict.egg-info/requires.txt +0 -0
- {satnogs_predict-1.1 → satnogs_predict-1.2}/src/satnogs_predict.egg-info/scm_file_list.json +0 -0
- {satnogs_predict-1.1 → satnogs_predict-1.2}/src/satnogs_predict.egg-info/top_level.txt +0 -0
- {satnogs_predict-1.1 → satnogs_predict-1.2}/tests/__init__.py +0 -0
- {satnogs_predict-1.1 → satnogs_predict-1.2}/tests/conftest.py +0 -0
- {satnogs_predict-1.1 → satnogs_predict-1.2}/tests/constraints/test_constraints.py +0 -0
- {satnogs_predict-1.1 → satnogs_predict-1.2}/tests/core/test_engine.py +0 -0
- {satnogs_predict-1.1 → satnogs_predict-1.2}/tests/domain/test_observer.py +0 -0
- {satnogs_predict-1.1 → satnogs_predict-1.2}/tests/domain/test_orbit.py +0 -0
- {satnogs_predict-1.1 → satnogs_predict-1.2}/tests/domain/test_planner_domain.py +0 -0
- {satnogs_predict-1.1 → satnogs_predict-1.2}/tests/domain/test_required_fields.py +0 -0
- {satnogs_predict-1.1 → satnogs_predict-1.2}/tests/domain/test_time.py +0 -0
- {satnogs_predict-1.1 → satnogs_predict-1.2}/tests/domain/test_window.py +0 -0
- {satnogs_predict-1.1 → satnogs_predict-1.2}/tests/helpers.py +0 -0
- {satnogs_predict-1.1 → satnogs_predict-1.2}/tests/integration/test_fake_tle_integration.py +0 -0
- {satnogs_predict-1.1 → satnogs_predict-1.2}/tests/planning/test_planner.py +0 -0
- {satnogs_predict-1.1 → satnogs_predict-1.2}/tests/propagation/test_propagator.py +0 -0
- {satnogs_predict-1.1 → satnogs_predict-1.2}/uv.lock +0 -0
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.2
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- `generate_fake_tle()` encodes catalog numbers 100000–339999 in Alpha-5 format.
|
|
8
|
+
|
|
9
|
+
### Fixed
|
|
10
|
+
|
|
11
|
+
- `generate_fake_tle()` raises `ValueError` for catalog numbers outside 0–339999. Previously 6-digit numbers were silently truncated to their first five digits.
|
|
12
|
+
|
|
13
|
+
## 1.1
|
|
14
|
+
|
|
15
|
+
### Fixed
|
|
16
|
+
|
|
17
|
+
- `generate_fake_tle()` writes the epoch year as the last two digits of the year. Previously it used the first two digits (e.g. `20` for 2026), so every generated TLE had an epoch in 2020.
|
|
18
|
+
|
|
3
19
|
## 1.0
|
|
4
20
|
|
|
5
21
|
### Breaking Changes
|
|
@@ -29,6 +29,19 @@ class FakeTLEParameters:
|
|
|
29
29
|
|
|
30
30
|
DEFAULT_FAKE_TLE_PARAMETERS = FakeTLEParameters()
|
|
31
31
|
|
|
32
|
+
# Alpha-5 prefix letters for 10..33; I and O are skipped to avoid confusion with 1 and 0.
|
|
33
|
+
_ALPHA5_LETTERS = "ABCDEFGHJKLMNPQRSTUVWXYZ"
|
|
34
|
+
_MAX_ALPHA5_CATALOG_NUM = 339_999
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def _format_catalog_number(catalog_num: int) -> str:
|
|
38
|
+
if 0 <= catalog_num <= 99_999:
|
|
39
|
+
return f"{catalog_num:05d}"
|
|
40
|
+
if 100_000 <= catalog_num <= _MAX_ALPHA5_CATALOG_NUM:
|
|
41
|
+
prefix, remainder = divmod(catalog_num, 10_000)
|
|
42
|
+
return f"{_ALPHA5_LETTERS[prefix - 10]}{remainder:04d}"
|
|
43
|
+
raise ValueError(f"catalog_num must be between 0 and {_MAX_ALPHA5_CATALOG_NUM}")
|
|
44
|
+
|
|
32
45
|
|
|
33
46
|
def _tle_checksum(line_without_checksum: str) -> int:
|
|
34
47
|
total = 0
|
|
@@ -71,6 +84,7 @@ def generate_fake_tle(
|
|
|
71
84
|
right_ascension = (observer_location.lst_hours_at(skyfield_time) * 15.0) % 360.0
|
|
72
85
|
mean_anomaly = latitude % 360.0
|
|
73
86
|
|
|
87
|
+
catalog_number = _format_catalog_number(params.catalog_num)
|
|
74
88
|
epoch_year = epoch.year % 100
|
|
75
89
|
epoch_day = _epoch_day_of_year_fraction(epoch)
|
|
76
90
|
|
|
@@ -78,7 +92,7 @@ def generate_fake_tle(
|
|
|
78
92
|
|
|
79
93
|
line1_no_checksum = (
|
|
80
94
|
"1 {:5.5}{:.1} {:8.8} {:02d}{:012.8f} {:>10.10} {:>8.8} {:>8.8} 0 {:>4.4}".format(
|
|
81
|
-
|
|
95
|
+
catalog_number,
|
|
82
96
|
params.classifier,
|
|
83
97
|
params.cospar_id,
|
|
84
98
|
epoch_year,
|
|
@@ -92,7 +106,7 @@ def generate_fake_tle(
|
|
|
92
106
|
|
|
93
107
|
line2_no_checksum = (
|
|
94
108
|
"2 {:>5.5} {:>8.8} {:>8.4f} {:>7.7} {:>8.8} {:>8.4f} {:>11.11}{:>5.5}".format(
|
|
95
|
-
|
|
109
|
+
catalog_number,
|
|
96
110
|
params.inclination,
|
|
97
111
|
right_ascension,
|
|
98
112
|
params.eccentricity,
|
|
@@ -6,6 +6,7 @@ import pytest
|
|
|
6
6
|
from skyfield.api import EarthSatellite, load # type: ignore[import-untyped]
|
|
7
7
|
|
|
8
8
|
from satnogs_predict import generate_fake_tle
|
|
9
|
+
from satnogs_predict.tle import FakeTLEParameters
|
|
9
10
|
|
|
10
11
|
ts = load.timescale()
|
|
11
12
|
|
|
@@ -71,3 +72,43 @@ class TestGenerateFakeTle:
|
|
|
71
72
|
longitude=0.0,
|
|
72
73
|
date=datetime(2026, 3, 6, 12, 0, 0),
|
|
73
74
|
)
|
|
75
|
+
|
|
76
|
+
@pytest.mark.parametrize(
|
|
77
|
+
("catalog_num", "expected_field"),
|
|
78
|
+
[
|
|
79
|
+
(0, "00000"),
|
|
80
|
+
(25544, "25544"),
|
|
81
|
+
(99999, "99999"),
|
|
82
|
+
(100000, "A0000"),
|
|
83
|
+
(148493, "E8493"),
|
|
84
|
+
(182345, "J2345"),
|
|
85
|
+
(234567, "P4567"),
|
|
86
|
+
(339999, "Z9999"),
|
|
87
|
+
],
|
|
88
|
+
)
|
|
89
|
+
def test_given_catalog_num_when_generated_then_encodes_alpha5(
|
|
90
|
+
self, catalog_num: int, expected_field: str
|
|
91
|
+
) -> None:
|
|
92
|
+
tle = generate_fake_tle(
|
|
93
|
+
latitude=0.0,
|
|
94
|
+
longitude=0.0,
|
|
95
|
+
date=datetime(2026, 3, 6, 12, 0, 0, tzinfo=timezone.utc),
|
|
96
|
+
params=FakeTLEParameters(catalog_num=catalog_num),
|
|
97
|
+
)
|
|
98
|
+
|
|
99
|
+
assert tle.line1[2:7] == expected_field
|
|
100
|
+
assert tle.line2[2:7] == expected_field
|
|
101
|
+
sat = EarthSatellite(tle.line1, tle.line2, tle.line0, ts)
|
|
102
|
+
assert sat.model.satnum == catalog_num
|
|
103
|
+
|
|
104
|
+
@pytest.mark.parametrize("catalog_num", [-1, 340000, 1000000])
|
|
105
|
+
def test_given_out_of_range_catalog_num_when_generated_then_raises(
|
|
106
|
+
self, catalog_num: int
|
|
107
|
+
) -> None:
|
|
108
|
+
with pytest.raises(ValueError, match="catalog_num"):
|
|
109
|
+
generate_fake_tle(
|
|
110
|
+
latitude=0.0,
|
|
111
|
+
longitude=0.0,
|
|
112
|
+
date=datetime(2026, 3, 6, 12, 0, 0, tzinfo=timezone.utc),
|
|
113
|
+
params=FakeTLEParameters(catalog_num=catalog_num),
|
|
114
|
+
)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{satnogs_predict-1.1 → satnogs_predict-1.2}/src/satnogs_predict.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|