From 5a3f7a6e0332304e2d760ad762558e7b966815c4 Mon Sep 17 00:00:00 2001 From: Andrei Zisu Date: Fri, 7 Jun 2024 16:51:12 +0300 Subject: [PATCH] Document KVN parsers --- crates/lox-io/src/ndm/omm.rs | 59 +++++++++++++++++++++++++++++++++++ crates/lox-io/src/ndm/opm.rs | 60 ++++++++++++++++++++++++++++++++++++ 2 files changed, 119 insertions(+) diff --git a/crates/lox-io/src/ndm/omm.rs b/crates/lox-io/src/ndm/omm.rs index 9ea9911e..82892a73 100644 --- a/crates/lox-io/src/ndm/omm.rs +++ b/crates/lox-io/src/ndm/omm.rs @@ -61,6 +61,65 @@ //! # //! let message: OmmType = quick_xml::de::from_str(xml).unwrap(); //! ``` +//! +//! To deserialize a KVN message: +//! ``` +//! # let kvn = r#"CCSDS_OMM_VERS = 3.0 +//! # COMMENT this is a comment +//! # COMMENT here is another one +//! # CREATION_DATE = 2007-06-05T16:00:00 +//! # ORIGINATOR = NOAA/USA +//! # COMMENT this comment doesn't say much +//! # OBJECT_NAME = GOES 9 +//! # OBJECT_ID = 1995-025A +//! # CENTER_NAME = EARTH +//! # REF_FRAME = TOD +//! # REF_FRAME_EPOCH = 2000-01-03T10:34:00 +//! # TIME_SYSTEM = MRT +//! # MEAN_ELEMENT_THEORY = SOME THEORY +//! # COMMENT the following data is what we're looking for +//! # EPOCH = 2000-01-05T10:00:00 +//! # SEMI_MAJOR_AXIS = 6800 +//! # ECCENTRICITY = 0.0005013 +//! # INCLINATION = 3.0539 +//! # RA_OF_ASC_NODE = 81.7939 +//! # ARG_OF_PERICENTER = 249.2363 +//! # MEAN_ANOMALY = 150.1602 +//! # COMMENT spacecraft data +//! # MASS = 300 +//! # SOLAR_RAD_AREA = 5 +//! # SOLAR_RAD_COEFF = 0.001 +//! # DRAG_AREA = 4 +//! # DRAG_COEFF = 0.002 +//! # COMMENT Covariance matrix +//! # COV_REF_FRAME = TNW +//! # CX_X = 3.331349476038534e-04 +//! # CY_X = 4.618927349220216e-04 +//! # CY_Y = 6.782421679971363e-04 +//! # CZ_X = -3.070007847730449e-04 +//! # CZ_Y = -4.221234189514228e-04 +//! # CZ_Z = 3.231931992380369e-04 +//! # CX_DOT_X = -3.349365033922630e-07 +//! # CX_DOT_Y = -4.686084221046758e-07 +//! # CX_DOT_Z = 2.484949578400095e-07 +//! # CX_DOT_X_DOT = 4.296022805587290e-10 +//! # CY_DOT_X = -2.211832501084875e-07 +//! # CY_DOT_Y = -2.864186892102733e-07 +//! # CY_DOT_Z = 1.798098699846038e-07 +//! # CY_DOT_X_DOT = 2.608899201686016e-10 +//! # CY_DOT_Y_DOT = 1.767514756338532e-10 +//! # CZ_DOT_X = -3.041346050686871e-07 +//! # CZ_DOT_Y = -4.989496988610662e-07 +//! # CZ_DOT_Z = 3.540310904497689e-07 +//! # CZ_DOT_X_DOT = 1.869263192954590e-10 +//! # CZ_DOT_Y_DOT = 1.008862586240695e-10 +//! # CZ_DOT_Z_DOT = 6.224444338635500e-10"#; +//! # +//! # use lox_io::ndm::kvn::KvnDeserializer; +//! # use lox_io::ndm::omm::OmmType; +//! # +//! let message: OmmType = KvnDeserializer::deserialize(&mut kvn.lines().peekable()).unwrap(); +//! ``` use serde; diff --git a/crates/lox-io/src/ndm/opm.rs b/crates/lox-io/src/ndm/opm.rs index 0da59ae1..c3b65c7e 100644 --- a/crates/lox-io/src/ndm/opm.rs +++ b/crates/lox-io/src/ndm/opm.rs @@ -111,6 +111,66 @@ //! # //! let message: OpmType = quick_xml::de::from_str(xml).unwrap(); //! ``` +//! +//! To deserialize a KVN message: +//! ``` +//! # let kvn = r#"CCSDS_OPM_VERS = 3.0 +//! # COMMENT Generated by GSOC, R. Kiehling +//! # COMMENT Current intermediate orbit IO2 and maneuver planning data +//! # CREATION_DATE = 2021-06-03T05:33:00.123 +//! # ORIGINATOR = GSOC +//! # OBJECT_NAME = EUTELSAT W4 +//! # OBJECT_ID = 2021-028A +//! # CENTER_NAME = EARTH +//! # REF_FRAME = TOD +//! # TIME_SYSTEM = UTC +//! # COMMENT State Vector +//! # EPOCH = 2021-06-03T00:00:00.000 +//! # X = 6655.9942 [km] +//! # Y = -40218.5751 [km] +//! # Z = -82.9177 [km] +//! # X_DOT = 3.11548208 [km/s] +//! # Y_DOT = 0.47042605 [km/s] +//! # Z_DOT = -0.00101495 [km/s] +//! # COMMENT Keplerian elements +//! # SEMI_MAJOR_AXIS = 41399.5123 [km] +//! # ECCENTRICITY = 0.020842611 +//! # INCLINATION = 0.117746 [deg] +//! # RA_OF_ASC_NODE = 17.604721 [deg] +//! # ARG_OF_PERICENTER = 218.242943 [deg] +//! # TRUE_ANOMALY = 41.922339 [deg] +//! # GM = 398600.4415 [km**3/s**2] +//! # COMMENT Spacecraft parameters +//! # MASS = 1913.000 [kg] +//! # SOLAR_RAD_AREA = 10.000 [m**2] +//! # SOLAR_RAD_COEFF = 1.300 +//! # DRAG_AREA = 10.000 [m**2] +//! # DRAG_COEFF = 2.300 +//! # COMMENT 2 planned maneuvers +//! # COMMENT First maneuver: AMF-3 +//! # COMMENT Non-impulsive, thrust direction fixed in inertial frame +//! # MAN_EPOCH_IGNITION = 2021-06-03T09:00:34.1 +//! # MAN_DURATION = 132.60 [s] +//! # MAN_DELTA_MASS = -18.418 [kg] +//! # MAN_REF_FRAME = EME2000 +//! # MAN_DV_1 = -0.02325700 [km/s] +//! # MAN_DV_2 = 0.01683160 [km/s] +//! # MAN_DV_3 = -0.00893444 [km/s] +//! # COMMENT Second maneuver: first station acquisition maneuver +//! # COMMENT impulsive, thrust direction fixed in RTN frame +//! # MAN_EPOCH_IGNITION = 2021-06-05T18:59:21.0 +//! # MAN_DURATION = 0.00 [s] +//! # MAN_DELTA_MASS = -1.469 [kg] +//! # MAN_REF_FRAME = RTN +//! # MAN_DV_1 = 0.00101500 [km/s] +//! # MAN_DV_2 = -0.00187300 [km/s] +//! # MAN_DV_3 = 0.00000000 [km/s]"#; +//! # +//! # use lox_io::ndm::kvn::KvnDeserializer; +//! # use lox_io::ndm::opm::OpmType; +//! # +//! let message: OpmType = KvnDeserializer::deserialize(&mut kvn.lines().peekable()).unwrap(); +//! ``` use serde;