pyRTX.classes.Precompute
Classes
|
A class to perform and store SPICE computations in advance. |
- class pyRTX.classes.Precompute.Precompute(epochs: list)[source]
A class to perform and store SPICE computations in advance.
This class allows users to precompute and store various SPICE data, such as position and state vectors, and rotation matrices, for a given set of epochs. This can significantly speed up computations that require repeated calls to SPICE.
- __init__(epochs: list)[source]
Initializes the Precompute object.
- Parameters:
epochs (
list) – A list of epochs in TDB seconds past J2000 for which to perform the precomputations.
- addPosition(observer: str, target: str, frame: str, correction: str = 'CN')[source]
Adds a position vector computation to the precomputation list.
- addState(observer: str, target: str, frame: str, correction: str = 'CN')[source]
Adds a state vector computation to the precomputation list.
- addRotation(base_frame: str, target_frame: str)[source]
Adds a rotation matrix computation to the precomputation list.
- precomputeSolarPressure(sc, planet, correction='LT+S')[source]
Adds all necessary computations for solar radiation pressure to the precomputation list.
- Parameters:
sc (
pyRTX.Spacecraft) – The spacecraft object.planet (
pyRTX.Planet) – The planet object.correction (
str, default'LT+S') – The aberration correction to use.
- precomputePlanetaryRadiation(sc, planet, moving_frames=[], correction='CN')[source]
Adds all necessary computations for planetary radiation to the precomputation list.
- precomputeDrag(sc, planet_name, moving_frames=[], accel_frame='', correction='LT+S')[source]
Adds all necessary computations for drag to the precomputation list.
- Parameters:
sc (
pyRTX.Spacecraft) – The spacecraft object.planet_name (
str) – The name of the planet.moving_frames (
list, optional) – A list of any additional moving frames to precompute.accel_frame (
str, optional) – The reference frame for the acceleration.correction (
str, default'LT+S') – The aberration correction to use.
- getPosition(epoch, observer: str, target: str, frame: str, correction: str)[source]
Retrieves a precomputed position vector.
- Parameters:
- Returns:
The position vector.
- Return type:
- getState(epoch, observer: str, target: str, frame: str, correction: str)[source]
Retrieves a precomputed state vector.
- Parameters:
- Returns:
The state vector.
- Return type:
- getRotation(epoch, base_frame: str, target_frame: str)[source]
Retrieves a precomputed rotation matrix.
- Parameters:
- Returns:
The rotation matrix.
- Return type:
- getArray()[source]
Returns the entire xarray Dataset of precomputed values.
- Returns:
The Dataset of precomputed values.
- Return type:
xarray.Dataset
- pxform_convert(pxform)[source]
Converts a 3x3 SPICE rotation matrix to a 4x4 transformation matrix.
- Parameters:
pxform (
numpy.ndarray) – The 3x3 rotation matrix.- Returns:
The 4x4 transformation matrix.
- Return type: