⇐ ⇒

[CF-metadata] CF-1.0-beta5: curvilinear bounds "contiguous"attribute

From: Jonathan Gregory <jonathan.gregory>
Date: Mon, 31 Mar 2003 00:04:09 +0100

Dear All

I'd like to make the following proposals concerning bounds.

(1) For a 1D coordinate variable, if no bounds are supplied, assume the cells
are contiguous. (Of course, for most calculations you will have to make a
further assumption about what the bounds actually are. This is up to the
application, so it is obviously better that the bounds should be supplied.)

(2) For a 1D coordinate variable, bounds should be supplied in a variable of
dimension (n,2). Let us extend the standard by defining an ordering for the
second index, namely that the bounds should be ordered in the same sense as the
coordinates. This means that if coordinate i is less/greater than coordinate
i+1, bound 0 should be less/greater than bound 1. Hence, for i>0, bound (i,0)
lies between coordinates i-1 and i, and for i<n-1, bound (i,1) lies between
coordinates i and i+1. More descriptively, the 0-bound of cell i is on the side
that faces cell i-1 and the 1-bound on the side facing cell i+1.

E.g. coordinates 1, 2, 3;
     bounds 0.5, 1.5, 1.5, 2.5, 2.5, 3.5;

     coordinates 3, 2, 1;
     bounds 3.5, 2.5, 2.5, 1.5, 1.5, 0.5;

(3) It follows that cells i and i+1 are contiguous if bound (i,1) equals bound
(i+1,0). Some tolerance is needed for equality. This cannot be precisely
defined, but I suggest that it is adequate to say that the absolute difference
between the bounds concerned must be much smaller (several orders of magnitude)
than the absolute difference between the gridpoints of the cells. For instance,
the difference between 2.49999 and 2.50001 is much smaller than the difference
between 2 and 3. This, I suggest, is what we mean by contiguousness in
practice. Let us draw the two cells independently and "stand back" far enough
from the picture that we can see both the gridpoints. If, from this viewpoint,
the boundaries appear to be coincident - that is, they are so close we can't
tell them apart - we say the cells are contiguous.

(4) When a 2D array of cells cover a 2D surface that has a continuous mapping
(for instance a plane projection or a rotation) onto latitude and longitude,
the latitude and longitude coordinates must be supplied (according to CF) in 2D
auxiliary coordinate variables (n,m). If bounds are supplied, they should be
dimensioned (n,m,2,2), where the 3rd index corresponds to n and the 4th to m.
(This is a change from the current CF standard.) The fact of the bounds being
"2D" with both the bounds dimensions having size 2 indicates that the spatial
dimensions can be factorised.

(5) CF recommends that 1D variables y(n) and x(m) are supplied in this
situation. Let us say that (a) if a 1D variable is not supplied, the cells
should be assumed contiguous in that dimension; (b) if a 1D variable is
supplied, but without bounds, then (1) applies i.e. they are again assumed
contiguous; (c) if bounds are supplied, they are ordered according to (2) so
contiguousness can be tested by (3). If they are contiguous in 1D, they must be
contiguous when transformed to lat and lon, and it's easier to test in 1D.

IMPORTANT: All these assumptions are made *without* checking the points
supplied by (4), if any. It would therefore be an ERROR to fail to supply 1D
bounds for cells which were *not* contiguous in dimensions which participate in
a 2D mapping to lat and lot. If we have this condition, we do not need to be
able to check for contiguousness using (4).

(6) As a consequence of the ordering of the 1D bounds, the 2D vertices of (4)
have a particular ordering in x,y space. It doesn't trace round clockwise or
anticlockwise, but zigzags, connecting the vertices in an N or a Z or their
mirror images.

(7) Paragraphs (4) and (5) could also apply for 2D mappings in other
coordinates than lat and lon, or for mappings involving more than two
dimensions. For instance, if we had a 3D mapping of two horizontal dimensions
and a vertical dimension (e.g. model levels which depend on position on a map
projection) to (height,lat,lon) we would have lat boundary variables
dimensioned (p,n,m,2,2,2).

(8) When cells cover a lat-lon surface but are not arranged in a 2D array on
any surface that can be mapped continuously into latitude and longitude, it is
not possible to supply 1D coordinate variables for the dimensions separately.
In this case the cells might have a single dimension to order them, or they
could have more. In the example supplied by Reiner, the cells have three
indices, even though they are covering a 2D lat-lon surface. In this case, the
vertices in latitude and longitude are supplied by the boundary variables of
the auxiliary coordinates, which are dimensioned (m,v) or (n,m,v) or (p,n,m,v)
or in general (...,v), according to how many dimensions there are. The
trailing dimension is an index over the vertices. The fact that there is only a
single bounds dimension, which has size v>2, indicates that the cells do not
cover a 2D surface that can be continuously mapped to lat and lon. This
situation is the one already included in CF. We require that the vertices must
be traversed clockwise or anticlockwise. It could be stipulated which way it
should be by defining it to be anticlockwise in the lat-lon plane as viewed
from above. I think that would be clear.

(9) Paragraph (8) could apply to cells in planes other than lat-lon. In that
case it would be harder to define what clockwise and anticlockwise mean.

(10) Testing the bounds defined by (8) is a complicated operation, as Steve
pointed out. This seems unavoidable - there is no short cut. However, you might
want to save the results. I suggested in an earlier posting a scheme we might
adopt for this (on Mon Mar 17 at 17:49:50).

How does the above strike you?

Best wishes

Jonathan
Received on Sun Mar 30 2003 - 16:04:09 BST

This archive was generated by hypermail 2.3.0 : Tue Sep 13 2022 - 23:02:40 BST

⇐ ⇒