netCDF version 4 has many features not found in earlier versions of the library and is implemented on top of HDF5. This module can read and write files in both the new netCDF 4 and the old netCDF 3 format, and can create files that are readable by HDF5 clients. The API modelled after Scientific.IO.NetCDF, and should be familiar to users of that module.
Most new features of netCDF 4 are implemented, such as multiple unlimited dimensions, groups and zlib data compression. All the new numeric data types (such as 64 bit and unsigned integer types) are implemented. Compound and variable length (vlen) data types are supported, but the enum and opaque data types are not. Mixtures of compound and vlen data types (compound types containing vlens, and vlens containing compound types) are not supported.
NEWS:
20090621: Version 0.8.1 released with experimental variable-length (vlen) data type support.
20090603: Compound types now work properly since the netcdf-4.1-beta-20090603 snapshot. I've disabled the compound types tests until 4.1 is released.
20090421: The initial compound data type support is 0.8 is broken (it only works correctly if all the members of the compound type have the same bit width). I'm trying to figure out if this is a bug in the netcdf library, the extension module, or both. So, if you are concerned about the test failures, just move tst_compoundvar.py out of the way.
20090418: version 0.8 released with support for compound data types (which map to numpy structured, i.e. 'record', arrays).
20090402: tst_dap.py in version 0.7.7 will fail due to a bug in the newly released netcdf-4.0.1 final. To skip the dap test, just rename test/tst_dap.py to test/tst_dap.py.skip and run test/run_all.py again.
20090217: version 0.7.7 released. David Huard has re-worked 'fancy indexing', adding new features and making it less of a memory hog. However, it is now no longer compatible with numpy fancy indexing - 1d arrays of boolean or integer indices work independently on each dimension (similar to the way vector subscripts work in fortran). This enables things like:
>>> tempdat = temp[[0,1,3],lats>0,lons>0]
(retrieves 1st, 2nd and 4th levels, all Northern Hem. and Eastern Hem. grid points - note that this would raise an error in numpy).
20090124: netcdf4-python now included in the Enthought Python Distribution (v4.1.30101).
20081223: If built against netcdf-4.0.1-beta2 (compiled with --enable-dap), you can access remote opendap datasets by specifying a URL instead of a filename when creating a Dataset instance.
20080922: Version 0.7.6 released. See Changelog.
20080801: Version 0.7.5 released. Bugfixes, mainly in MFDataset. Some new features in MFDataset.
20080508: Version 0.7.4 released. Use with netcdf-4.0 and HDF5 1.8.1.
20080414: Version 0.7.3.1 does not work with recent snapshots of the netCDF4 library. Click the 'Source' tab to download the latest source from SVN instead. I'm waiting the netcdf-4-beta2 (due any day now) before making a new source release.
20080101: As of version 0.7.3, a netCDF3 module is now included, for those who don't want to install bleeding-edge versions of the netcdf-4 and HDF5 libraries. Some features not found the Scientific.IO.NetCDF module:
- ability to read multi-file netCDF Datasets, making variables spanning multiple files appear as if they were in one file.
- support for masked arrays, automatic packing and unpacking of packed integer data.
- supports more complicated slicing (including numpy 'fancy indexing').
- includes convenience functions for converting to and from datetime objects to numeric time values, using all the calendars in the CF metadata standard.
- convenience functions for converting arrays of characters to arrays of strings, and vice-versa.
- can use numpy dtype objects to specify netCDF variable datatype.