Orbit Ephemeris Message (OEM)

class ccsds_ndm.Oem(header, segments)

Orbit Ephemeris Message (OEM).

An OEM specifies the position and velocity of a single object at multiple epochs contained within a specified time range. The message recipient must have a means of interpolating across these state vectors to obtain the state at an arbitrary time contained within the span of the ephemeris.

The OEM is suited to exchanges that: 1. Involve automated interaction (e.g., computer-to-computer communication). 2. Require higher fidelity or higher precision dynamic modeling than is possible with the OPM.

Parameters:
static from_file(path, format=None)

Create an OEM message from a file.

Parameters:
  • path (str) – Path to the input file.

  • format (str, optional) – Format (‘kvn’ or ‘xml’). Auto-detected if None. (Optional)

Returns:

The parsed OEM object.

Return type:

Oem

static from_str(data, format=None)

Create an OEM message from a string.

Parameters:
  • data (str) – Input string/content.

  • format (str, optional) – Format (‘kvn’ or ‘xml’). Auto-detected if None. (Optional)

Returns:

The parsed OEM object.

Return type:

Oem

header

The message header.

Type:

OdmHeader

id

The message identifier.

Type:

Optional[str]

segments

The list of data segments.

Type:

list[OemSegment]

to_file(path, format, validate=True)

Write to file.

Parameters:
  • path (str) – Output file path.

  • format (str) – Output format (‘kvn’ or ‘xml’).

  • file. (Write to)

  • path – Output file path.

  • format – Output format (‘kvn’ or ‘xml’).

  • validate (bool, optional) – Whether to validate the message before writing (default: True).

to_str(format, validate=True)

Serialize to string.

Parameters:
  • format (str) – Output format (‘kvn’ or ‘xml’).

  • format – Output format (‘kvn’ or ‘xml’).

  • validate (bool, optional) – Whether to validate the message before writing (default: True).

Returns:

  • str – The serialized string.

  • Serialize to string.

Returns:

The serialized string.

Return type:

str

validate(strict=True)

Validate the message against CCSDS rules.

Parameters:

strict (bool, optional) – If True (default), raises ValueError on the first error found. If False, returns a list of validation error messages (or None if valid).

version

The message version.

Type:

str

class ccsds_ndm.OemSegment(metadata, data)

A single segment of the OEM.

Each segment contains metadata (context) and a list of ephemeris data points.

Parameters:
data

Segment data.

Type:

OemData

metadata

A single segment of the OEM.

Each segment contains metadata (context) and a list of ephemeris data points.

Type:

OemMetadata

validate()

Validate the segment against CCSDS rules.

class ccsds_ndm.OemMetadata(object_name, object_id, start_time, stop_time, center_name=Ellipsis, ref_frame=None, time_system=None, ref_frame_epoch=None, useable_start_time=None, useable_stop_time=None, interpolation=None, interpolation_degree=None, comment=None)

OEM Metadata Section.

Parameters:
  • object_name (str) – Spacecraft name for which orbit state data is provided.

  • object_id (str) – Object identifier of the object for which orbit state data is provided.

  • center_name (str) – Origin of the reference frame.

  • ref_frame (str) – Reference frame in which state vector data is given.

  • time_system (str) – Time system used for state vector, maneuver, and covariance data.

  • start_time (str) – Start time of the total time span covered by the ephemeris data (ISO 8601).

  • stop_time (str) – Stop time of the total time span covered by the ephemeris data (ISO 8601).

  • ref_frame_epoch (str, optional) – Epoch of the reference frame, if not intrinsic to the definition (ISO 8601).

  • useable_start_time (str, optional) – Start of the recommended time span for use of the ephemeris data (ISO 8601).

  • useable_stop_time (str, optional) – End of the recommended time span for use of the ephemeris data (ISO 8601).

  • interpolation (str, optional) – Recommended interpolation method for ephemeris data.

  • interpolation_degree (int, optional) – Degree of the interpolation polynomial.

  • comment (list[str], optional) – Comments.

center_name

