Expand description

Description

A pure Rust library for reading and writing NetCDF-3 files.

Examples

  • Define the NetCDF-3 using the struct Dataset :
    • Define (create, get, rename and remove) global atributes (examples here);
    • Define (create, get, rename and remove) dimensions (examples here);
    • Define (create, get, rename and remove) variables (examples here);
    • Define (create, get, rename and remove) variable attributes (examples here);
  • Read the NetCDF-3 files using the struct FileReader.
  • Write the NetCDF-3 files using the struct FileWriter.

Notes

  • If the number of records numrecs is greater than std::i32::MAX then this value is considered as indeterminate and the actually written value is numrecs = 2^32 - 1(see the File Format Specifications).
  • If the chunk size of a given variable vsize is greater the std::i32::MAX then its value is considered as indeterminate and the actually written value is vsize = 2^32 - 1 (see the File Format Specifications).
  • To validate the implementation of the NetCDF-3 files writing, binary comparisons between the crate outcomes and files produced by the Python library netCDF4 are done while the test suite (see the Python script pyscripts/create_test_nc3_files.py and the Rust test file tests/tests_write_nc3_files.rs).

Known limitations

  • Cannot read/write a subset of a variable data yet.
  • Cannot rewrite a NetCDF-3 file.

Re-exports

pub use error::ReadError;
pub use error::WriteError;
pub use error::InvalidDataSet;

Modules

Structs

NetCDF-3 attribute

Allows to define the NetCDF-3 data sets

NetCDF-3 dimension

Allows to read NetCDF-3 files (the classic and the 64-bit offset versions).

Allows to write NetCDF-3 files (the classic and the 64-bit offset versions).

NetCDF-3 variable

Enums

All the data types supported by the NetCDF-3 format

Wraps the six NetCDF-3 data types.

Type of a dimension, fixed or unlimited size

NetCDF-3 file versions (classic or 64-bit offset)

Constants

Default fill value for the f32 elements (same value as NC_FILL_FLOAT defined in the header file netcdf.h)

Default fill value for the f64 elements (same value as NC_FILL_DOUBLE defined in the header file netcdf.h)

Default fill value for the i8 elements (same value as NC_FILL_BYTE defined in the header file netcdf.h)

Default fill value for the i16 elements (same value as NC_FILL_SHORT defined in the header file netcdf.h)

Default fill value for the i32 elements (same value as NC_FILL_INT defined in the header file netcdf.h)

Default fill value for the u8 elements (same value as NC_FILL_CHAR defined in the header file netcdf.h)

Maximum length of the fixed-size dimensions

Maximum size (number of bytes) allowed for the NetCDF names.

Maximum number of dimensions per variable

Functions

Checks that name follows the NetCDF-3 naming convention.