netCDF utilities
New features in Igor 9 now allow the correct reading and writing of netCDF-4 files directly from within Igor. Igor 8 already added native netCDF-3 loading ability and Igor 7 added support for the extended data-types of netCDF-4 e.g. uint64 etc. Here are two sets of utilities to do both reading and writing using all in-built operations and user defined functions.
QLA netCDF reader
- Loads netCDF-3 and netCDF-4 files such that the original type is transparent to the user
- Parse all netCDF metadata nicely into CDL syntax attached to the WaveNote (c.f. ncdump or Panoply) or text dump
- Set the units and dimension names of the dataset
- Optionally apply scale factor, offset, fill value, valid range to data
- Functions to list, get, or set the attributes of a dataset
- Function to determine the type of netCDF file
- Menu is provided for convenience, inline is also perfectly fine
QLA netCDF4 library
- Functions to create netCDF-4 or netCDF-4 'classic model' files directly from Igor
- Switch between types easily without changing any code
- Keeps track of dimension information
- Keeps track of _Netcdf4Dimid and _Netcdf4Coordinates required hidden attributes
- Keeps track of unlimited dimensions, layout, and chunking
- Keeps track of the hierarchy, duplicate names, dimensions size matching etc.
- Provides some basic help for keeping CF compliance
- Provides some hopefully helpful error/information messages in the history area
- Compression and shuffling is available
- Functions follow similar syntax to netCDF C library functions
- Functions vaguely named after netCDF functions e.g. NC_def_var becomes QLA_def_var
A sample .ipf is included which uses almost all the functions available that you can use to make your own netCDF-4 / netCDF-4 classic and figure out how it all works, test the files using ncdump, nccopy, or the included loader etc.
Limitations:
- Only HDF5 based netCDF-4 files can be created directly. To create a netCDF-3 use the netCDF API nccopy.exe to convert your netCDF-4 classic model into a netCDF-3 i.e.
ExecuteScriptText /B /Z "cmd.exe /C nccopy -3 myNC4classic.nc myNC3.nc
- More exotic datatypes like ENUM are probably possible but aren't currently included in the library
All credit goes to Howard Rodstein for all his effort with changes and additions to the HDF5 operations within Igor. These include but are probably not limited to:
- New HDF5DimensionScale operation - this is what makes creating netCDF-4 dimensions possible
- HDF5 attribute creation order tracking and indexing
- Fixed length HDF5 string attributes
- Loading of VLEN type data needed for reading netCDF-4 dimensions
- HDF5SaveData /STRF flag for explicit control of text formatting
- HDF5SaveData /OPTS flag for controlling the type of dataspace; required for scalar variables
Project Details
Current Project Release
Release File: | QLA_netCDF_utilities_152.zip (55.15 KB) |
Version: | IGOR_9.01x_v152 |
Version Date: | |
Version Major: | 1 |
Version Extra: | 2 |
Version Patch Level: | 5 |
OS Compatibility: | Windows Mac-Intel |
Release Notes: |
QLA_netCDF4_library:
Included files:
|
Forum
Support
Gallery
Igor Pro 9
Learn More
Igor XOP Toolkit
Learn More
Igor NIDAQ Tools MX
Learn More