Origin of the OEM reference frame, which may be a natural solar system body (planets, asteroids, comets, and natural satellites), including any planet barycenter or the solar system barycenter, or another reference frame center (such as a spacecraft, formation flying reference ‘chief’ spacecraft, etc.). Natural bodies shall be selected from the accepted set of values indicated in annex B, subsection B2. For spacecraft, it is recommended to use either the OBJECT_ID or international designator of the participant as catalogued in the UN Office of Outer Space Affairs designator index (reference [3]).

Examples: EARTH, EARTH BARYCENTER, MOON, SOLAR SYSTEM BARYCENTER, SUN, JUPITER BARYCENTER, STS 106, EROS

Type:

str

comment

Comments (see 7.8 for formatting rules).

Type:

list[str]

interpolation

This keyword may be used to specify the recommended interpolation method for ephemeris data in the immediately following set of ephemeris lines.

Examples: HERMITE, LINEAR, LAGRANGE

Type:

Optional[str]

interpolation_degree

Recommended interpolation degree for ephemeris data in the immediately following set of ephemeris lines. Must be an integer value. This keyword must be used if the ‘INTERPOLATION’ keyword is used.

Examples: 5, 8

Type:

Optional[int]

object_id

Object identifier of the object for which ephemeris data is provided. While there is no CCSDS-based restriction on the value for this keyword, it is recommended to use the international spacecraft designator as published in the UN Office of Outer Space Affairs designator index. Recommended values have the format YYYY-NNNP{PP}, where: YYYY = Year of launch. NNN = Three-digit serial number of launch in year YYYY (with leading zeros). P{PP} = At least one capital letter for the identification of the part brought into space by the launch. If the asset is not listed, the UN Office of Outer Space Affairs designator index format is not used, or the content is either unknown or cannot be disclosed, the value should be set to UNKNOWN.

Examples: 2000-052A, 1996-068A, 2000-053A, 1996-008A, UNKNOWN

Type:

str

object_name

Spacecraft name for which ephemeris data is provided. While there is no CCSDS-based restriction on the value for this keyword, it is recommended to use names from the UN Office of Outer Space Affairs designator index (reference [3], which include Object name and international designator of the participant). If OBJECT_NAME is not listed in reference [3] or the content is either unknown or cannot be disclosed, the value should be set to UNKNOWN.

Examples: EUTELSAT W1, MARS PATHFINDER, STS 106, NEAR, UNKNOWN

Type:

str

ref_frame

Reference frame in which the ephemeris data are given. Use of values other than those in 3.2.3.3 should be documented in an ICD.

Examples: ICRF, ITRF2000, EME2000, TEME

Type:

str

ref_frame_epoch

Epoch of reference frame, if not intrinsic to the definition of the reference frame. (See 7.5.10 for formatting rules.)

Examples: 2001-11-06T11:17:33, 2002-204T15:56:23Z

Type:

Optional[str]

start_time

Start of TOTAL time span covered by ephemeris data and covariance data immediately following this metadata block. (For format specification, see 7.5.10.)

Examples: 1996-12-18T14:28:15.1172, 1996-277T07:22:54

Type:

str

stop_time

End of TOTAL time span covered by ephemeris data and covariance data immediately following this metadata block. (For format specification, see 7.5.10.)

Examples: 1996-12-18T14:28:15.1172, 1996-277T07:22:54

Type:

str

time_system

Time system used for ephemeris and covariance data. Use of values other than those in 3.2.3.2 should be documented in an ICD.

Examples: UTC, TAI, TT, GPS, TDB, TCB

Type:

str

useable_start_time

Start time of USEABLE time span covered by ephemeris data immediately following this metadata block. (For format specification, see 7.5.10.) This optional keyword allows the message creator to introduce fictitious (but numerically smooth) data nodes prior to the actual data time history to support interpolation methods requiring more than two nodes (e.g., pure higher-order Lagrange interpolation methods). The use of this keyword and introduction of fictitious node points are optional and may not be necessary.

