Skip to main content

Nc4File

Struct Nc4File 

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

An opened NetCDF-4 file (backed by HDF5).

Implementations§

Source§

impl Nc4File

Source

pub fn open(path: &Path) -> Result<Self>

Open a NetCDF-4 file from disk.

Source

pub fn open_with_options(path: &Path, options: NcOpenOptions) -> Result<Self>

Open a NetCDF-4 file from disk with custom options.

Source

pub fn from_bytes(data: &[u8]) -> Result<Self>

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

Source

pub fn from_bytes_with_options( data: &[u8], options: NcOpenOptions, ) -> Result<Self>

Open a NetCDF-4 file from in-memory bytes with custom options.

Source

pub fn root_group(&self) -> &NcGroup

The root group.

Source

pub fn is_classic_model(&self) -> bool

Check if this file uses the classic data model (_nc3_strict).

This checks the raw HDF5 root group attributes (before the internal attribute filter removes _nc3_strict).

Source

pub fn read_variable<T: H5Type>(&self, path: &str) -> Result<ArrayD<T>>

Read a variable’s data as a typed array.

Looks up the variable by path relative to the root group, then opens the matching HDF5 dataset and reads the data.

Source

pub fn read_variable_as_string(&self, path: &str) -> Result<String>

Read a string variable as a single string.

Source

pub fn read_variable_as_strings(&self, path: &str) -> Result<Vec<String>>

Read a string variable as a flat vector of strings.

Source

pub fn read_variable_parallel<T: H5Type>(&self, path: &str) -> Result<ArrayD<T>>

Source

pub fn read_variable_in_pool<T: H5Type>( &self, path: &str, pool: &ThreadPool, ) -> Result<ArrayD<T>>

Source§

impl Nc4File

Source

pub fn read_variable_as_f64(&self, path: &str) -> Result<ArrayD<f64>>

Read a variable with automatic type promotion to f64.

Reads in the native HDF5 type and promotes to f64 via mapv.

Source

pub fn read_variable_slice_as_f64( &self, path: &str, selection: &NcSliceInfo, ) -> Result<ArrayD<f64>>

Read a slice of a variable with automatic type promotion to f64.

Source

pub fn read_variable_slice<T: H5Type>( &self, path: &str, selection: &NcSliceInfo, ) -> Result<ArrayD<T>>

Read a typed slice of a variable (NC4 delegation).

Source

pub fn read_variable_slice_parallel<T: H5Type>( &self, path: &str, selection: &NcSliceInfo, ) -> Result<ArrayD<T>>

Read a typed slice of a variable using chunk-level parallelism.

Chunked datasets decompress overlapping chunks in parallel via Rayon. Non-chunked layouts fall back to read_variable_slice.

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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.