pub struct Nc4File { /* private fields */ }Expand description
An opened NetCDF-4 file (backed by HDF5).
Implementations§
Source§impl Nc4File
impl Nc4File
Sourcepub fn from_bytes(data: &[u8]) -> Result<Self>
pub fn from_bytes(data: &[u8]) -> Result<Self>
Open a NetCDF-4 file from in-memory bytes.
Sourcepub fn root_group(&self) -> &NcGroup
pub fn root_group(&self) -> &NcGroup
The root group.
Sourcepub fn is_classic_model(&self) -> bool
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).
Sourcepub fn read_variable<T: H5Type>(&self, path: &str) -> Result<ArrayD<T>>
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.
pub fn read_variable_parallel<T: H5Type>(&self, path: &str) -> Result<ArrayD<T>>
pub fn read_variable_in_pool<T: H5Type>( &self, path: &str, pool: &ThreadPool, ) -> Result<ArrayD<T>>
Source§impl Nc4File
impl Nc4File
Sourcepub fn read_variable_as_f64(&self, path: &str) -> Result<ArrayD<f64>>
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.
Sourcepub fn read_variable_slice_as_f64(
&self,
path: &str,
selection: &NcSliceInfo,
) -> Result<ArrayD<f64>>
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.
Sourcepub fn read_variable_slice<T: H5Type>(
&self,
path: &str,
selection: &NcSliceInfo,
) -> Result<ArrayD<T>>
pub fn read_variable_slice<T: H5Type>( &self, path: &str, selection: &NcSliceInfo, ) -> Result<ArrayD<T>>
Read a typed slice of a variable (NC4 delegation).
Sourcepub fn read_variable_slice_parallel<T: H5Type>(
&self,
path: &str,
selection: &NcSliceInfo,
) -> Result<ArrayD<T>>
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§
impl Freeze for Nc4File
impl !RefUnwindSafe for Nc4File
impl Send for Nc4File
impl Sync for Nc4File
impl Unpin for Nc4File
impl UnsafeUnpin for Nc4File
impl !UnwindSafe for Nc4File
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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