odc.geo.xr.wrap_xr

odc.geo.xr.wrap_xr(im, gbox, *, time=None, nodata=None, crs_coord_name='spatial_ref', always_yx=False, dims=None, axis=None, **attrs)[source]

Wrap xarray around numpy array with CRS and x,y coords.

Parameters:
  • im (Any) – numpy array to wrap, last two axes are Y,X

  • gbox (Union[GeoBox, GCPGeoBox]) – Geobox, must same shape as last two axis of im

  • time – optional time axis value(s), defaults to None

  • nodata – optional nodata value, defaults to None

  • crs_coord_name (Optional[str]) – allows to change name of the crs coordinate variable

  • always_yx (bool) – If True, always use names y,x for spatial coordinates

  • dims (Optional[Tuple[str, ...]]) – Custom names for spatial dimensions

  • axis (Optional[int]) – Which axis of the input array corresponds to Y,X

  • attrs – Any other attributes to set on the result

Return type:

DataArray

Returns:

xarray DataArray