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
- 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.); aQueryobject (e.g.cf.eq('longitude')); or a compiled regular expression (e.g.re.compile('^atmosphere')) that is compared with the construct’s identities viare.search.A construct has a number of identities, and the condition is satisfied if any of the construct’s identities, as returned by the
identitiesmethod, equals the condition value. A construct’s identities are those returned by itsidentitiesmethod. In the following example, the constructxhas six identities:>>> x.identities() ['time', 'long_name=Time', 'foo=bar', 'standard_name=time', 'ncvar%t', 'T']
- Returns
boolWhether 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')