This script will step through the process of reading
data from a NetCDF file.
Missing Data, as flagged in the NetCDF file, will be
replaced with a NaN value (Not a Number).
Data is read from the file, and saved to the caller's
workspace. If the NetCDF provides data attributes
"scale_factor" and "add_offset" the script will first
scale and then offset the data.
For data that is 2 dimensional or higher, this script
will rotate it on import so it becomes row-major (the
MATLAB default) as apposed to column-major (the NetCDF
default). For 2D data this is taking the tranpose, for
3D or higher data, it is the equivalent of taking the
transpose of each data plane along the third dimension.
Data attributes are stored in a structure named with
the same name as the data but ending in "_info".
After reading the data, a separate function is called to
create an animated display of a subset of the data. It
creates an AVI video file of the animation and saves it
in the present directory.
NOTE: This is not a general solution for reading all
NetCDF files. This is an example based on a single
file and works for that file. It likely will not
work for other formats.