cf.FieldAncillary.match_by_identity¶
-
FieldAncillary.
match_by_identity
(*identities)[source]¶ Whether or not the construct identity satisfies conditions.
See also
New in version 3.0.0.
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.); aQuery
object (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
identities
method, equals the condition value. A construct’s identities are those returned by itsidentities
method. In the following example, the constructx
has six identities:>>> x.identities() ['time', 'long_name=Time', 'foo=bar', 'standard_name=time', 'ncvar%t', T']
Returns: bool
Whether or not at least one of the conditions are met.
Examples:
>>> f.match_by_identity('time')
>>> f.match_by_identity(re.compile('^air'))
>>> f.match_by_identity('air_pressure', 'air_temperature')
>>> f.match_by_identity('ncvar%t')