pub struct TOAInfo {
pub is_bad: bool,
pub file: String,
pub frequency: f64,
pub mjd: Mjd,
pub mjd_error: f64,
pub site_id: String,
pub comment: String,
pub flags: HashMap<String, Flag>,
}Expand description
The basic information contained in a calculated TOA.
Fields§
§is_bad: boolWhether the TOA is marked as bad.
file: StringThe original file the TOA came from.
frequency: f64Observation frequency.
mjd: MjdThe date-time.
mjd_error: f64The error in MJD.
site_id: StringThe observation site identifier.
comment: StringAny comments left in the line.
flags: HashMap<String, Flag>All flags found. Which flags are used depends on the file’s creator,
but they are all put as either of two versions: f64 and String.
Implementations§
Source§impl TOAInfo
impl TOAInfo
Sourcepub fn from_line_tempo2(line: &str) -> Result<Self, PsruError>
pub fn from_line_tempo2(line: &str) -> Result<Self, PsruError>
Parses a single line of .tim-file information in TEMPO2-style.
§Errors
Returns errors for any malformed parameters.
let line = "fname 1.0 55.0 0.0 st -flag value -flag2 42";
let info = TOAInfo::from_line_tempo2(line).unwrap();
let toa = TOAInfo {
is_bad: false,
file: String::from("fname"),
frequency: 1.0,
mjd: Mjd::new(55, 0.0),
mjd_error: 0.0,
site_id: String::from("st"),
flags: HashMap::from([
(String::from("flag"), Flag::String(String::from("value"))),
(String::from("flag2"), Flag::Double(42.0)),
]),
comment: String::new(),
};
assert_eq!(info, toa);Trait Implementations§
impl StructuralPartialEq for TOAInfo
Auto Trait Implementations§
impl Freeze for TOAInfo
impl RefUnwindSafe for TOAInfo
impl Send for TOAInfo
impl Sync for TOAInfo
impl Unpin for TOAInfo
impl UnwindSafe for TOAInfo
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more