ccsds_ndm.ndm_kvn_io
CCSDS Navigation Data Messages KVN File I/O.
Classes
|
KVN read/write facade for CCSDS Navigation Data Messages. |
- class NdmKvnIo[source]
KVN read/write facade for CCSDS Navigation Data Messages.
Delegates the heavy lifting to the pipeline in
ccsds_ndm.kvn_utils_tokenizerandccsds_ndm.kvn_utils_parser(tokenise → block-split) and then constructs the appropriate xsdata dataclass tree.- from_path(kvn_read_file_path)[source]
Read a KVN file and return the corresponding NDM object tree.
Reads the file as plain text and forwards the content to
from_string().
- from_string(kvn_source)[source]
Parse a KVN string and return the corresponding NDM object tree.
Runs the three-step pipeline described in the module docstring:
tokenize()classifies each line into aKvnLinesubclass.parse_blocks()groups the tokens into aKvnDocumentwith the NDM type resolved from theCCSDS_*_VERSheader line.The
KvnDocumentis mapped onto the xsdata dataclass tree for the identified NDM type.
- to_file(ndm_obj, kvn_write_file_path)[source]
Serialise an xsdata NDM object tree and write it to a KVN file.
- to_string(ndm_obj)[source]
Serialise an xsdata NDM object tree to a KVN string.
- Parameters:
ndm_obj (
object) – Root xsdata dataclass instance (e.g.Opm,Oem, …).- Returns:
str– The NDM data formatted as a KVN string.- Raises:
NotImplementedError – Combined NDM input for KVN not implemented in CCSDS NDM Standard.
- Return type: