# Coordinate Variables

William Weibel (weibel@uniblab.atmos.Ucla.EDU)
Wed, 4 Jun 1997 11:18:40 -0700 (PDT)

```Alright, I have to put my 5 cents in now (no one wants pennies anymore).
The discussion so far seems to be focused on the case where the number of
indpendent variables (x,y,...) match the number of parameters (i,j,...).
But this is very often not the case.

The NetCDF conventions are very convenient for data on "rectilinear"
coordinate system, where the position vector X is represented as

X(i,j,k,...) = (x(i),y(j),z(k),...)

The discussion so far has considered the "structured" case

X(i,j,k,...) = (x(i,j,k,...),y(i,j,k,...),z(i,j,k,...))

But, there are many kinds of parametric relationships between (i,j,k...)
and (x,y,z...).  Lloyd Treinish gave an excellent survey of coordinate
systems in this group several years ago.

In my case, geopotential height data from National Climate Prediction
center is on a "diamond grid", in which the Northern hemisphere is studded
with 541 grid points, and points on successive latitudes are offset half a
cell width in longitude.  It is simplest to represent this as scattered
data

X(i) = (x(i),y(i))

Is a sufficient representation.  Unfortunately, there are two coordates
(x,y) and only one parameter, i.  This breaks the coordinate naming
convention.

dimensions:
npoints = 541;
variables:
lon(npoints);
lat(npoints);
geopotential(npoints);

there is no implied relationship between geopotential, lon, and lat
anymore.  I'm not too crazy about referential attributes, but there has
to be a way to denote the relationship.  For example,

geopotential:coordinates = "lon lat";

This seems to be sufficient information, along with the dimensions of
the variables, for software to determine how to map array indices to
coordinates.

For the structured case, the attribute may be unnecessary, as the X to
(i,j...) relationship can be inferred from the variable and dimension names.

OK, I hope this isn't beating a dead horse.

Bill

|||| | | | |  |  |  |   |   |    |    |    |   |   |  |  |  |  | | | | | ||||
William Weibel                           weibel@atmos.ucla.edu
UCLA Department of Atmospheric Sciences  Tel. (310)206-4441       \\\\/
Los Angeles, CA  90095-1565              Fax  (310)206-5219        O-O
U.S.A.                                                              |
-
... to know even one life has breathed easier because you have lived;
this is to have succeeded.			--Ralph Waldo Emerson
|||| | | | |  |  |  |   |   |    |    |    |   |   |  |  |  |  | | | | | ||||
```