...
There are several sets of tools to view and manipulate netCDF files. We have several of them installed on our UQAM servers. to get access to them you need to load the following module:
Volet |
---|
module load module load utils/netcdf-gnu-8.3 |
These are the tools you will have access to after executing the above command:
...
The ncdump is a command-line utility that converts the content of a netCDF file to ASCII text on standard output. It is a quick tool to look at the content of a netCDF file. Since netCDF files can get fairly large and with the the text output of ncdump I recommend to either just look at the header information (description of variables but not the actual data) with:
Volet |
---|
ncdump ncdump -h h netCDF_file |
or you can redirect the output into, 'less' to view it page by page and to be able to search in the text output with:
Volet |
---|
ncdump ncdump netCDF_file | less |
However, ncdump will not decode date and time step. To see these you can use 'cdo -sinfo' - see below.
cdo -sinfo
To list all the timesteps in a netCDF file you can use the command:
Volet |
---|
cdo -sinfo netCDF_file |
Generate netCDF files & modify attributes
ncgen
ncgen can generate a netCDF file, C program, or Fortran program from a CDL text file.
ncdump and ncgen used together
Used together, ncdump and ncgen can accomplish simple netCDF manipulations with little or no programming:
1) Create a text file with ncdump:
ncdump netCDF_file > text_file
2) Edit the text file with any editor
3) Generate a netCDF file from the modified text file:
ncgen -b -o new_netCDF_file text_file
However, this is not very practical for large netCDF files.
blablabla