Version 7 (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.:


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

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_fluxlat.cdl

But there's a really useful 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, compile it within IDL and then input the following:

cdf2idl, '/home/rest_of_the_path/'


And then you have all of your variables automatically imported, each into arrays of an appropriate size, and they can be quickly plotted, e.g:

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

(remember that IDL by default defines arrays as starting from 0, instead of from 1)

ncks: If you would like to remove a certain time series from a netcdf file (for instance, in this example, all data from 'temp_atmos_pres' in the file for which the height dimension is 20) with the output written to

ncks -H -d height,20 -d temp_atmos_pres,: