wiki:Documentation/UserGuide/StudyNetCDF

Version 1 (modified by jryder, 11 years ago) (diff)

--

How to study the data from netCDF files quickly and easily

The quickest way of all to look at NetCDF files is to use ncview, i.e.:

ncview myJob_20060101_20061231_1M_sechiba_history.nc

Unfortunately the ncview application can be a little unstable (at least on my system anyway).

ncdump is more flexible, and is a great way to look at header information:

ncdump -h myJob_20060101_20061231_1M_sechiba_history.nc

or, for example to extract one column of data in a tabulated text format (here for 'fluxlat', the latent heat flux):

ncdump -v fluxlat -f fortran -n fluxlat myJob_20060101_20061231_1M_sechiba_history.nc > myJob_fluxlat.cdl

But there's a simple script that can be used in IDL to import all of the data series at once, without having to spend time writing scripts to define input arrays first. First of all, download cdf2idl.pro, then input the following within IDL:

'''1)''' cdf2idl, '/home/rest_of_the_path/myJob_20060101_20061231_1M_sechiba_history.nc'

'''2)''' @myJob_20060101_20061231_1M_sechiba_history.idl

And then you have all of your variables nicely imported, and can be quickly plotted, e.g:

plot, tstep, tair(0,0,0,*)

Ferret: advice coming soon...