Struct sounding_base::Sounding [−][src]
pub struct Sounding { /* fields omitted */ }All the variables stored in the sounding.
The upper air profile variables are stored in parallel vectors. If a profile lacks a certain variable, e.g. cloud fraction, that whole vector has length 0 instead of being full of missing values.
Methods
impl Sounding[src]
impl Soundingpub fn new() -> Self[src]
pub fn new() -> SelfCreate a new sounding with default values. This is a proxy for default with a clearer name.
Examples
use sounding_base::Sounding; let snd = Sounding::new(); println!("{:?}", snd);
pub fn set_station_info(self, new_value: StationInfo) -> Self[src]
pub fn set_station_info(self, new_value: StationInfo) -> SelfSet the station info.
Examples
use sounding_base::{Sounding, StationInfo}; let stn = StationInfo::new(); // set station values let snd = Sounding::new() .set_station_info(stn);
pub fn get_station_info(&self) -> StationInfo[src]
pub fn get_station_info(&self) -> StationInfoGet the station info
Examples
use sounding_base::{Sounding, StationInfo}; let snd = make_test_sounding(); let stn: StationInfo = snd.get_station_info(); println!("{:?}", stn);
pub fn set_profile(self, var: Profile, values: Vec<Optioned<f64>>) -> Self[src]
pub fn set_profile(self, var: Profile, values: Vec<Optioned<f64>>) -> SelfSet a profile variable
Examples
extern crate optional; use optional::some; let p = vec![some(1000.0), some(925.0), some(850.0), some(700.0)]; let snd = Sounding::new() .set_profile(Profile::Pressure, p); println!("{:?}", snd);
pub fn get_profile(&self, var: Profile) -> &[Optioned<f64>][src]
pub fn get_profile(&self, var: Profile) -> &[Optioned<f64>]Get a profile variable as a slice
Examples
use sounding_base::{Sounding, Profile}; let snd = make_test_sounding(); let data = snd.get_profile(Profile::Pressure); for p in data { if p.is_some() { println!("{:?}", p); } else { println!("missing value!"); } }
pub fn set_surface_value<T>(self, var: Surface, value: T) -> Self where
Optioned<f64>: From<T>, [src]
pub fn set_surface_value<T>(self, var: Surface, value: T) -> Self where
Optioned<f64>: From<T>, Set a surface variable
pub fn get_surface_value(&self, var: Surface) -> Optioned<f64>[src]
pub fn get_surface_value(&self, var: Surface) -> Optioned<f64>Get a surface variable
pub fn set_lead_time<T>(self, lt: T) -> Self where
Optioned<i32>: From<T>, [src]
pub fn set_lead_time<T>(self, lt: T) -> Self where
Optioned<i32>: From<T>, Difference in model initialization time and valid_time in hours.
pub fn get_lead_time(&self) -> Optioned<i32>[src]
pub fn get_lead_time(&self) -> Optioned<i32>Difference in model initialization time and valid_time in hours.
pub fn get_valid_time(&self) -> Option<NaiveDateTime>[src]
pub fn get_valid_time(&self) -> Option<NaiveDateTime>Valid time of the sounding
pub fn set_valid_time<T>(self, valid_time: T) -> Self where
Option<NaiveDateTime>: From<T>, [src]
pub fn set_valid_time<T>(self, valid_time: T) -> Self where
Option<NaiveDateTime>: From<T>, Builder method to set the valid time of the sounding
pub fn bottom_up<'a>(
&'a self
) -> impl Iterator<Item = DataRow> + 'a[src]
pub fn bottom_up<'a>(
&'a self
) -> impl Iterator<Item = DataRow> + 'aGet a bottom up iterator over the data rows. The first value returned from the iterator is surface values.
pub fn top_down<'a>(
&'a self
) -> impl Iterator<Item = DataRow> + 'a[src]
pub fn top_down<'a>(
&'a self
) -> impl Iterator<Item = DataRow> + 'aGet a top down iterator over the data rows. The last value returned is the surface values.
pub fn get_data_row(&self, idx: usize) -> Option<DataRow>[src]
pub fn get_data_row(&self, idx: usize) -> Option<DataRow>Get a row of data values from this sounding.
pub fn surface_as_data_row(&self) -> DataRow[src]
pub fn surface_as_data_row(&self) -> DataRowGet the surface values in a DataRow format.
pub fn fetch_nearest_pnt(&self, target_p: f64) -> DataRow[src]
pub fn fetch_nearest_pnt(&self, target_p: f64) -> DataRowGiven a target pressure, return the row of data values closest to this one.
Trait Implementations
impl Clone for Sounding[src]
impl Clone for Soundingfn clone(&self) -> Sounding[src]
fn clone(&self) -> SoundingReturns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)Performs copy-assignment from source. Read more
impl Debug for Sounding[src]
impl Debug for Soundingfn fmt(&self, f: &mut Formatter) -> Result[src]
fn fmt(&self, f: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl Default for Sounding[src]
impl Default for Sounding