cf.Bounds.contiguous¶
-
Bounds.
contiguous
(overlap=True, direction=None, period=None, verbose=1)[source]¶ Return True if the bounds are contiguous.
Bounds are contiguous if the cell boundaries match up, or overlap, with the boundaries of adjacent cells.
In general, it is only possible for 1 or 0 variable dimensional variables with bounds to be contiguous, but size 1 variables with any number of dimensions are always contiguous.
An exception is raised if the variable is multdimensional and has more than one element.
New in version 2.0.
- Parameters
- overlap:
bool
, optional If False then 1-d cells with two bounds vertices are not considered contiguous if any adjacent cells overlap each other. By default such cells are considered contiguous.
- direction:
Specify the direction of 1-d coordinates with two bounds vertices. Either True for increasing coordinates, or False for descreasing coordinates. By default the direction is inferred from whether the first bound of the first cell is less than its second bound (direction is True), or not (direction is False).
- period: optional
Define the period of cyclic values so that the test for contiguousness can be carried out with modulo arithmetic. By default the data are assumed to be non-cyclic, unless the bounds have units of longitude (or have units of
'degrees'
), in which case a period of 360 degrees is assumed.- verbose:
int
, optional TODO
- Returns
bool
Whether or not the cells are contiguous.
Examples:
TODO
- overlap: