Struct sounding_base::Sounding

source ·
pub struct Sounding { /* private fields */ }
Expand description

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.

Implementations

Create 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);

Set the station info.

Examples
use sounding_base::{Sounding, StationInfo};

let stn = StationInfo::new();
// set station values

let snd = Sounding::new()
    .set_station_info(stn);

Get the station info

Examples
use sounding_base::{Sounding, StationInfo};

let snd = make_test_sounding();
let stn: StationInfo = snd.get_station_info();

println!("{:?}", stn);

Set 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);

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!");
    }
}

Set a surface variable

Get a surface variable

Difference in model initialization time and valid_time in hours.

Difference in model initialization time and valid_time in hours.

Valid time of the sounding

Builder method to set the valid time of the sounding

Get a bottom up iterator over the data rows. The first value returned from the iterator is surface values.

Get a top down iterator over the data rows. The last value returned is the surface values.

Get a row of data values from this sounding.

Get the surface values in a DataRow format.

Given a target pressure, return the row of data values closest to this one.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.