Orbital Parameter Message

This section is split into two part: the objects you will use to construct the OPM, and the enums used as parameters. Currently, the base classes etc. are only documented within the source files.

Main Classes

class odmpy.opm.Header(originator, opm_version='2.0'[, creation_date[, comment]])

Bases: odmpy.opm.KeywordContainer

OPM Header object.

Parameters:
  • opm_version (str) – CCSDS OPM version.
  • creation_date (datetime-like object) – Creation date. Defaults to current time.
  • originator (str) – Creating agency or operator.
  • comment (str) – Single or multi-line comment.
class odmpy.opm.Metadata(object_name, object_id, center_name, ref_frame, time_system[, ref_frame_epoch[, comment]])

Bases: odmpy.opm.KeywordContainer

OPM Metadata object.

Parameters:
  • object_name (str) – Spacecraft name.
  • object_id (str) – Object identifier. International Designator recommended.
  • center_name (str) – Origin of reference frame.
  • ref_frame (RefFrame) – Reference frame in which state is defined.
  • time_system (TimeSystem) – Time system used for state vector, maneuver, and covariance data.
  • ref_frame_epoch (datetime-like object) – Epoch of reference frame.
  • comment (str) – Single or multi-line comment.
class odmpy.opm.DataBlockStateVector(epoch, x, y, z, x_dot, y_dot, z_dot[, comment])

Bases: odmpy.opm.DataBlock, odmpy.opm.KeywordContainer

State vector block for OPM data section.

Parameters:
  • epoch (datetime-like object) – Epoch of state vector.
  • x (float) – \(x\) [km].
  • y (float) – \(y\) [km].
  • z (float) – \(z\) [km].
  • x_dot (float) – \(\dot{x}\) [km/s].
  • y_dot (float) – \(\dot{y}\) [km/s].
  • z_dot (float) – \(\dot{z}\) [km/s].
  • comment (str) – Single or multi-line comment.

Instance attributes:

name

If set, block will have comment containing name in the ASCII-formatted output. Otherwise, default description is used.

class odmpy.opm.DataBlockKeplerianElements(semi_major_axis, eccentricity, inclination, ra_of_asc_node, arg_of_pericenter, gm[, true_anomaly[, mean_anomaly[, comment]]])

Bases: odmpy.opm.DataBlock, odmpy.opm.KeywordContainer

Keplerian elements block for OPM data section.

Parameters:
  • semi_major_axis (float) – Semimajor axis [km].
  • eccentricity (float) – Eccentricity [–].
  • inclination (float) – Inclination [deg].
  • ra_of_asc_node (float) – Right ascension of the ascending node [deg].
  • arg_of_pericenter (float) – Argument of pericenter [deg].
  • true_anomaly (float) – True anomaly [deg].
  • mean_anomaly (float) – Mean anomaly [deg].
  • gm (float) – Gravitational coefficient [km3s-2]
  • comment (str) – Single or multi-line comment.

Note

Either true_anomaly or mean_anomaly must be set before the block is validated (usually instigated by odmpy.opm.Opm)

Instance attributes:

name

If set, block will have comment containing name in the ASCII-formatted output. Otherwise, default description is used.

class odmpy.opm.DataBlockSpacecraftParameters(mass, solar_rad_area, solar_rad_coeff, drag_area, drag_coeff[, comment])

Bases: odmpy.opm.DataBlock, odmpy.opm.KeywordContainer

Spacecraft parameters block for OPM data section.

Parameters:
  • mass (float) – Spacecraft mass [kg].
  • solar_rad_area (float) – Solar radiation pressure area [m2].
  • solar_rad_coeff (float) – Solar radiation pressure coefficient [–].
  • drag_area (float) – Drag area [m2].
  • drag_coeff (float) – Drag coefficient [–].
  • comment (str) – Single or multi-line comment.

Instance attributes:

name

If set, block will have comment containing name in the ASCII-formatted output. Otherwise, default description is used.

class odmpy.opm.DataBlockCovarianceMatrix([comment[, cov_ref_frame[, **cargs]]])

Bases: odmpy.opm.DataBlock, odmpy.opm.KeywordContainer

Covariance matrix block for data section.

Parameters:
  • comment (str) – Single or multi-line comment.
  • cov_ref_frame (RefFrame) – Covariance reference frame.
  • cx_x (float) – \(x_{x}\) [km2].
  • cy_x (float) – \(y_{x}\) [km2].
  • cy_y (float) – \(y_{y}\) [km2].
  • cz_x (float) – \(z_{x}\) [km2].
  • cz_y (float) – \(z_{y}\) [km2].
  • cz_z (float) – \(z_{z}\) [km2].
  • cx_dot_x (float) – \(\dot{x}_{x}\) [km2s-1].
  • cx_dot_y (float) – \(\dot{x}_{y}\) [km2s-1].
  • cx_dot_z (float) – \(\dot{x}_{z}\) [km2s-1].
  • cx_dot_x_dot (float) – \(\dot{x}_\dot{x}\) [km2s-2].
  • cy_dot_x (float) – \(\dot{y}_{x}\) [km2s-1].
  • cy_dot_y (float) – \(\dot{y}_{y}\) [km2s-1].
  • cy_dot_z (float) – \(\dot{y}_{z}\) [km2s-1].
  • cy_dot_x_dot (float) – \(\dot{y}_\dot{x}\) [km2s-2].
  • cy_dot_y_dot (float) – \(\dot{y}_\dot{y}\) [km2s-2].
  • cz_dot_x (float) – \(\dot{z}_{x}\) [km2s-1].
  • cz_dot_y (float) – \(\dot{z}_{y}\) [km2s-1].
  • cz_dot_z (float) – \(\dot{z}_{z}\) [km2s-1].
  • cz_dot_x_dot (float) – \(\dot{z}_\dot{x}\) [km2s-2].
  • cz_dot_y_dot (float) – \(\dot{z}_\dot{y}\) [km2s-2].
  • cz_dot_z_dot (float) – \(\dot{z}_\dot{z}\) [km2s-2].

