satnogs-predict 1.1__tar.gz → 1.3__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.
Files changed (58) hide show
  1. {satnogs_predict-1.1 → satnogs_predict-1.3}/CHANGELOG.md +16 -0
  2. {satnogs_predict-1.1 → satnogs_predict-1.3}/PKG-INFO +1 -1
  3. {satnogs_predict-1.1 → satnogs_predict-1.3}/src/satnogs_predict/propagation/propagator.py +2 -0
  4. {satnogs_predict-1.1 → satnogs_predict-1.3}/src/satnogs_predict/tle.py +16 -2
  5. {satnogs_predict-1.1 → satnogs_predict-1.3}/src/satnogs_predict.egg-info/PKG-INFO +1 -1
  6. satnogs_predict-1.3/src/satnogs_predict.egg-info/scm_version.json +8 -0
  7. {satnogs_predict-1.1 → satnogs_predict-1.3}/tests/test_tle.py +41 -0
  8. satnogs_predict-1.1/src/satnogs_predict.egg-info/scm_version.json +0 -8
  9. {satnogs_predict-1.1 → satnogs_predict-1.3}/.gitignore +0 -0
  10. {satnogs_predict-1.1 → satnogs_predict-1.3}/.gitlab-ci.yml +0 -0
  11. {satnogs_predict-1.1 → satnogs_predict-1.3}/.pre-commit-config.yaml +0 -0
  12. {satnogs_predict-1.1 → satnogs_predict-1.3}/.python-version +0 -0
  13. {satnogs_predict-1.1 → satnogs_predict-1.3}/CONTRIBUTING.md +0 -0
  14. {satnogs_predict-1.1 → satnogs_predict-1.3}/LICENSE +0 -0
  15. {satnogs_predict-1.1 → satnogs_predict-1.3}/README.md +0 -0
  16. {satnogs_predict-1.1 → satnogs_predict-1.3}/docs/docs.md +0 -0
  17. {satnogs_predict-1.1 → satnogs_predict-1.3}/pyproject.toml +0 -0
  18. {satnogs_predict-1.1 → satnogs_predict-1.3}/setup.cfg +0 -0
  19. {satnogs_predict-1.1 → satnogs_predict-1.3}/setup.py +0 -0
  20. {satnogs_predict-1.1 → satnogs_predict-1.3}/src/satnogs_predict/__init__.py +0 -0
  21. {satnogs_predict-1.1 → satnogs_predict-1.3}/src/satnogs_predict/constraints/__init__.py +0 -0
  22. {satnogs_predict-1.1 → satnogs_predict-1.3}/src/satnogs_predict/constraints/constraints.py +0 -0
  23. {satnogs_predict-1.1 → satnogs_predict-1.3}/src/satnogs_predict/core/__init__.py +0 -0
  24. {satnogs_predict-1.1 → satnogs_predict-1.3}/src/satnogs_predict/core/engine.py +0 -0
  25. {satnogs_predict-1.1 → satnogs_predict-1.3}/src/satnogs_predict/domain/__init__.py +0 -0
  26. {satnogs_predict-1.1 → satnogs_predict-1.3}/src/satnogs_predict/domain/constraints.py +0 -0
  27. {satnogs_predict-1.1 → satnogs_predict-1.3}/src/satnogs_predict/domain/geometry.py +0 -0
  28. {satnogs_predict-1.1 → satnogs_predict-1.3}/src/satnogs_predict/domain/observer.py +0 -0
  29. {satnogs_predict-1.1 → satnogs_predict-1.3}/src/satnogs_predict/domain/orbit.py +0 -0
  30. {satnogs_predict-1.1 → satnogs_predict-1.3}/src/satnogs_predict/domain/planner.py +0 -0
  31. {satnogs_predict-1.1 → satnogs_predict-1.3}/src/satnogs_predict/domain/time.py +0 -0
  32. {satnogs_predict-1.1 → satnogs_predict-1.3}/src/satnogs_predict/domain/validation.py +0 -0
  33. {satnogs_predict-1.1 → satnogs_predict-1.3}/src/satnogs_predict/domain/window.py +0 -0
  34. {satnogs_predict-1.1 → satnogs_predict-1.3}/src/satnogs_predict/planning/__init__.py +0 -0
  35. {satnogs_predict-1.1 → satnogs_predict-1.3}/src/satnogs_predict/planning/planner.py +0 -0
  36. {satnogs_predict-1.1 → satnogs_predict-1.3}/src/satnogs_predict/propagation/__init__.py +0 -0
  37. {satnogs_predict-1.1 → satnogs_predict-1.3}/src/satnogs_predict/py.typed +0 -0
  38. {satnogs_predict-1.1 → satnogs_predict-1.3}/src/satnogs_predict/utils.py +0 -0
  39. {satnogs_predict-1.1 → satnogs_predict-1.3}/src/satnogs_predict.egg-info/SOURCES.txt +0 -0
  40. {satnogs_predict-1.1 → satnogs_predict-1.3}/src/satnogs_predict.egg-info/dependency_links.txt +0 -0
  41. {satnogs_predict-1.1 → satnogs_predict-1.3}/src/satnogs_predict.egg-info/requires.txt +0 -0
  42. {satnogs_predict-1.1 → satnogs_predict-1.3}/src/satnogs_predict.egg-info/scm_file_list.json +0 -0
  43. {satnogs_predict-1.1 → satnogs_predict-1.3}/src/satnogs_predict.egg-info/top_level.txt +0 -0
  44. {satnogs_predict-1.1 → satnogs_predict-1.3}/tests/__init__.py +0 -0
  45. {satnogs_predict-1.1 → satnogs_predict-1.3}/tests/conftest.py +0 -0
  46. {satnogs_predict-1.1 → satnogs_predict-1.3}/tests/constraints/test_constraints.py +0 -0
  47. {satnogs_predict-1.1 → satnogs_predict-1.3}/tests/core/test_engine.py +0 -0
  48. {satnogs_predict-1.1 → satnogs_predict-1.3}/tests/domain/test_observer.py +0 -0
  49. {satnogs_predict-1.1 → satnogs_predict-1.3}/tests/domain/test_orbit.py +0 -0
  50. {satnogs_predict-1.1 → satnogs_predict-1.3}/tests/domain/test_planner_domain.py +0 -0
  51. {satnogs_predict-1.1 → satnogs_predict-1.3}/tests/domain/test_required_fields.py +0 -0
  52. {satnogs_predict-1.1 → satnogs_predict-1.3}/tests/domain/test_time.py +0 -0
  53. {satnogs_predict-1.1 → satnogs_predict-1.3}/tests/domain/test_window.py +0 -0
  54. {satnogs_predict-1.1 → satnogs_predict-1.3}/tests/helpers.py +0 -0
  55. {satnogs_predict-1.1 → satnogs_predict-1.3}/tests/integration/test_fake_tle_integration.py +0 -0
  56. {satnogs_predict-1.1 → satnogs_predict-1.3}/tests/planning/test_planner.py +0 -0
  57. {satnogs_predict-1.1 → satnogs_predict-1.3}/tests/propagation/test_propagator.py +0 -0
  58. {satnogs_predict-1.1 → satnogs_predict-1.3}/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
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: satnogs-predict
3
- Version: 1.1
3
+ Version: 1.3
4
4
  Summary: A package for calculating passes and observation windows for satellites.
