[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

20020426: netCDF Dimension data



>From: Steve Parus <address@hidden>
>Organization: University of Michigan
>Keywords: 200204261406.g3QE6Na12557 netCDF dimension variable

Steve,

>I'm attempting to read a netCDF data file which contains chromatography
>data from a commercial vendor.  I'm using Borland's Delphi under Windows
>and a dll from your site.  I have the corresponding ascii text data as
>exported by the vendor, so I know what the file actually contains.
>
>I am able to obtain information on the variables such as their names and
>dimension sizes and can obtain their values.

How did you accomplish this?  Were you using the netCDF utility ncdump?
If so, how did you run ncdump (i.e., which flags did you specify)?

>I can also obtain dimension
>names and lengths.  I expect the file to contain a one dimensional data
>array of several thousand points.  I do see a dimension with a length (the
>same as the number of points in the vendor's exported ascii text file) of
>several thousand named "point_number".  I do not however see a variable
>name or variable shape that indicates it is a large array of data values.
>How can I get access to these data values ?

If you ran 'ncdump -h your_netcdf_file', then just the header of the
file will be printed out.  This will show you all of the dimensions,
variables, and attributes (per variable and global) that are in the
file, but it will not list out any data values.  Leaving off the '-h'
flag, on the other hand, will list out the entire contents of the
file.  If there is no variable dimensioned with the 'point_number'
dimension in the 'ncdump -h' listing, then none exists in the netCDF
that you have, or the file is corrupt.

>I'm confused as to what the
>Dimension is used for - does it contain data or just a description ?

A dimension is used to define the shape of a variable, just like in
any programming language.  Now, when there is a variable with the same
name as a dimension, it is the special case of a coordinate dimension.
Instead of the dimension values being simple indexes into an array
it is contains a list of exact points in the dimension.

Since I am sure that this explanation leaves a lot unexplained, I suggest
looking through the following URL which contains a short discussion of
time as a coordinate variable:

http://www.unidata.ucar.edu/packages/netcdf/time/recs.html

Also, I would recommend reading one or more of the URLs that will be
listed in a Google (tm) search using the following as search keys:

'coordinate dimension site:unidata.ucar.edu'

>Is there a correspondence between it and Variable ?

When there is a variable of the same name as a dimension, and the variable
is dimensioned with the dimension of the same name, it is referred to as
a coordinate variable.  As the discussion in the URL listed above
mentions, this is a useful construct that can be exploited by generic
display/analysis applications.

>Thanks for your help,

Back to your original question:

Can you send us the output of 'ncudmp -h your_netcdf_file'?  It will
help us to see the situation you are describing.

>-------------
>Stephen Parus
>University of Michigan
>Department of Chemistry
>Ann Arbor, MI 48109-1055

Tom Yoksas