⇐ ⇒

[CF-metadata] bounds

From: Jonathan Gregory <j.m.gregory>
Date: Thu, 26 Jun 2003 18:02:20 +0100

Dear Brian

> If we allow this
> representation for non-contiguous cells, then we must allow for the most
> general case in which none of the cells are contiguous. In that case, how
> do you propose to specify how the vertices are indexed?

It's defined in the same way as for 1D bounds. The 0-index is on the side of
i-1 and the 1-index on the side of i+1. Taking some steps back, I think we
believed that the particular advantage of the 2,2 representation was just that
it told you which vertices to test for contiguousness.

I wonder if we can get round the problem with not knowing which side faces in
a certain direction by restricting 2,2 to the case where projection variables
exist. In that case there is really is an "underlying" xy representation.

Try this:

(1) For a 1D coordinate variable with bounds (x,2), define an ordering for the
2nd index, namely that the bounds should be ordered in the same sense as the
coordinates, so that 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. [At present, there is no ordering
defined for 1D bounds.]

(2) If 1D cells i and i+1 are contiguous, bound (i,1) should exactly equal
bound (i+1,0). The data-writer should ensure that this is so. [At present, the
standard does not state how contiguousness should be tested.]

(3) In the case where the horizontal grid is described by two-dimensional
coordinate variables lat(n,m) and lon(n,m), the associated cells are
four-sided, and there exist continuous coordinate variables x(m) and y(n),
then the boundary variables are given in the form latbnd(n,m,2,2) and
lonbnd(n,m,2,2), where the first trailing index corresponds to the y dimension
and the second to the x. The trailing indexes have the same convention as for
1D points, such that the 0-bound in either x or y is on the side which faces
the cell with the next smallest index in that dimension, the 1-bound on the
side facing the cell with the next largest index.

If the coordinate system x-y-upward is right-handed (like lon-lat-upward), the
elements (j,i,0,0), (j,i,0,1), (j,i,1,1), (j,i,1,0) in that order traverse the
vertices of cell (j,i) anticlockwise in the lon-lat plane as viewed from above.
If the coordinate system is left-handed, this sequence of elements traverse the
vertices clockwise.

For 0 < j < n and 0 < i < m,

If cells (j,i) and (j,i+1) are contiguous, then

bnd(j,i,0,1)=bnd(j,i+1,0,0) and bnd(j,i,1,1)=bnd(j,i+1,1,0)

If cells (j,i) and (j+1,i) are contiguous, then

bnd(j,i,1,0)=bnd(j+1,i,0,0) and bnd(j,i,1,1)=bnd(j+1,i,0,1)

(4) In all other cases, the bounds should be dimensioned (...,n,p). The
vertices must be traversed anticlockwise in the lon-lat plane as viewed from
above. The starting vertex is not specified by the standard. [At present, the
standard does not state any ordering.]

Jonathan
Received on Thu Jun 26 2003 - 11:02:20 BST

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

⇐ ⇒