Skip to main content

Variable

Struct Variable 

Source
pub struct Variable<'f> { /* private fields */ }
Expand description

A NetCDF-4 variable backed by an HDF5 dataset.

Implementations§

Source§

impl<'f> Variable<'f>

Source

pub fn name(&self) -> &str

Variable name.

Source

pub fn dimensions(&self) -> &[Dimension]

The dimensions of this variable.

Source

pub fn shape(&self) -> Result<Vec<u64>, Error>

The shape of this variable (dimension sizes).

Source

pub fn nc_type(&self) -> Result<NcType, Error>

The NetCDF data type of this variable.

Source

pub fn attrs(&mut self) -> Result<&HashMap<String, AttrValue>, Error>

Read all attributes as a HashMap.

Source

pub fn cf_attributes(&mut self) -> Result<CfAttributes, Error>

Extract CF convention attributes.

Source

pub fn read_f64(&mut self) -> Result<Vec<f64>, Error>

Read data as f64 with scale_factor/add_offset applied.

Missing values (matching _FillValue or missing_value) become NaN. If no scale_factor or add_offset attributes exist, returns the raw f64 data.

Source

pub fn read_raw_f64(&self) -> Result<Vec<f64>, Error>

Read raw data as f64 without any scale/offset transformation.

Source

pub fn read_raw_f32(&self) -> Result<Vec<f32>, Error>

Read raw data as f32 without any scale/offset transformation.

Source

pub fn read_raw_i32(&self) -> Result<Vec<i32>, Error>

Read raw data as i32 without any scale/offset transformation.

Source

pub fn read_raw_i64(&self) -> Result<Vec<i64>, Error>

Read raw data as i64 without any scale/offset transformation.

Source

pub fn read_raw_u64(&self) -> Result<Vec<u64>, Error>

Read raw data as u64 without any scale/offset transformation.

Source

pub fn read_string(&self) -> Result<Vec<String>, Error>

Read raw data as strings.

Source

pub fn read_raw(&self) -> Result<Vec<u8>, Error>

Read raw bytes without any type conversion.

Source

pub fn is_coordinate(&self) -> bool

Whether this is a coordinate variable (name matches a dimension name).

Trait Implementations§

Source§

impl Debug for Variable<'_>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'f> Freeze for Variable<'f>

§

impl<'f> RefUnwindSafe for Variable<'f>

§

impl<'f> Send for Variable<'f>

§

impl<'f> Sync for Variable<'f>

§

impl<'f> Unpin for Variable<'f>

§

impl<'f> UnsafeUnpin for Variable<'f>

§

impl<'f> UnwindSafe for Variable<'f>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.