Skip to content

OPM — Orbit Parameter Message

Parses CCSDS Orbit Parameter Messages containing a single state vector with optional Keplerian elements, spacecraft parameters, maneuvers, and covariance data.


OPM

OPM(originator: Any, object_name: Any, object_id: Any, center_name: Any, ref_frame: Any, time_system: Any, epoch: Any, position: Any, velocity: Any)

Python wrapper for CCSDS Orbit Parameter Message (OPM).

Scalar metadata is exposed as properties with getters and setters. Maneuvers are accessed via the maneuvers property which supports indexing, iteration, and mutation.

Example
1
2
3
4
5
6
7
8
9
from brahe.ccsds import OPM

opm = OPM.from_file("state.opm")
print(opm.position)
opm.object_name = "NEW_SAT"
print(len(opm.maneuvers))
m = opm.maneuvers[0]
print(m.ref_frame)
m.ref_frame = "RTN"

Initialize instance.

arg_of_pericenter property

arg_of_pericenter: float

Argument of pericenter in degrees, or None.

Returns:

Name Type Description
float float

Argument of pericenter (degrees), or None

center_name property

center_name: str

Center body name.

Returns:

Name Type Description
str str

Center name

creation_date property

creation_date: Epoch

Creation date of the message.

Returns:

Name Type Description
Epoch Epoch

Creation date

drag_area property

drag_area: float

Drag area in m^2, or None.

Returns:

Name Type Description
float float

Drag area (m^2), or None

drag_coeff property

drag_coeff: float

Drag coefficient, or None.

Returns:

Name Type Description
float float

Drag coefficient, or None

eccentricity property

eccentricity: float

Eccentricity, or None if no Keplerian elements.

Returns:

Name Type Description
float float

Eccentricity, or None

epoch property

epoch: Epoch

State vector epoch.

Returns:

Name Type Description
Epoch Epoch

Epoch of the state vector

format_version property

format_version: float

CCSDS format version.

Returns:

Name Type Description
float float

Format version

gm property

gm: float

Gravitational parameter in m^3/s^2, or None.

Returns:

Name Type Description
float float

GM (m^3/s^2), or None

has_keplerian_elements property

has_keplerian_elements: bool

Whether Keplerian elements are present.

Returns:

Name Type Description
bool bool

True if Keplerian elements exist

inclination property

inclination: float

Inclination in degrees, or None if no Keplerian elements.

Returns:

Name Type Description
float float

Inclination (degrees), or None

maneuvers property

maneuvers: OPMManeuvers

Maneuver collection, supporting len/indexing/iteration.

Returns:

Name Type Description
OPMManeuvers OPMManeuvers

Collection of maneuvers

mass property

mass: float

Spacecraft mass in kg, or None.

Returns:

Name Type Description
float float

Mass (kg), or None

mean_anomaly property

mean_anomaly: float

Mean anomaly in degrees, or None.

Returns:

Name Type Description
float float

Mean anomaly (degrees), or None

object_id property

object_id: str

Object ID (international designator).

Returns:

Name Type Description
str str

Object ID

object_name property

object_name: str

Object name.

Returns:

Name Type Description
str str

Object name

originator property

originator: str

Originator of the message.

Returns:

Name Type Description
str str

Originator string

position property

position: ndarray

Position vector [x, y, z] in meters.

Returns:

Type Description
ndarray

numpy.ndarray: Position [x, y, z] in meters

ra_of_asc_node property

ra_of_asc_node: float

Right ascension of ascending node in degrees, or None.

Returns:

Name Type Description
float float

RAAN (degrees), or None

ref_frame property

ref_frame: str

Reference frame name.

Returns:

Name Type Description
str str

Reference frame

semi_major_axis property

semi_major_axis: float

Semi-major axis in meters, or None.

Returns:

Name Type Description
float float

Semi-major axis (meters), or None

solar_rad_area property

solar_rad_area: float

Solar radiation pressure area in m^2, or None.

Returns:

Name Type Description
float float

Solar radiation pressure area (m^2), or None

solar_rad_coeff property

solar_rad_coeff: float

Solar radiation pressure coefficient, or None.

Returns:

Name Type Description
float float

Solar radiation pressure coefficient, or None

state property

state: ndarray

Combined state vector [x, y, z, vx, vy, vz] as a numpy array.

Returns:

Type Description
ndarray

numpy.ndarray: 6-element state vector (position in meters, velocity in m/s)

Example
opm = OPM.from_file("state.opm")
state = opm.state  # numpy array [x, y, z, vx, vy, vz]

time_system property

time_system: str

Time system name.

Returns:

Name Type Description
str str

Time system

true_anomaly property

true_anomaly: float

True anomaly in degrees, or None.

Returns:

Name Type Description
float float

True anomaly (degrees), or None

velocity property

velocity: ndarray

Velocity vector [vx, vy, vz] in m/s.

Returns:

Type Description
ndarray

numpy.ndarray: Velocity [vx, vy, vz] in m/s

add_maneuver method descriptor

add_maneuver(epoch_ignition: Epoch, duration: float, ref_frame: str, dv: list[float], delta_mass: float | None = None) -> int

Add a maneuver to the OPM.

Parameters:

Name Type Description Default
epoch_ignition Epoch

Epoch of ignition

required
duration float

Duration in seconds

required
ref_frame str

Reference frame for delta-V

required
dv list[float]

Delta-V [dv1, dv2, dv3] in m/s

required
delta_mass float | None

Mass change in kg

None

Returns:

Name Type Description
int int

Index of the new maneuver

from_file staticmethod

from_file(path: str) -> OPM

Parse an OPM from a file, auto-detecting the format.

Parameters:

Name Type Description Default
path str

Path to the OPM file

required

Returns:

Name Type Description
OPM OPM

Parsed OPM message

from_str staticmethod

from_str(content: str) -> OPM

Parse an OPM from a string, auto-detecting the format.

Parameters:

Name Type Description Default
content str

String content of the OPM message

required

Returns:

Name Type Description
OPM OPM

Parsed OPM message

remove_maneuver method descriptor

remove_maneuver(idx: int) -> Any

Remove a maneuver by index.

Parameters:

Name Type Description Default
idx int

Index of the maneuver to remove

required

to_dict method descriptor

to_dict() -> dict

Convert the OPM to a Python dictionary.

Epochs are serialized as CCSDS datetime strings for JSON/dict compatibility.

Returns:

Name Type Description
dict dict

Dictionary representation of the OPM

to_file method descriptor

to_file(path: str, format: str) -> Any

Write the OPM to a file in the specified format.

Parameters:

Name Type Description Default
path str

Output file path

required
format str

Output format - "KVN", "XML", or "JSON"

required

to_json_string method descriptor

to_json_string(uppercase_keys: bool = False) -> str

Write the OPM to JSON with explicit key case control.

Parameters:

Name Type Description Default
uppercase_keys bool

If True, use uppercase CCSDS keywords. Default: False.

False

Returns:

Name Type Description
str str

Serialized JSON string

to_string method descriptor

to_string(format: str) -> str

Write the OPM to a string in the specified format.

Parameters:

Name Type Description Default
format str

Output format - "KVN", "XML", or "JSON"

required

Returns:

Name Type Description
str str

Serialized OPM string


See Also