1use std::str::FromStr;
20
21use serde::{Deserialize, Serialize};
22
23pub mod measurement;
24pub mod sensitivity;
25mod trackingdata;
26pub mod two_way;
27mod types;
28
29pub use crate::od::ground_station::DopplerConfig;
30pub use measurement::Measurement;
31pub use trackingdata::TrackingDataArc;
32pub use types::MeasurementType;
33
34#[cfg(feature = "python")]
35mod python;
36
37#[cfg(feature = "python")]
38use pyo3::prelude::*;
39
40use crate::io::InputOutputError;
41
42#[cfg_attr(feature = "python", pyclass(from_py_object))]
43#[derive(Copy, Clone, Debug, PartialEq, Eq, Default, Serialize, Deserialize, der::Enumerated)]
44#[repr(u8)]
45pub enum IntegrationRef {
46 Start = 0,
47 #[default]
48 Middle = 1,
49 End = 2,
50}
51
52impl FromStr for IntegrationRef {
53 type Err = InputOutputError;
54 fn from_str(s: &str) -> Result<Self, Self::Err> {
55 match s.trim().to_lowercase().as_str() {
56 "middle" => Ok(Self::Middle),
57 "start" => Ok(Self::Start),
58 "end" => Ok(Self::End),
59 _ => Err(InputOutputError::UnsupportedData {
60 which: format!("`{s}` is not a valid integration reference"),
61 }),
62 }
63 }
64}