cf.contain¶
-
cf.
contain
(value, units=None, attr=None)[source]¶ Return a
cf.Query
object for cells of a variable for containing a value.If cells are not defined then return a
cf.Query
object for a variable for being equal to a value, i.e. this case is equivalent tocf.eq
.New in version 1.0.
Parameters: Returns: - out:
cf.Query
The query object.
Examples: >>> cf.contain(30, 'degrees_east') <CF Query: (contain <CF Data: 30 degrees_east>)> >>> cf.contain(cf.Data(10, 'km')) <CF Query: (contain <CF Data: 10 km>)>
>>> c <CF DimensionCoordinate: longitude(4) degrees_east> >>> print c.bounds.array [[ 0 90] [ 90 180] [180 270] [270 360]] >>> print (cf.contain(100) == c).array [False True False False] >>> print (cf.contain(9999) == c).array [False False False False]
- out: