⇐ ⇒

[CF-metadata] bounds

From: Jonathan Gregory <jonathan.gregory>
Date: Tue, 27 May 2003 09:38:34 +0100

Dear Bob and Brian

> I don't have any objection to the (x,y,2,2) representation. I could be wrong, but
> there also seems to be a reasonable consensus that (x,y,2,2) is acceptable. Anyway
> I think the main goal is to wrap up these final issues before summer arrives.

I agree with the main goal! I hope we can decide in the next few days.

Brian has argued that (y+1,x+1) is better for 2D contiguous rectilinear cells
because it indicates they are contiguous - the same argument as for 1D but
without the problem 1D has with the record dimension. I agree this is true but
as with 1D I am not convinced that it is a good idea to support two schemes,
since you would still need (y,x,2,2) or (y,x,4) for the non-contiguous case.

I wondered if we could make it mandatory to supply 1D bounds for the 2D
rectilinear case. If you have 1D bounds, you can check them instead of the 2D
bounds. As we have discussed before, a continuous mapping such as a projection
will preserve contiguousness. However, this would be too large a requirement
because the 1D coordinate variables might not exist.

Here's (yet) another idea. I am in effect *defining* 2D rectilinear to mean
that there exist continuous 1D x and y coordinates, even if they aren't
recorded in the file. That excludes the situation where the cells had two
index dimensions but were not arranged as a 2D rectilinear array in any
continuous 2D coordinate plane. I would call that non-rectilinear.

If we adopt (y,x,2,2) for the 2D rectilinear case,

* It has the advantage of being distinguishable from the 2D non-rectilinear
case, which is dimensioned ([...,]x,2). The rectilinear case has two trailing
size-2 dimensions which aren't dimensions of the coordinate variable it
belongs to, and the non-rectilinear case has one trailing dimension of size>2
which isn't a dimension of the coordinate variable.

* If you know it is rectilinear, you *don't* have to check the entire bounds
variable for contiguousness. By the same argument as above, you have only to
check one row and one column. For instance, the slabs (0,*,0,*) and (*,0,*,0)
have shapes (x,2) and (y,2) respectively, like 1D bounds variables. It would
be sufficient to check these alone for contiguousness. True? If so, it is not
much more complicated than 1D. We can make the same requirement of exact
equality i.e. if the cells are contiguous in x, bound(j,i,q,1) must be
exactly equal to bound(j,i+1,q,0) for all j and q (j=0,...,y-1, q=0,1);
if they are contiguous in y, bound(j,i,1,p) must be exactly equal to
bound(j+1,i,0,p) for all i and p.

If this is OK and sufficiently convenient, the modified proposals are as below.

Best wishes

Jonathan


(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 2D rectilinear case, the bounds should be dimensioned (y,x,2,2),
where the first trailing index corresponds to the y dimension and the second
to the x. 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 lat-lon plane as
viewed from above. [This dimensioning of the 2D vertices is new.]

(4) In the 2D rectilinear case, if cells (j,i) and (j,i+1) are contiguous in
x, bound(j,i,q,1) should exactly equal bound(j,i+1,q,0) for q=0 and q=1. If
cells (j,i) and (j+1,i) are contiguous in y, bound(j,i,1,p) should exactly
equal bound(j+1,i,0,p) for p=0 and p=1. Since a continuous grid mapping in 2D
will not affect contiguousness, it is sufficient to check any single value of j
and q for contiguousness in x, i and p for contiguousness in y.

(5) In the non-rectilinear case, the bounds should be dimensioned
(...,n,p). The vertices must be traversed anticlockwise in the lat-lon plane
as viewed from above. The starting vertex is not specified by the standard.
[At present, the standard does not state any ordering.]
Received on Tue May 27 2003 - 02:38:34 BST

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

⇐ ⇒