Skip to main content

NetCDF4File

Struct NetCDF4File 

Source
pub struct NetCDF4File { /* private fields */ }
Expand description

A NetCDF-4 file reader.

Wraps a rustyhdf5 File and provides NetCDF-4 semantics: dimensions, variables with CF attributes, groups, and type mapping.

Implementations§

Source§

impl NetCDF4File

Source

pub fn open<P: AsRef<Path>>(path: P) -> Result<Self, Error>

Open a NetCDF-4 file from a filesystem path.

Source

pub fn from_bytes(data: Vec<u8>) -> Result<Self, Error>

Open a NetCDF-4 file from in-memory bytes.

Source

pub fn nc_properties(&self) -> Result<Option<String>, Error>

Get the _NCProperties root attribute, if present.

This attribute is written by standard NetCDF-4 libraries and contains provenance information (library version, HDF5 version, etc.).

Source

pub fn dimensions(&self) -> Result<Vec<Dimension>, Error>

List dimensions defined in the root group.

Source

pub fn variables(&self) -> Result<Vec<Variable<'_>>, Error>

List all variables in the root group.

Source

pub fn variable(&self, name: &str) -> Result<Variable<'_>, Error>

Get a specific variable by name from the root group.

Source

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

Read all global (root group) attributes.

Source

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

List subgroup names in the root group.

Source

pub fn group(&self, name: &str) -> Result<NetCDF4Group<'_>, Error>

Get a subgroup by name.

Source

pub fn hdf5_file(&self) -> &File

Access the underlying HDF5 file for advanced operations.

Trait Implementations§

Source§

impl Debug for NetCDF4File

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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.