cf.DomainAncillary.contiguous

DomainAncillary.contiguous(overlap=True)[source]

Return True if a domain ancillary has contiguous cells.

A domain ancillary is contiguous if its cell boundaries match up, or overlap, with the boundaries of adjacent cells.

In general, it is only possible for a zero, 1 or 2 dimensional domain ancillary with bounds to be contiguous. A size 1 domain ancillary with any number of dimensions is always contiguous.

An exception occurs if the domain ancillary is multdimensional and has more than one element.

New in version 2.0.

Parameters:
overlap
: bool, optional

If False then overlapping cell boundaries are not considered contiguous. By default cell boundaries are considered contiguous.

Returns:
out: bool

Whether or not the domain ancillary is contiguous.

Raises:
ValueError:

If the domain ancillary has more than one dimension.

Examples:
>>> c.hasbounds
False
>>> c.contiguous()
False
>>> print c.bounds[:, 0]
[  0.5   1.5   2.5   3.5 ]
>>> print c.bounds[:, 1]
[  1.5   2.5   3.5   4.5 ]
>>> c.contiuous()
True
>>> print c.bounds[:, 0]
[  0.5   1.5   2.5   3.5 ]
>>> print c.bounds[:, 1]
[  2.5   3.5   4.5   5.5 ]
>>> c.contiuous()
True
>>> c.contiuous(overlap=False)
False