xarray.DataArray.cf.__getitem__#
- DataArray.cf.__getitem__(key)#
Index into a DataArray making use of CF attributes.
- Parameters
- key: str, Iterable[str], optional
- One of
axes names: “X”, “Y”, “Z”, “T”
coordinate names: “longitude”, “latitude”, “vertical”, “time”
cell measures: “area”, “volume”, or other names present in the
cell_measures
attributestandard names: names present in
standard_name
attribute of coordinate variablescf roles: ‘timeseries_id’, ‘profile_id’, ‘trajectory_id’, ‘mesh_topology’, ‘grid_topology’
grid mappings: ‘grid_mapping’ or a grid_mapping_name like ‘rotated_latitude_longitude’
- Returns
- DataArray
- Raises
- KeyError
DataArray.cf[List[str]]
will raise KeyError.
Notes
Associated CF variables will be attached as coordinate variables by parsing attributes such as
cell_measures
,coordinates
etc.Add additional keys by specifying “custom criteria”. See Custom Criteria for more.