⇐ ⇒

[CF-metadata] bounds

From: Jonathan Gregory <jonathan.gregory>
Date: Thu, 29 May 2003 08:59:19 +0100

Dear Bob and Brian

Thanks for your responses. Evidently rectilinear is a confusing term to use, as
you both indicate. I agree we should avoid it altogether.

To be clearer, the case I wanted to distinguish is the one where there are
2D lat and lon coordinates and, in addition, where the 2D grid indicates the
adjacencies of the cells: for 0<i<x and all j, cell (j,i-1) and cell (j,i)
are adjacent (not necessarily contiguous, but there is no intervening cell)
and for 0<j<y and all i, cell (j,i) and cell (j-1,i) are adjacent. In the
other case, the cells might be in an array of any dimensionality, whose
indices don't easily tell you about their adjacencies. In many cases they
may be in a 1D array. However, a 2D array doesn't necessarily tell you which
cells are adjacent. Suppose, for example, you covered the plane with hexagons
and gave each hexagon an index, then subdivided the hexagons into six
equilateral triangles and gave each triangle an index within its hexagon.
You then have a 2D array but cells (hexagon,triangle) and (hexagon-1,triangle)
are probably not adjacent. Furthermore the hexagons themselves might be viewed
as a 2D array in which case the cells are in a 3D array even though they cover
a 2D plane.

Is that clear? This distinction matters precisely because in the former case
you can decide contiguousness with no special knowledge about the x-y grid.
>From the current draft of the CF document, I wonder if we can call these cases
Cartesian and non-Cartesian?

I think Brian is right about the 2D contiguousness checking. In the case he
describes, if there is a hole between i and i+1, say, for some range of j but
not all j, it is clear there cannot possibly exist a continuous x coordinate,
because no reasonable continuous transformation will map coincident points in
x and y at the boundary between i and i+1 to separated points in lat and lon on
opposite sides of the hole. Hence we should recommend that if x and y coords
do exist, their boundaries should be supplied, because this indicates there
*is* a continuous transformation, and contiguousness can then be checked in 1D.
We could point this out in second-last paragraph of the preamble of section 5.

If x and y coordinates do not exist, x and y are just index dimensions
and there will be no grid_mapping variable - it couldn't be one of the cases
we have described (polar stereographic, rotated pole, etc.) as these are all
continuous transformations, but one in which lat and lon and their bounds are
essentially arbitrary functions of the x and y indices.

Here are the proposals again with modified terminology.

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) When the horizontal coordinates are not lat and lon, we have to consider
two cases for the bounds in lat and lon. The first case is that in which there
are two horizontal dimensions and the cells are arranged in a 2D array (y,x)
such that for 0<i<x and all j, cell (j,i-1) and cell (j,i) are adjacent and for
0<j<y and all i, cell (j,i) and cell (j-1,i) are adjacent. ("Adjacent" means
there is no intervening cell, but does not imply "contiguous".) In this case,
the lat and lon coordinates are supplied as 2D auxiliary coordinate variables
dimensioned (y,x) and the lat and lon 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 trailing indexes have the same convention as for 1D
points, so 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. In this case, if continuous 1D x
and y coordinates exist which are not pure indices, we recommend their 1D
bounds should be recorded, because the contiguousness of the cells can be
tested in 1D following (2) much more quickly than testing the contiguousness of
the 2D lat-lon cells; a check in 1D would be sufficient because a continuous
grid mapping in 2D will not affect contiguousness. 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. [The dimensioning of the 2D vertices is new.]

(4) The other non-lat-lon case for the horizontal is that in which there are
one or more dimensions (n,...) to index the horizontal plane and the indices do
not indicate the adjacencies of the cells without special knowledge of the
grid. In this case, the lat and lon coordinates are dimensioned (...,n) and
their bounds should be dimensioned (...,n,p), with p>2 being an index over
vertices. 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.]
Received on Thu May 29 2003 - 01:59:19 BST

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

⇐ ⇒