Core & Common Types

ccsds_ndm.from_str(data)

Parse a string (KVN or XML) and return the corresponding NDM object.

Parameters:

data (str) – The content to parse.

Returns:

The parsed NDM object.

Return type:

Union[Oem, Cdm, Omm, Opm, Ocm, Tdm, Rdm, Ndm, Aem, Apm, Acm]

Raises:

ValueError – If parsing fails.

ccsds_ndm.from_file(path)

Parse from a file path (KVN or XML).

Parameters:

path (str) – Path to the file.

Returns:

The parsed NDM object.

Return type:

Union[Oem, Cdm, Omm, Opm, Ocm, Tdm, Rdm, Ndm, Aem, Apm, Acm]

class ccsds_ndm.Ndm(messages, id=None, comments=Ellipsis)

Combined Instantiation Navigation Data Message (NDM).

It is possible to create an XML instance that incorporates any number of NDM messages in a logical suite called an ‘NDM combined instantiation’. Such combined instantiations may be useful for some situations, for example: (1) a constellation of spacecraft in which ephemeris data for all of the spacecraft is combined in a single XML message; (2) a spacecraft attitude that depends upon a particular orbital state (an APM and its associated OPM could be conveniently conveyed in a single NDM); (3) an ephemeris message with the set of tracking data messages used in the orbit determination.

comments

Comments (optional).

Type:

list[str]

static from_file(path, format=None)

Parse an NDM combined instantiation from a file.

static from_str(data, format=None)

Parse an NDM combined instantiation from a string.

id

Message Identifier (optional).

Type:

Optional[str]

messages

List of contained navigation messages.

Type:

list[Union[Oem, Cdm, Opm, Omm, Ocm, Rdm, Tdm, Ndm]]

to_file(path, format, validate=True)

Write to file.

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

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

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

to_str(format, validate=True)

Serialize to a string.

validate(strict=True)

Validate the combined 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).

class ccsds_ndm.UserDefined(parameters=None, comment=None)

USER DEFINED PARAMETERS block (userDefinedType). User-defined parameters.

Allow for the exchange of any desired orbital data not already provided in the message.

Parameters:
  • parameters (dict[str, str], optional)

  • values. (A dictionary of user-defined parameters and their)

commentlist[str], optional

Comments.

comment

Comments (see 7.8 for formatting rules).

Type:

list[str]

user_defined

User-defined parameters.

Type:

dict[str, str]

class ccsds_ndm.OdmHeader(creation_date, originator, classification=None, message_id=None, comment=None)

Represents the odmHeader complex type.

Parameters:
  • creation_date (str) – File creation date/time in UTC.

  • originator (str) – Creating agency or operator.

  • classification (str, optional) – User-defined free-text message classification/caveats.

  • message_id (str, optional) – ID that uniquely identifies a message from a given originator.

  • comment (list of str, optional) – Comments.

classification

User-defined free-text message classification/caveats of this ODM. It is recommended that selected values be pre-coordinated between exchanging entities by mutual agreement.

Examples: SBU, ‘Operator-proprietary data; secondary distribution not permitted’

Type:

Optional[str]

comment

Comments (allowed in the ODM Header only immediately after the ODM version number). (See 7.8 for formatting rules.)

Examples: This is a comment

Type:

list[str]

creation_date

File creation date/time in UTC. (For format specification, see 7.5.10.)

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

Type:

str

message_id

ID that uniquely identifies a message from a given originator. The format and content of the message identifier value are at the discretion of the originator.

Examples: OPM_201113719185, ABC-12_34

Type:

Optional[str]

originator

Creating agency or operator. Select from the accepted set of values indicated in annex B, subsection B1 from the ‘Abbreviation’ column (when present), or the ‘Name’ column when an Abbreviation column is not populated. If desired organization is not listed there, follow procedures to request that originator be added to SANA registry.

Examples: CNES, ESOC, GSFC, GSOC, JPL, JAXA, INTELSAT, USAF, INMARSAT

Type:

str

class ccsds_ndm.StateVector(epoch, x, y, z, x_dot, y_dot, z_dot, comments=None)

State Vector Components in the Specified Coordinate System.