5
5
  Requires-Python: >=3.11
6
6
  Description-Content-Type: text/markdown
@@ -372,6 +372,8 @@ def obs_window_from_range(
372
372
  sat_identifier=satellite.identifier,
373
373
  observer_identifier=observer.identifier,
374
374
  has_multiple_peaks=has_multiple_peaks,
375
+ overlapped=origin_pass.overlapped if origin_pass else False,
376
+ overlap_ratio=origin_pass.overlap_ratio if origin_pass else 0.0,
375
377
  )
376
378
 
377
379
 
@@ -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
- f"{params.catalog_num:05d}",
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
- f"{params.catalog_num:05d}",
109
+ catalog_number,
96
110
  params.inclination,
97
111
  right_ascension,
98
112
  params.eccentricity,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: satnogs-predict
3
- Version: 1.1
3
+ Version: 1.3
4
4
  Summary: A package for calculating passes and observation windows for satellites.
5
5
  Requires-Python: >=3.11
6
6
  Description-Content-Type: text/markdown
@@ -0,0 +1,8 @@
1
+ {
2
+ "tag": "1.3",
3
+ "distance": 0,
4
+ "node": "g996252b857e8224ca6287d43f4c4b36cea41a54e",
5
+ "dirty": false,
6
+ "branch": "HEAD",
7
+ "node_date": "2026-11-15"
8
+ }
@@ -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
+ )
@@ -1,8 +0,0 @@
1
- {
2
- "tag": "1.1",
3
- "distance": 0,
4
- "node": "gc483a54c922a0e8c97e89fa9fd0c1dc4190ffd17",
5
- "dirty": false,
6
- "branch": "HEAD",
7
- "node_date": "2026-10-01"
8
- }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes