heyoka.model.sgp4_propagator_dbl#

class heyoka.model.sgp4_propagator_dbl#

SGP4 propagator (double precision).

Added in version 5.1.0.

Note

A tutorial explaining the use of this class is available.

Methods

__call__(self, times[, out])

Propagation.

__init__(self, sat_list[, diff_order])

Constructor.

get_dslice(self, order[, component])

Fetch a slice of derivatives.

get_mindex(self, i)

Fetch a differentiation multiindex.

replace_sat_data(self, sat_list)

Replace the TLE data.

Attributes

diff_args

The list of differentiation arguments.

diff_order

The differentiation order.

jdtype

Data type representing Julian dates with a fractional component.

nouts

The total number of outputs, including the derivatives.

nsats

The total number of satellites.

sat_data

The TLE data.

__call__(self, times: numpy.ndarray, out: numpy.ndarray[float] | None = None) numpy.ndarray[float]#

Propagation.

The call operator will propagate the states of all the satellites (and, if requested, their derivatives) up to the specified times.

The times array can contain either floating-point values (of type float), or Julian dates (represented via the jdtype type). In the former case, the input times will be interpreted as minutes elapsed since the TLE reference epochs (which in general differ from satellite to satellite). In the latter case, the states will be propagated up to the specified Julian dates.

times can be either a one-dimensional array, or a two-dimensional one. In the former case (scalar propagation), its length must be exactly nsats (i.e., one time/date per satellite). In the latter case (batch-mode propagation), the number of columns must be exactly nsats, while the number of rows represents how many propagations per satellite will be performed.

The return value is either a two-dimensional (scalar propagation) or three-dimensional (batch-mode propagation) array. In the former case, the number of rows will be equal to nouts, while the number of columns will be equal to nsats. In the latter case, the first dimension will be equal to the number of propagations performed per satellite, the second dimension will be equal to nouts, and the third dimension will be equal to nsats.

If an out array with the correct data type and shape is provided, it will be used as the return value. Otherwise, a new array will be returned.

All input arguments must be C-style contiguous arrays, with no memory overlap between times and out.

Parameters:
  • times – the propagation times/dates.

  • out – the output array.

Returns:

the result of the propagation.

Raises:

ValueError – if an invalid input array is detected, as explained above.

__init__(self, sat_list: list, diff_order: int = 0, **kwargs)#

Constructor.

Note

Instead of using this constructor, consider using the factory function sgp4_propagator().

The constructor will initialise the propagator from sat_list, which must be a list of TLEs represented as Satrec objects from the sgp4 Python module.

The diff_order argument indicates the desired differentiation order. If equal to 0, then derivatives are disabled.

kwargs can optionally contain keyword arguments from the LLVM kwargs set and the cfunc kwargs set.

Parameters:
  • sat_list – the list of TLEs.

  • diff_order – the derivatives order.

Raises:
  • ImportError – if the sgp4 Python module is not available.

  • TypeError – if one or more elements in sat_list is not a Satrec object.

  • ValueError – if a satellite with an orbital period above 225 minutes is detected.

property diff_args#

The list of differentiation arguments.

Note

This property is available only if derivatives were requested on construction.

Return type:

list[expression]

property diff_order#

The differentiation order.

Return type:

int

get_dslice(self, order: int, component: int | None = None) slice#

Fetch a slice of derivatives.

Note

This method is available only if derivatives were requested on construction.

This method will return a slice representing the range of indices containing the derivatives of order order in the result of a propagation. If component is None, then the output range encompasses the derivatives of all the propagated quantities. Otherwise, the output range includes only the derivatives of the component-th propagated quantity.

Parameters:
  • order – the differentiation order.

  • component – the component to consider.

Returns:

a range of indices into the output of a propagation containing the requested derivatives.

get_mindex(self, i: int) list[int]#

Fetch a differentiation multiindex.

Note

This method is available only if derivatives were requested on construction.

This method will return the differentiation multiindex corresponding to the i-th row of the propagation output of a differentiable SGP4 propagator.

The multiindex begins with the component index (that is, the index of the output quantity whose derivatives have been computed). The remaining indices are the differentiation orders with respect to the quantities listed in diff_args.

For instance, if the return value is [2, 0, 1, 0, 0, 0, 0, 0], the multiindex refers to the first-order derivative of the output quantity at index 2 (i.e., the Cartesian \(z\) coordinate) with respect to the second differentiation argument.

Parameters:

i – the input index.

Returns:

a differentiation multiindex.

property jdtype#

Data type representing Julian dates with a fractional component.

This is a structured NumPy datatype consisting of two fields of type float, the first one called jd and representing a Julian date, the second one called frac representing a fractional correction to jd (so that the full Julian date is jd + frac).

Return type:

numpy.dtype

property nouts#

The total number of outputs, including the derivatives.

Return type:

int

property nsats#

The total number of satellites.

Return type:

int

replace_sat_data(self, sat_list: list) None#

Replace the TLE data.

This method will replace the TLE data in the propagator with the data from sat_list. As usual, sat_list must be a list of TLEs represented as Satrec objects from the sgp4 Python module.

The number of satellites in sat_list must be equal to the number of satellites in the propagator - that is, it is not possible to change the total number of satellites in the propagator via this method.

Parameters:

sat_list – the new list of TLEs.

Raises:
  • TypeError – if one or more elements in sat_list is not a Satrec object.

  • ValueError – if a satellite with an orbital period above 225 minutes is detected.

  • ValueError – if the number of satellites in sat_list differs from the number of satellites in the propagator.

property sat_data#

The TLE data.

A 9 x nsats array containing the TLE orbital elements, the BSTAR coefficient and the TLE epoch (with fractional correction) of each satellite.

The rows contain the following quantities:

  1. the mean motion from the TLE (in [rad / min]),

  2. the eccentricity from the TLE,

  3. the inclination from the TLE (in [rad]),

  4. the right ascension of the ascending node from the TLE (in [rad]),

  5. the argument of perigee from the TLE (in [rad]),

  6. the mean anomaly from the TLE (in [rad]),

  7. the BSTAR drag term from the TLE (in the same unit as given in the TLE),

  8. the reference epoch from the TLE (as a Julian date),

  9. a fractional correction to the epoch (in Julian days).

Return type:

numpy.ndarray[float]