@@ -53,6 +53,54 @@ The [Cesium visualization example](examples/README.md) propagates the entire act
5353pip install astroz
5454```
5555
56+ #### python-sgp4 Compatible API (Recommended)
57+
58+ Drop-in replacement for [ python-sgp4] ( https://github.com/brandon-rhodes/python-sgp4 ) . Just change the import for instant speedup:
59+
60+ ``` python
61+ # Before # After
62+ from sgp4.api import Satrec, jday → from astroz.api import Satrec, jday
63+ ```
64+
65+ | Your Code | python-sgp4 | astroz | Speedup |
66+ | -----------| -------------| --------| ---------|
67+ | ` sat.sgp4() ` loop | 1.3M/s | 2.5M/s | ** 2x** |
68+ | ` sat.sgp4_array() ` | 2.7M/s | 15M/s | ** 5x** |
69+ | ` SatrecArray.sgp4() ` | 3M/s | 290M/s | ** 100x** |
70+
71+ See [ migration guide] ( bindings/python/README.md#migrating-from-python-sgp4 ) for optimization tips.
72+
73+ ``` python
74+ from astroz.api import Satrec, SatrecArray, jday, WGS72
75+ import numpy as np
76+
77+ # Single satellite (same syntax as python-sgp4)
78+ line1 = " 1 25544U 98067A 24127.82853009 .00015698 00000+0 27310-3 0 9995"
79+ line2 = " 2 25544 51.6393 160.4574 0003580 140.6673 205.7250 15.50957674452123"
80+ sat = Satrec.twoline2rv(line1, line2, WGS72 )
81+
82+ jd, fr = jday(2024 , 5 , 6 , 12 , 0 , 0.0 )
83+ error, position, velocity = sat.sgp4(jd, fr)
84+
85+ # Batch propagation (270-330M props/sec with SIMD)
86+ sat_array = SatrecArray([sat1, sat2, ... ]) # List of Satrec objects
87+
88+ # Single time point (scalars)
89+ e, r, v = sat_array.sgp4(2460000.5 , 0.5 )
90+
91+ # Multiple time points (arrays)
92+ jd = np.full(1440 , 2460000.5 )
93+ fr = np.linspace(0 , 1 , 1440 )
94+ e, r, v = sat_array.sgp4(jd, fr) # (n_sats, n_times, 3)
95+
96+ # Skip velocities for 30% faster propagation
97+ e, r, _ = sat_array.sgp4(jd, fr, velocities = False )
98+ ```
99+
100+ #### High-Level API
101+
102+ Convenience functions for common workflows:
103+
56104``` python
57105from astroz import propagate, Constellation
58106import numpy as np
0 commit comments