Determine whether or not a field satisfies conditions.
Conditions may be specified on the field’s attributes, coordinate values and coordinate cell sizes.
Parameters : |
|
---|---|
Returns : |
|
Examples
>>> print f
Data : air_temperature(time, latitude, longitude)
Cell methods : time: mean
Dimensions : time(12) = [15, ..., 345] days since 1860-1-1
: latitude(73) = [-90, ..., 90] degrees_north
: longitude(96) = [0, ..., 356.25] degrees_east
: height(1) = [2] m
>>> f.match(attr={'standard_name': 'air_temperature'})
True
>>> f.match(attr={'standard_name': ['air_temperature']})
True
>>> f.match(attr={'standard_name': ['air_temperature', 'air_pressure']})
True
>>> f.match(attr={'standard_name': '.*temperature.*'})
True
>>> f.match(attr={'standard_name': ['.*temperature.*', 'air_pressure']})
True
>>> f.match(attr={'standard_name': '.*pressure.*'})
False
>>> f.match(attr={'Units': 'K'})
True
>>> f.match(attr={'Units': cf.Units('1.8 K @ 459.67')})
True
>>> f.match(attr={'Units': [cf.Units('Pa'), 'K']})
True
>>> f.match(attr={'Units': cf.Units('Pa')})
False
>>> f.match(attr={'cell_methods': 'time: mean'})
True
>>> f.match(attr={'cell_methods': cf.CellMethods('time: mean')})
True
>>> f.match(attr={'cell_methods': ['time: mean', 'time: max']})
True
>>> f.match(attr={'cell_methods': cf.CellMethods('time: max')})
False
>>> f.match(attr={'cell_methods': 'time: mean time: min')})
False
>>> f.match(coord={'latitude': 0})
False
>>> f.match(coord={'latitude': [0, cf.gt(30)]})
True
>>> f.match(cellsize={'time': cf.inside(28, 31, 'days')})
True