Core & Common Types

ccsds_ndm.from_str(data, format=None)

Parse a string containing KVN or XML.

Parameters:
  • data (str) – The content to parse.

  • format (str, optional) – "kvn" or "xml". Detected automatically when omitted.

Returns:

The parsed NDM object.

Return type:

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

Raises:

ValueError – If the input is invalid or unsupported.

ccsds_ndm.from_file(path, format=None)

Parse from a file path (KVN or XML).

Parameters:

path (str or os.PathLike) – Path to the file.

Returns:

The parsed NDM object.

Return type:

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

ccsds_ndm.convert(data, to_format)

Convert any recognized NDM message between KVN and XML through the shared generation gate.

ccsds_ndm.convert_file(source_path, destination_path, to_format)

Convert any recognized NDM file and atomically replace the destination on success.

class ccsds_ndm.CombinedNdm(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 XML combined NDM file. KVN has no combined representation.

static from_str(data, format=None)

Parse an XML combined NDM. KVN has no combined representation.

id

Message Identifier (optional).

Type:

Optional[str]

messages

List of contained navigation messages.

Type:

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

to_file(path, format)

Atomically write this combined NDM as XML.

Requesting format="kvn" raises NdmUnsupportedNotationError and leaves the destination untouched.

to_str(format)

Serialize to an XML string.

Requesting format="kvn" raises NdmUnsupportedNotationError.

validate()

Validate the combined message against CCSDS rules.

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).

CCSDS Reference: 502.0-B-3, Section 6.2.9.

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’

CCSDS Reference: 502.0-B-3, Section 3.2.2.

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

CCSDS Reference: 502.0-B-3, Section 3.2.2.

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

CCSDS Reference: 502.0-B-3, Section 3.2.2.

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

CCSDS Reference: 502.0-B-3, Section 3.2.2.

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

CCSDS Reference: 502.0-B-3, Section 3.2.2.

Type:

str

class ccsds_ndm.StateVector(epoch, x, y, z, x_dot, y_dot, z_dot, comment=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.)

CCSDS Reference: 502.0-B-3, Section 3.2.4.

Type:

list[str]

epoch

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

CCSDS Reference: 502.0-B-3, Section 3.2.4.

Type:

str

x

Position vector X-component.

Units: km

CCSDS Reference: 502.0-B-3, Section 3.2.4.

Type:

float

x_dot

Velocity vector X-component.

Units: km/s

CCSDS Reference: 502.0-B-3, Section 3.2.4.

Type:

float

y

Position vector Y-component.

Units: km

CCSDS Reference: 502.0-B-3, Section 3.2.4.

Type:

float

y_dot

Velocity vector Y-component.

Units: km/s

CCSDS Reference: 502.0-B-3, Section 3.2.4.

Type:

float

z

Position vector Z-component.

Units: km

CCSDS Reference: 502.0-B-3, Section 3.2.4.

Type:

float

z_dot

Velocity vector Z-component.

Units: km/s

CCSDS Reference: 502.0-B-3, Section 3.2.4.

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 the ephemeris state vector (see 7.5.10 for formatting rules).

CCSDS Reference: 502.0-B-3, Section 5.2.4.

Type:

str

x

Position vector X-component.

Units: km

CCSDS Reference: 502.0-B-3, Section 5.2.4.

Type:

float

x_ddot

Acceleration vector X-component.

Units: km/s²

CCSDS Reference: 502.0-B-3, Section 5.2.4.

Type:

Optional[float]

x_dot

Velocity vector X-component.

Units: km/s

CCSDS Reference: 502.0-B-3, Section 5.2.4.

Type:

float

y

Position vector Y-component.

Units: km

CCSDS Reference: 502.0-B-3, Section 5.2.4.

Type:

float

y_ddot

Acceleration vector Y-component.

Units: km/s²

CCSDS Reference: 502.0-B-3, Section 5.2.4.

Type:

Optional[float]

y_dot

Velocity vector Y-component.

Units: km/s

CCSDS Reference: 502.0-B-3, Section 5.2.4.

Type:

float

z

Position vector Z-component.

Units: km

CCSDS Reference: 502.0-B-3, Section 5.2.4.

Type:

float

z_ddot

Acceleration vector Z-component.

Units: km/s²

CCSDS Reference: 502.0-B-3, Section 5.2.4.

Type:

Optional[float]

z_dot

Velocity vector Z-component.

Units: km/s

CCSDS Reference: 502.0-B-3, Section 5.2.4.

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

Exceptions

exception ccsds_ndm.NdmError

Generic CCSDS NDM error.

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.

exception ccsds_ndm.NdmUnsupportedNotationError

The requested notation has no CCSDS-defined representation for this message family.