NetCDF Notes - metxchris/TRANSVIZ GitHub Wiki
Just some quick notes on the NetCDF commands used by TRANSVIZ.
The primary Matlab NetCDF Commands used by TRANSVIZ are:
ncid = netcdf.open(filePath,'NC_NOWRITE'); % open CDF for reading
finfo = ncinfo(filePath); % stores all file info (other than values of each variable)
varid = netcdf.inqVarID(ncid,'NE'); % inquery ID of variable 'NE'
vardata = netcdf.getVar(ncid, varid); % store data of variable referenced by varid
Variable data is always extracted using the varid/vardata commands listed above. Other variable information is extracted from the variable tree structure within finfo following the format listed in the CDF Compatibility section.
Another strong method to extract CDF data (not used in TRANSVIZ) is through the custom netcdfobj function. This method is good in that both the variable data and descriptors can be extracted in one swoop; the downside is that vectorized extraction methods don't seem to work with this function.
filePath = 'C:\Users\MetxChris\Documents\MATLAB\101391T25.CDF';
obj=netcdfobj(filePath);