Some tips for NetCDF
1. NetCDF (network Common Data Form) is a self-documenting binary
data format. The
libraries are not a standard part of any operating system, but they are
easily installed. See http://www.unidata.ucar.edu/software/netcdf/.
2. NetCDF is also not a standard part of Matlab, but the
libraries are easily installed in Matlab. See: http://mexcdf.sourceforge.net/.
3. To load a NetCDF file into Matlab, you have several options:
- Load a single variable: ncload('<filename.nc>','variable');
- Load the whole file: ncload('<filename.nc>');
- Rescale data to physical units automatically:
global
nctbx_options;
nctbx_options.theAutoNaN
= 1;
nctbx_options.theAutoscale
= 1;
4. Another option is to convert data from NetCDF to Matlab directly before doing
anything: http://www.mathworks.com/matlabcentral/fileexchange/15177
5. Preview data in a regular X-window (without loading):
- Examine the header: ncdump -h
<filename.nc>
- Dump the entire file: ncdump
<filename.nc> | more
- Dump a single variable: ncdump -v variable
<filename.nc>
- Use nco to extract
specific information from the file.
6. Ferret is
another software package that readily handles NetCDF files.
Sarah Gille, October
2008.