netcdf

Docs Build Status Crates.io Coverage Status codecov Crates.io dependency status

Medium-level netCDF bindings for Rust, allowing easy reading and writing of array-like structures to a file.

Status

Supported:

Not (yet) supported:

All variable data is read into a contiguous buffer, or inta an ndarray if the ndarray feature is activated.

Building

This crate depends on libnetcdf. The Travis build runs on Ubuntu 16.04 Xenial and installs libnetcdf via apt, which results in netcdf v.4.4.0. netcdf is not widely tested on other versions of netcdf.

You can build the library and run the tests via Docker like this:

docker build . -t netcdf docker run -it --rm netcdf

Documentation

Some examples of usage can be found in the tests/lib.rs file. The documentation can also be found using cargo doc.

Thread safety

The netcdf-c library is not threadsafe. To render a safe interface, a global mutex is used to serialize access to the underlying library. If performance is needed, consider using a non threadsafe version of hdf5, so double locking is avoided.

Use of netcdf-sys is not thread-safe. Users of this library must take care that calls do not interfere with simultaneous use of e.g. netcdf. Using the hdf5-sys library could also pose a problem, as this library is used throughout netCDF-c and internal state may be disrupted.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.