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

20020426: netCDF Dimension data (cont.)



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

Steve,

>I was using the program I am developing to look at the netcdf file
>parameters.  When I now run ncdump, I can see something called "float
>ordinate_values(point_numbers)".  When using my program, I had also seen
>the variable "ordinate_values" but assumed it's length was only 9 elements
>long since the first index in "dimids[]" had a value of 9.  Well, I now
>realize that the elements within "dimids[]" are not the actual dimension
>sizes, but rather are just what "dimids" stands for, the Dimension ID  !!.

Right.

>Indeed, the Dimension ID #9 has a name of "point_number".  So now I think
>I'm on the way to getting my data.

Sounds good!

>A general question though.  If one wishes to get data from a netcdf file
>like this that someone else has created, it appears that I will have to
>make a guess as to what variable name is holding the actual data.

You can always use ncdump to list out the header and determine what the
name of the variable is that way.  Based on this, you could use an
external table (file with values) that contains the mapping of a
netCDF variable name and the variable you use in the file.  This way,
you could use one more generic program and simply supply information
to it through the table.  This issue, by the way, comes up all of the
time.  There is no way to force producers of datasets to use the same
names.  One can encourage them to use conventions for storing the data,
but when it comes down to actual names, it gets difficult.  The concept
of using an external table to provide the mapping of what the file
needs to read was agreed upon by our NUWG (netCDF Users Working Group)
as a reasonable way for a user to be able to handle files with the
same information, but with different names for variables.

>I can
>tell in this case because I examine all the variables myself visually and
>can see one with many points and a name "ordinate_values".  But to handle
>these decisions from within a software program will be a different story.
>What if another manufacturer uses a different variable name, or has some
>other many point arrays ?

You examine the file using ncdump and then write a table that your program
reads to get the name of the variable in the netCDF.

>I can check and see if chromatography vendors
>has standardized on variable name and structures.

I'm betting that they have, but only up to a point.

>Thanks for your reply.  It made me realize what my misunderstanding was.

You are welcome.  Glad to hear that you are on your way.

Tom