Examples: 1996-12-18T14:28:15.1172, 1996-277T07:22:54

Type:

Optional[str]

useable_stop_time

Stop time of USEABLE time span covered by ephemeris data immediately following this metadata block. (For format specification, see 7.5.10.) This optional keyword allows the message creator to introduce fictitious (but numerically smooth) data nodes following the actual data time history to support interpolation methods requiring more than two nodes (e.g., pure higher-order Lagrange interpolation methods). The use of this keyword and introduction of fictitious node points are optional and may not be necessary.

Examples: 1996-12-18T14:28:15.1172, 1996-277T07:22:54

Type:

Optional[str]

validate()

Validate the metadata against CCSDS rules.

class ccsds_ndm.OemData(state_vectors, covariance_matrix=None, comments=None)

OEM Data Section.

Parameters:
comment

Comments (see 7.8 for formatting rules).

Type:

list[str]

covariance_matrix

List of covariance matrices associated with the state vectors.

Each 6x6 covariance matrix provides uncertainty information for position and velocity: - Position covariance in km² - Position-velocity cross-covariance in km²/s - Velocity covariance in km²/s²

Matrices are given in lower triangular form in the covariance reference frame.

Type:

list[OemCovarianceMatrix]

covariance_matrix_epochs

Epochs for covariance matrices (ISO 8601).

Type:

list[str]

covariance_matrix_numpy

Get covariance matrices as a NumPy array.

Use covariance_matrix_epochs for the corresponding epochs.

The returned array is a 3D tensor of shape (N, 6, 6), where N is the number of covariance matrices. Each 6x6 matrix is symmetric and constructed from the lower-triangular CCSDS data.

Indices: 0=X, 1=Y, 2=Z, 3=X_DOT, 4=Y_DOT, 5=Z_DOT

Type:

numpy.ndarray

static from_numpy(state_vector_epochs, state_vector_numpy, covariance_matrix_epochs=None, covariance_matrix_numpy=None, cov_ref_frames=None, cov_comments=None, comments=None)
state_vector

List of state vectors. Each vector contains position, velocity, and optional acceleration.

Examples: 2020-01-01T00:00:00.000 1234.567 2345.678 3456.789 1.234 2.345 3.456

Units: km, km/s, km/s²

Type:

list[StateVectorAcc]

state_vector_epochs

Epochs for state vectors (ISO 8601).

Type:

list[str]

state_vector_numpy

State vectors as a NumPy array.

Use state_vector_epochs for the corresponding epochs.

Returns:

  • numpy.ndarray – 2D array of shape (N, 6) or (N, 9): - N x 6: [X, Y, Z, X_DOT, Y_DOT, Z_DOT] if no accelerations. - N x 9: [X, Y, Z, X_DOT, Y_DOT, Z_DOT, X_DDOT, Y_DDOT, Z_DDOT] if accelerations present.

  • Units

  • - Position (km)

  • - Velocity (km/s)

  • - Acceleration (km/s²)

  • type: numpy.ndarray

validate()

Validate the data section against CCSDS rules.

class ccsds_ndm.OemCovarianceMatrix(epoch, values, cov_ref_frame, comment)

OEM Covariance Matrix.

Represents a 6x6 symmetric covariance matrix for position and velocity at a specific epoch. The lower triangular portion is stored/transmitted.

Parameters:
  • epoch (str) – Epoch of the covariance matrix (ISO 8601). values : numpy.ndarray NumPy array of shape (21,) containing the lower-triangular values, or (6,6) for a full symmetric matrix.

  • cov_ref_frame (str, optional) – Reference frame for the covariance matrix.

  • comment (list[str], optional) – Comments associated with this covariance matrix.

