xarray.Dataset.cf.grid_mappings

Dataset.cf.grid_mappings

Return a tuple of GridMapping objects for all grid mappings in this object.

For DataArrays, the order in the tuple matches the order that grid mappings appear in the grid_mapping attribute string.

Parameters:
None
Returns:
tuple[GridMapping, …]

Tuple of GridMapping dataclass instances, each containing: - name: CF grid mapping name - crs: pyproj.CRS object - array: xarray.DataArray containing the grid mapping variable - coordinates: tuple of coordinate variable names

Raises:
ImportError

If pyproj is not available. This property requires pyproj for CRS creation.

Notes

This property requires pyproj to be installed for creating CRS objects from CF grid mapping parameters. Install with: conda install pyproj or pip install pyproj.

Examples

>>> ds.cf.grid_mappings
(GridMapping(name='latitude_longitude', crs=<CRS: EPSG:4326>, ...),)