pysgp4¶
rapper for the SGP4 propagator
Contents¶
SGP4
-
class
sorts.propagator.pysgp4.
SGP4
(settings=None, **kwargs)[source] Bases:
sorts.propagator.base.Propagator
Propagator class implementing the SGP4 propagator.
Frame options are found in the sorts.frames.convert function.
- Variables
- Parameters
in_frame (str) – String identifying the input frame.
out_frame (str) – String identifying the output frame.
-
TEME_to_TLE
(state, epoch, B=0.0, kepler=False, tol=1e-05, tol_v=1e-07)[source] Convert osculating orbital elements in TEME to mean elements used in two line element sets (TLE’s).
- Parameters
kep (numpy.ndarray) – Osculating State (position and velocity) vector in m and m/s, TEME frame. If
kepler = True
then state is osculating orbital elements, in m and radians. Orbital elements are semi major axis (m), orbital eccentricity, orbital inclination (radians), right ascension of ascending node (radians), argument of perigee (radians), mean anomaly (radians)kepler (bool) – Indicates if input state is kepler elements or cartesian.
epoch (astropy.time.Time) – Epoch of the orbit
tol (float) – Wanted precision in position of mean element conversion in m.
tol_v (float) – Wanted precision in velocity mean element conversion in m/s.
- Returns
mean elements of: semi major axis (km), orbital eccentricity, orbital inclination (radians), right ascension of ascending node (radians), argument of perigee (radians), mean anomaly (radians)
- Return type
-
TEME_to_TLE_OPTIM
(state, epoch, B=0.0, kepler=False, tol=1e-08, tol_v=1e-09)[source] Convert osculating orbital elements in TEME to mean elements used in two line element sets (TLE’s).
- Parameters
kep (numpy.ndarray) – Osculating State (position and velocity) vector in m and m/s, TEME frame. If
kepler = True
then state is osculating orbital elements, in m and radians. Orbital elements are semi major axis (m), orbital eccentricity, orbital inclination (radians), right ascension of ascending node (radians), argument of perigee (radians), mean anomaly (radians)kepler (bool) – Indicates if input state is kepler elements or cartesian.
epoch0 (float) – Epoch in days since 1949 December 31 00:00 UT
tol (float) – Wanted precision in position of mean element conversion in m.
tol_v (float) – Wanted precision in velocity mean element conversion in m/s.
- Returns
mean elements of: semi major axis (km), orbital eccentricity, orbital inclination (radians), right ascension of ascending node (radians), argument of perigee (radians), mean anomaly (radians)
- Return type
-
convert_time
(t, epoch) Convert input time and epoch variables to
astropy.TimeDelta
andastropy.Time
variables of the correct format and scale.
-
get_mean_elements
(line1, line2, radians=False)[source] Extract the mean elements in SI units (a [m], e [1], inc [deg], raan [deg], aop [deg], mu [deg]), B-parameter (not bstar) and epoch from a two line element pair.
-
heartbeat
(t, state, **kwargs) Function applied after propagation to time t and state state, before next time step as given in the input time vector to propagate.
-
propagate
(t, state0, epoch=None, **kwargs)[source] Propagate a state
#TODO: UPDATE THIS DOCSTRING
All state-vector are given in SI units.
Keyword arguments contain only information needed for ballistic coefficient
B
used by SGP4. EitherB
orC_D
,A
andm
must be supplied. They also contain a option to give angles in radians or degrees. By default input is assumed to be degrees.Frame:
The input frame is ECI (TEME) for orbital elements and Cartesian. The output frame is as standard ECEF (ITRF). But can be set to TEME.
- Parameters
t (float/list/numpy.ndarray/astropy.time.TimeDelta) – Time to propagate relative the initial state epoch.
epoch (float/astropy.time.Time) – The epoch of the initial state.
state0 (numpy.ndarray) – 6-D Cartesian state vector in SI-units.
B (float) – Ballistic coefficient
C_D (float) – Drag coefficient
A (float) – Cross-sectional Area
m (float) – Mass
radians (bool) – If true, all angles are assumed to be in radians.
SGP4_mean_elements (bool) – If True, the input is not cartesian state but SGP4 mean elements.
- Returns
6-D Cartesian state vectors in SI-units.
-
propagate_mean_elements
(jd0, jd_f, mean_elements, epoch0, B, **kwargs)[source] Propagate sgp4 mean elements.
-
propagate_tle
(t, line1, line2, **kwargs)[source] Propagate a TLE pair