Variables:
  • epoch (str) – Epoch of the covariance matrix.

  • cx_x (float) – Position X covariance [1,1]. Units: km².

  • cy_x (float) – Position X-Y covariance [2,1]. Units: km².

  • cy_y (float) – Position Y covariance [2,2]. Units: km².

  • cz_x (float) – Position X-Z covariance [3,1]. Units: km².

  • cz_y (float) – Position Y-Z covariance [3,2]. Units: km².

  • cz_z (float) – Position Z covariance [3,3]. Units: km².

  • cx_dot_x (float) – Velocity X / Position X covariance [4,1]. Units: km²/s.

  • cx_dot_y (float) – Velocity X / Position Y covariance [4,2]. Units: km²/s.

  • cx_dot_z (float) – Velocity X / Position Z covariance [4,3]. Units: km²/s.

  • cx_dot_x_dot (float) – Velocity X covariance [4,4]. Units: km²/s².

  • cy_dot_x (float) – Velocity Y / Position X covariance [5,1]. Units: km²/s.

  • cy_dot_y (float) – Velocity Y / Position Y covariance [5,2]. Units: km²/s.

  • cy_dot_z (float) – Velocity Y / Position Z covariance [5,3]. Units: km²/s.

  • cy_dot_x_dot (float) – Velocity Y / Velocity X covariance [5,4]. Units: km²/s².

  • cy_dot_y_dot (float) – Velocity Y covariance [5,5]. Units: km²/s².

  • cz_dot_x (float) – Velocity Z / Position X covariance [6,1]. Units: km²/s.

  • cz_dot_y (float) – Velocity Z / Position Y covariance [6,2]. Units: km²/s.

  • cz_dot_z (float) – Velocity Z / Position Z covariance [6,3]. Units: km²/s.

  • cz_dot_x_dot (float) – Velocity Z / Velocity X covariance [6,4]. Units: km²/s².

  • cz_dot_y_dot (float) – Velocity Z / Velocity Y covariance [6,5]. Units: km²/s².

  • cz_dot_z_dot (float) – Velocity Z covariance [6,6]. Units: km²/s².

comment

Comments (see 7.8 for formatting rules).

Type:

list[str]

cov_ref_frame

Reference frame in which the covariance data are given. Select from the accepted set of values indicated in 3.2.3.3 or 3.2.4.11.

Examples: ICRF, EME2000

Type:

Optional[str]

cx_dot_x

Covariance matrix [4,1]

Units: km²/s

Type:

float

cx_dot_x_dot

Covariance matrix [4,4]

Units: km²/s²

Type:

float

cx_dot_y

Covariance matrix [4,2]

Units: km²/s

Type:

float

cx_dot_z

Covariance matrix [4,3]

Units: km²/s

Type:

float

cx_x

Covariance matrix [1,1]

Units: km²

Type:

float

cy_dot_x

Covariance matrix [5,1]

Units: km²/s

Type:

float

cy_dot_x_dot

Covariance matrix [5,4]

Units: km²/s²

Type:

float

cy_dot_y

Covariance matrix [5,2]

Units: km²/s

Type:

float

cy_dot_y_dot

Covariance matrix [5,5]

Units: km²/s²

Type:

float

cy_dot_z

Covariance matrix [5,3]

Units: km²/s

Type:

float

cy_x

Covariance matrix [2,1]

Units: km²

Type:

float

cy_y

Covariance matrix [2,2]

Units: km²

Type:

float

cz_dot_x

Covariance matrix [6,1]

Units: km²/s

Type:

float

cz_dot_x_dot

Covariance matrix [6,4]

Units: km²/s²

Type:

float

cz_dot_y

Covariance matrix [6,2]

Units: km²/s

Type:

float

cz_dot_y_dot

Covariance matrix [6,5]

Units: km²/s²

Type:

float

cz_dot_z

Covariance matrix [6,3]

Units: km²/s

Type:

float

cz_dot_z_dot

Covariance matrix [6,6]

Units: km²/s²

Type:

float

cz_x

Covariance matrix [3,1]

Units: km²

Type:

float

cz_y

Covariance matrix [3,2]

Units: km²

Type:

float

cz_z

Covariance matrix [3,3]

Units: km²

Type:

float

epoch

Epoch of covariance matrix. (See 7.5.10 for formatting rules.)

Examples: 2000-01-01T12:00:00Z

Type:

str