Note

Due to the large number of covariance parameters, the method signature accepts them as **cargs.

Instance attributes:

name

If set, block will have comment containing name in the ASCII-formatted output. Otherwise, default description is used.

class odmpy.opm.DataBlockManeuverParameters(man_epoch_ignition, man_duration, man_delta_mass, man_ref_frame, man_dv_1, man_dv_2, man_dv_3[, comment])

Bases: odmpy.opm.DataBlock, odmpy.opm.KeywordContainer

Maneuver parameters block for data section.

Parameters:
  • man_epoch_ignition (datetime-like object) – Epoch of ignition.
  • man_duration (float) – Maneuver duration. [s]
  • man_delta_mass (float) – Mass change during maneuver. [kg]
  • man_ref_frame (RefFrame) – Coordinate system for velocity increment vector.
  • man_dv_1 (float) – 1st component of velocity increment vector [km/s].
  • man_dv_2 (float) – 2nd component of velocity increment vector [km/s].
  • man_dv_3 (float) – 3rd component of velocity increment vector [km/s].
  • comment (str) – Single or multi-line comment.

Instance attributes:

name

If set, block will have comment containing name in the ASCII-formatted output. Otherwise, default description is used.

class odmpy.opm.Data(state_vector[, spacecraft_parameters[, keplerian_elements[, covariance_matrix[, maneuver_parameters]]]])

OPM Data object (mandatory).

Parameters:
validate_blocks()

Ensure mandatory blocks are present, prerequisites fulfilled, and types checked.

Raises:
  • ValueError – if a given block is a list but repetition for the block type is disallowed.
  • TypeError – if data block is not sublass of odmpy.opm.DataBlock or a valid list of them.
class odmpy.opm.Opm(header, metadata, data[, user_defined])

Represent complete OPM.

Parameters:
output()

Return a line iterator for an ASCII-formatted OPM file.

write(fp)

Write ASCII-formatted OPM file to fp (a .write()-supporting file-like object)

class odmpy.opm.KeywordContainer

Base class of OPM keyword sections.

The standard splits an orbital parameter message file into different sections, which will subclass KeywordContainer.

The main purpose of the base class is to implement the methods for validating and formatting the list of keywords provided by each sublcass.

Inherited by:

validate_keywords()

Ensures keywords are valid and set (if mandatory).

Raises:
  • odmpy.opm.MissingKeywordError – if a mandatory keyword is None
  • ValueError – if keyword validation fails

This method should be called internally before data meant for output is produced.

class odmpy.opm.KeywordContainer

Base class of OPM keyword sections.

The standard splits an orbital parameter message file into different sections, which will subclass KeywordContainer.

The main purpose of the base class is to implement the methods for validating and formatting the list of keywords provided by each sublcass.

Inherited by:

validate_keywords()

Ensures keywords are valid and set (if mandatory).

Raises:
  • odmpy.opm.MissingKeywordError – if a mandatory keyword is None
  • ValueError – if keyword validation fails

This method should be called internally before data meant for output is produced.

Enums

class odmpy.opm.RefFrame

Reference frame.

EME2000
Earth Mean Equator and Equinox of J2000
GCRF
Geocentric Celestial Reference Frame
GRC
Greenwich Rotating Coordinates
ICRF
International Celestial Reference Frame
ITRF2000
International Terrestrial Reference Frame 2000
ITRF-93
International Terrestrial Reference Frame 1993
ITRF-97
International Terrestrial Reference Frame 1997
MCI
Mars Centered Inertial
TDR
True of Date, Rotating
TEME
True Equator Mean Equinox (see below)
TOD
True of Date
RSW
Another name for RTN
RTN
Radial, transverse, normal
TNW
A local orbital coordinate frame that has the x-axis along the velocity vector, W along the orbital angular momentum vector, and N completes the right handed system.
class odmpy.opm.TimeSystem

Time system.

GMST
Greenwich Mean Sidereal Time
GPS
Global Positioning System
MET
Mission Elapsed Time (note)
MRT
Mission Relative Time (note)
SCLK
Spacecraft Clock (receiver) (requires rules for interpretation in ICD)
TAI
International Atomic Time
TCB
Barycentric Coordinate Time
TDB
Barycentric Dynamical Time
TCG
Geocentric Coordinate Time
TT
Terrestrial Time
UT1
Universal Time
UTC
Coordinated Universal Time