cf.CoordinateReference.match_by_identity

CoordinateReference.match_by_identity(*identities)[source]

Determine whether or not one of the identities matches.

New in version 3.0.0.

See also

identities, match

Parameters
identities: optional

Define one or more conditions on the identities.

A construct identity is specified by a string (e.g. 'latitude', 'long_name=time', ``'ncvar%lat', etc.); a Query object (e.g. cf.eq('longitude')); or a compiled regular expression (e.g. re.compile('^atmosphere')) that is compared with the construct’s identities via re.search.

A construct has a number of identities, and the condition is satisfied if any of the construct’s identities, as returned by the identities method, equals the condition value. A construct’s identities are those returned by its identities method. In the following example, the construct x has six identities:

>>> x.identities()
['time',
 'long_name=Time',
 'foo=bar',
 'standard_name=time',
 'ncvar%t',
 'T']
Returns
bool

Whether or not the coordinate reference matches one of the given identities.

Examples

>>> c.match_by_identity('time')
>>> c.match_by_identity(re.compile('^air'))
>>> c.match_by_identity('air_pressure', 'air_temperature')
>>> c.match_by_identity('ncvar%t')