Determine whether or not a field matches the given conditions.
Conditions may be specified on the field’s:
A match occurs if all of the given conditions are satified.
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(prop={'standard_name': 'air_temperature'})
True
>>> f.match(prop={'standard_name': ['air_temperature']})
True
>>> f.match(prop={'standard_name': cf.set(['air_temperature', 'air_pressure'])})
True
>>> f.match(prop={'standard_name': '.*temperature.*'})
True
>>> f.match(prop={'standard_name': cf.set(['.*temperature.*', 'air_pressure'])})
True
>>> f.match(prop={'standard_name': '.*pressure.*'})
False
>>> f.match(prop={'Units': 'K'})
True
>>> f.match(prop={'Units': cf.Units('1.8 K @ 459.67')})
True
>>> f.match(prop={'Units': cf.set([cf.Units('Pa'), 'K'])})
True
>>> f.match(prop={'Units': cf.Units('Pa')})
False
>>> f.match(prop={'cell_methods': 'time: mean'})
True
>>> f.match(prop={'cell_methods': cf.CellMethods('time: mean')})
True
>>> f.match(attr={'cell_methods': ['time: mean', 'time: max']})
True
>>> f.match(prop={'cell_methods': cf.CellMethods('time: max')})
False
>>> f.match(prop={'cell_methods': 'time: mean time: min')})
False
>>> f.match(coord={'latitude': 0})
False
>>> f.match(coord={'latitude': cf.set([0, cf.gt(30)]})
True
>>> f.match(cellsize={'time': cf.wi(28, 31, 'days')})
True