Re: Coordinate Systems Proposals

Steve Emmerson (steve@unidata.ucar.edu)
Tue, 15 Jul 97 12:42:47 -0600

John,

>Date: Tue, 15 Jul 1997 11:58:56 -0400 (EDT) 
>From: jps@gfdl.gov (John Sheldon)
>To: eaton@merlin.cgd.ucar.EDU (Brian Eaton)
>Subject: Re: Coordinate Systems Proposals 

In the above message, you wrote:

> Forget latitude and longitude!  The issue goes way back to a basic need
> for rules by which to interpret metadata/coordinates.  Change the strings
> in the original example:
> 
>     dimensions:
>         i = 5;
>         j = 6;
> 
>     variables:
>         float A(i,j);
>             A:coordinates = "abc, def";
>         float abc(i,j);
>         float def(i,j);
> 
> Now suppose I want to create a visualization of "A", say balls whose
> colors represent the value of "A".  There are 30 data points in a 6x5
> grid, so I get 30 balls in my picture.  Each point needs an "X" and a
> "Y" coordinate.  Do I get "X" from "abc" or from "def"?
> 
> And, yes, it *does* matter which one I assign to the y-axis.  If the
> values in "abc" run from 5 to 15 and the values in "def" run from 22 to
> 84, you can bet that which one I pick for X and which one I pick for Y
> will makes a big difference to the picture I'm going to end up with!
> One way it will be correct (ie, the way the originator of the file
> intended), and the other way I get the transpose...

    The above is an example of the third coordinate system which I
mentioned in my posting on the field data model: the WORLD coordinate
system.  To recap the previous two coordinate systems:

    1.  The MANIFOLD cooordinate system is that coordinate system in
	which the data is defined.  In a netCDF context, the manifold
	coordinate system are the indicies of the variables.

    2.  The BASE coordinate system is that coordinate system in which
        we like to think of the data -- an example being the usual
        geophysical (lat,lon,z)

    3.  There is an invertible transformation from manifold coordinates
	to base coordinates.

    The world coordinate system is that coordinate system in which the
data is either manipulated or displayed by some system that is outside
the context of the data.  A good example of this is the (x,y,z)
coordinate system of a 3-D data display system.  The problem stated
above can, thus, be restated as the following:

    How do we identify the transformation from base coordinates to world
    coordinates.

Placed in this context, we see the following:

    1.  This problem is separate from the problem of identifying the
	manifold and base coordinate systems and the transformation between
	them.

    2.  This problem must be solved in order to actually view the data.

    As a first stab at solving this second problem, I propose something
like the following, in which the manifold and base coordinate sytems are
identified, as well as the type of space the base coordinate system is
(from which the display system should be able to figure out the
base-to-world transformation):

    dimensions:
	x = 5;
	y = 10;
	z = 12

    variables:
	float p(x,y,z);
	    p:coordinates = "lat lon alt";
	float lat(x,y);
	    lat:coordinate_type = "latitude";
	float lon(x,y);
	    lon:coordinate_type = "longitude";
	float alt(x,y,z);
	    alt:coordinate_type = "altitude";

or
    variables:
	float p(x,y,z);
	    p:coordinates = "lat lon alt";
	float lat_lon(x,y,2);
	    lat_lon:coordinate_type = "latitude longitude";
	float alt(x,y,z);
	    alt:coordinate_type = "altitude";

In the above, "latitude", "longitude", and "altitude" would have to be
keywords.  For the wire spiral scenario we could have the following:

    dimensions:
	s = 100;

    variables:
	float temp(s);
	    s:coordinates = "rho theta z";
	float rho(s);
	    rho:coordinate_type = "radius";
	float theta(s);
	    theta:coordinate_type = "azimuth";
	float z(s);
	    z:coordinate_type = "distance";

Similarly, "radius", "azimuth", and "distance" would have to be keywords.

    It might be better to associate the type of base coordinate system
with the variable that uses it.  For example:

    dimensions:
	x = 5;
	y = 10;
	z = 12

    variables:
	float p(x,y,z);
	    p:coordinates = "lat lon alt";
	    p:coordinate_system = "geodetic(lat,lon) altitude(alt)";
	float lat(x,y);
	float lon(x,y);
	float alt(x,y,z);

where "geodetic" is a keyword and requires 2 coordinates ("lat" and
"lon" in the above) and "altitude" is also a keyword.  For the wire
spiral case we might have the following:

    dimensions:
	s = 100;

    variables:
	float temp(s);
	    s:coordinates = "rho theta z";
	    s:coordinate_system = "cylindrical(rho,theta,z)";
	float rho(s);
	float theta(s);
	float z(s);

--------
Steve Emmerson   <http://www.unidata.ucar.edu>