xarray.DataArray.proj.write_crs_info

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 a CRSIndex associated.

  • func (callable(), optional) – Any callable used to format CRS information as coordinate variable attributes. The default function adds a crs_wkt attribute for compatibility with CF conventions.

Returns:

Dataset or DataArray – A new Dataset or DatArray object with attributes updated for one or all spatial reference coordinates.