A pure Rust library for reading and writing NetCDF-3 files.
- Define a NetCDF-3 data set :
- Create, get, rename, and remove global attributes.
- Create, get, rename, and remove dimensions.
- Create, get, rename, and remove variables.
- Create, get, rename, and remove variable attributes.
- Read a NetCDF-3 file :
- Read all data of a variable.
- Read all data of a record (a part of a variable defined on one NetCDF-3 record).
- Read a slice of data.
- Read a variable's data into a N-dimensional array (using the crate ndarray).
- Write a NetCDF-3 file :
- Write all data of a variable.
- Write all data of a record (a part of a variable defined on one NetCDF-3 record).
- Write a slice of data.
- Write a variable's data from a N-dimensional array (using the crate ndarray).
- Validations are done by comparing files produced by this crate and files produced by the Python library netCDF4(see the Python script
pyscripts/create_test_nc3_files.py
and the Rust test filetests/tests_write_nc3_files.rs
). - If the number of records
numrecs
is greater thanstd::i32::MAX
then this value is considered as indeterminate and the actually written value isnumrecs = 2^32 - 1
(see the File Format Specifications). - If the chunk size of a given variable
vsize
is greater thestd::i32::MAX
then its value is considered as indeterminate and the actually written value isvsize = 2^32 - 1
(see the File Format Specifications).
- Cannot read/write a subset of a variable data yet.
- Cannot rewrite a NetCDF-3 file.
Various examples are available here.