cf.CellMeasure.match_by_ncvar¶
-
CellMeasure.
match_by_ncvar
(*ncvars)[source]¶ Whether or not the construct has a netCDF variable name.
See also
New in version 3.0.0.
Parameters: - ncvars: optional
Define one or more conditions on the netCDF variable name.
A netCDF variable name is specified by a string (e.g.
'lat'
), etc.); aQuery
object (e.g.cf.eq('lon')
); or a compiled regular expression (e.g.re.compile('^t')
) that is compared with the construct’s netCDF variable name viare.search
.The condition is satisfied if the netCDF variable name, as returned by the
nc_get_variable
method, exists and equals the condition value.
Returns: bool
Whether or not at least one of the conditions are met.
Examples:
>>> f.match_by_ncvar('t')
>>> f.match_by_ncvar(re.compile('^t'))
>>> f.match_by_ncvar('t', 'time')