Examples: NetCDF & MatLAB ========================== These directories contain examples of MatLAB commands for reading, creating, and modifying NetCDF files. All the scripts use Chuck Denham's MatLAB package which can be obtained at: "MexCDF and NetCDF Toolbox For Matlab-5&6" http://woodshole.er.usgs.gov/staffpages/cdenham/public_html/MexCDF/nc4ml5.html and must first be installed. The NetCDF files generated here are intended for use with Ingrid: http://ingrid.mit.edu/ As a result, they approximately follow the simple COARDS convention which is described at: http://www.unidata.ucar.edu/packages/netcdf/conventions.html http://ferret.wrc.noaa.gov/noaa_coop/coop_cdf_profile.html The key items for the use of NetCDF files within Ingrid are: 1) In order to work with the Ingrid "plot land" option, dimensions should have units of "degree_east" and "degree_north" as, for example, specified by: nc{'lon'}.units = 'degree_east'; nc{'lat'}.units = 'degree_north'; The actual dimension names (eg. "lat" or "Y") are unimportant. 2) It is generally a good idea to set the "gridtype" to 1 or 0 to indicate that the coordinate "wraps" or not. The gridtype attribute allows Ingrid to, for instance, plot longitudinal data over "wrapped" ranges such as -100 to 500deg. The attribute can be set using commands such as: nc{'X'}.gridtype = ncint(1); nc{'Y'}.gridtype = ncint(0); 3) Ingrid does seem to correctly handle the "_FillValue" attribute and it can be set using a MatLAB command such as: nc{ idu }.FillValue_ = ncdouble(-9999.0); [ Note how the "_" character is moved to the end of the attribute name since MatLAB cannot correctly handle variable names with a leading underscore. ]