cf.FieldList.select_by_naxes¶
-
FieldList.select_by_naxes(*naxes)[source]¶ Select field constructs by property.
To find the inverse of the selection, use a list comprehension with
match_by_naxesmethod of the construct elements. For example, to select all constructs which do not have 3-dimensional data:>>> gl = cf.FieldList( ... f for f in fl if not f.match_by_naxes(3) ... )
New in version 3.0.0.
See also
select,select_by_identity,select_by_construct,select_by_property,select_by_rank,select_by_units- Parameters
- Returns
FieldListThe matching field constructs.
Examples
>>> f = cf.read("file.nc") >>> f [<CF Field: specific_humidity(latitude(5), longitude(8)) 1>, <CF Field: air_temperature(atmosphere_hybrid_height_coordinate(1), grid_latitude(10), grid_longitude(9)) K>] >>> f.select_by_naxes() [<CF Field: specific_humidity(latitude(5), longitude(8)) 1>, <CF Field: air_temperature(atmosphere_hybrid_height_coordinate(1), grid_latitude(10), grid_longitude(9)) K>] >>> f.select_by_naxes(1) [] >>> f.select_by_naxes(2) [<CF Field: specific_humidity(latitude(5), longitude(8)) 1>] >>> f.select_by_naxes(3) [<CF Field: air_temperature(atmosphere_hybrid_height_coordinate(1), grid_latitude(10), grid_longitude(9)) K>]