[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: 20010611: netCDF CDL design question (cont.)
- Subject: Re: 20010611: netCDF CDL design question (cont.)
- Date: Tue, 12 Jun 2001 12:45:31 -0600
>From: Mark Takala <address@hidden>
>Organization: University of Wisconsin/SSEC
>Keywords: 200012071945.eB7JjOo04438 netCDF lidar
Hi Mark,
> When I asked how to convert to netCDF, i was told that step 1 is to
> design a cdl for how i want the netCDF file to look.
> Could you elaborate on that? I am familiar with a general model of
> dimensions, variables, data. I look forward to further correspondence
> during this conversion.
CDL is just a simple notation for representing the structure of netCDF
data. Since it's readable and editable text, it provides a useful way
to decide how data should be represented in netCDF form before
committing to writing programs that deal with that representation.
People who use netCDF to represent their data typically use CDL to
propose dimension, variable, and attribute names and to discuss
conventions to be used for expressing the intent of the data
organization. Hence discussions of conventions usually occur using
CDL, see for example:
http://www.unidata.ucar.edu/packages/netcdf/conventions.html
and especially "coordinate conventions postings ".
You can also see the structure of a binary netCDF data file foo.nc
using the ncdump tool as in
ncdump -c foo.nc
which outputs the CDL representation of the file and its coordinate
variables, but not the actual data. If you leave off the "-c" option,
then you get all the data as well. You can use this as a way to get
started on CDL for a dataset that's like an existing dataset but with
a few changes.
Once you have a proposed CDL for some data, you can use the ncgen tool
to actually generate a binary netCDF file (ncgen -b), or to generate
some Fortran (ncgen -f) or C (ncgen -c) code to create the specified
netCDF dataset. This is useful in generating the somewhat tedious
"boilerplate code" for writing netCDF data that would otherwise be
necessary, and it can be instructive to use as an example for how the
various netCDF functions are used.
For some example CDL files, see
ftp://ftp.unidata.ucar.edu/pub/netcdf/cdl/
--Russ
_____________________________________________________________________
Russ Rew UCAR Unidata Program
address@hidden http://www.unidata.ucar.edu