Parameters:
  • epoch (str) – Epoch of the state vector.

  • x (float) – Position vector X-component (km).

  • y (float) – Position vector Y-component (km).

  • z (float) – Position vector Z-component (km).

  • x_dot (float) – Velocity vector X-component (km/s).

  • y_dot (float) – Velocity vector Y-component (km/s).

  • z_dot (float) – Velocity vector Z-component (km/s).

comment

Comments (allowed at the beginning of the OPM Metadata). (See 7.8 for formatting rules.)

Type:

list[str]

epoch

Epoch of state vector & optional Keplerian elements (see 7.5.10 for formatting rules).

Type:

str

x

Position vector X-component.

Units: km

Type:

float

x_dot

Velocity vector X-component.

Units: km/s

Type:

float

y

Position vector Y-component.

Units: km

Type:

float

y_dot

Velocity vector Y-component.

Units: km/s

Type:

float

z

Position vector Z-component.

Units: km

Type:

float

z_dot

Velocity vector Z-component.

Units: km/s

Type:

float

class ccsds_ndm.StateVectorAcc(epoch, x, y, z, x_dot, y_dot, z_dot, x_ddot=None, y_ddot=None, z_ddot=None)

State Vector Components in the Specified Coordinate System.

Parameters:
  • epoch (str) – Epoch of the state vector.

  • x (float) – Position vector X-component (km).

  • y (float) – Position vector Y-component (km).

  • z (float) – Position vector Z-component (km).

  • x_dot (float) – Velocity vector X-component (km/s).

  • y_dot (float) – Velocity vector Y-component (km/s).

  • z_dot (float) – Velocity vector Z-component (km/s).

  • x_ddot (float, optional) – Acceleration vector X-component (km/s²).

  • y_ddot (float, optional) – Acceleration vector Y-component (km/s²).

  • z_ddot (float, optional) – Acceleration vector Z-component (km/s²).

epoch

Epoch of state vector & optional Keplerian elements (see 7.5.10 for formatting rules).

Type:

str

x

Position vector X-component.

Units: km

Type:

float

x_ddot

Acceleration vector X-component.

Units: km/s²

Type:

Optional[float]

x_dot

Velocity vector X-component.

Units: km/s

Type:

float

y

Position vector Y-component.

Units: km

Type:

float

y_ddot

Acceleration vector Y-component.

Units: km/s²

Type:

Optional[float]

y_dot

Velocity vector Y-component.

Units: km/s

Type:

float

z

Position vector Z-component.

Units: km

Type:

float

z_ddot

Acceleration vector Z-component.

Units: km/s²

Type:

Optional[float]

z_dot

Velocity vector Z-component.

Units: km/s

Type:

float

Enums

class ccsds_ndm.YesNo
No = YesNo.NO
Yes = YesNo.YES
class ccsds_ndm.ControlledType
No = ControlledType.NO
Unknown = ControlledType.UNKNOWN
Yes = ControlledType.YES
class ccsds_ndm.ReferenceFrame
Eme2000 = ReferenceFrame.EME2000
Gcrf = ReferenceFrame.GCRF
Itrf = ReferenceFrame.ITRF
J2000 = ReferenceFrame.J2000
Teme = ReferenceFrame.TEME
class ccsds_ndm.TimeSystem
Gps = TimeSystem.GPS
Sclk = TimeSystem.SCLK
Tai = TimeSystem.TAI
Tdb = TimeSystem.TDB
Ut1 = TimeSystem.UT1
Utc = TimeSystem.UTC

Exceptions

exception ccsds_ndm.NdmError

Base exception for all CCSDS NDM errors.

exception ccsds_ndm.NdmFormatError

Error during parsing of NDM data (KVN or XML).

exception ccsds_ndm.NdmKvnParseError

Error during KVN parsing.

exception ccsds_ndm.NdmXmlError

Error during XML parsing or serialization.

exception ccsds_ndm.NdmValidationError

Validation error against CCSDS rules.

exception ccsds_ndm.NdmEpochError

Error parsing a CCSDS epoch string.

exception ccsds_ndm.NdmIoError

I/O error during file operations.

exception ccsds_ndm.NdmUnsupportedMessageError

Unsupported CCSDS message type.