xarray.DataArray.proj.write_crs_info#
- DataArray.proj.write_crs_info(spatial_ref=None, func=<function format_compact_cf>)#
Write CRS information as attributes to one or all spatial reference coordinates.
- Parameters:
spatial_ref (
Hashable, optional) – The name of a spatial reference coordinate. If not provided (default), CRS information will be written to all spatial reference coordinates found in the Dataset or DataArray. Each spatial reference coordinate must already have aCRSIndexassociated.func (
callable(), optional) – Any callable used to format CRS information as coordinate variable attributes. The default function adds acrs_wktattribute for compatibility with CF conventions.
- Returns:
DatasetorDataArray– A new Dataset or DatArray object with attributes updated for one or all spatial reference coordinates.