cf.Index.match_by_identity¶
-
Index.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.); 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 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')