[][src]Struct netcdf::variable::Variable

pub struct Variable {
    pub name: String,
    pub attributes: HashMap<String, Attribute>,
    pub dimensions: Vec<Dimension>,
    pub vartype: i32,
    pub id: i32,
    pub len: u64,
    pub grp_id: i32,
}

This struct defines a netCDF variable.

Fields

The variable name

the netcdf variable type identifier (from netcdf-sys)

total length; the product of all dim lengths

Methods

impl Variable
[src]

Fetchs variable values, and cast them if needed.

// let values: Vec<f64> = some_variable.values().unwrap();

Read a slice of a variable into a buffer, the buffer must have a capacity at least equal as the number of elements of the slice. The buffer length (not its capacity) will be updated.

Fetchs one specific value at specific indices indices must has the same length as self.dimensions.

Read a slice of a variable into a buffer:

  • the 'buffer' must have a capacity at least equal as the product of all elements in 'slice'.
  • 'indices' must has the same length as self.dimensions.
  • all 'slice' elements must be > 0.

The buffer length (not its capacity) will be updated.

Fetchs a slice of values indices must has the same length as self.dimensions. All slice elements must be > 0.

Fetchs variable values as a ndarray.

// Each values will be implicitly casted to a f64 if needed
// let values: ArrayD<f64> = some_variable.as_array().unwrap();

Fetchs variable slice as a ndarray.

Put a single value at indices

Put a slice of values at indices

Set a Fill Value

Auto Trait Implementations

impl Send for Variable

impl Sync for Variable

Blanket Implementations

impl<T> From for T
[src]

Performs the conversion.

impl<T, U> Into for T where
    U: From<T>, 
[src]

Performs the conversion.

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

impl<T> Borrow for T where
    T: ?Sized
[src]

Important traits for &'a mut R

Immutably borrows from an owned value. Read more

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

impl<T> BorrowMut for T where
    T: ?Sized
[src]

Important traits for &'a mut R

Mutably borrows from an owned value. Read more

impl<T> Any for T where
    T: 'static + ?Sized
[src]

🔬 This is a nightly-only experimental API. (get_type_id)

this method will likely be replaced by an associated static

Gets the TypeId of self. Read more