odc.geo.xr.wrap_xr
- odc.geo.xr.wrap_xr(im, gbox, *, time=None, nodata='auto', 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,Xgbox (
Union[GeoBox,GCPGeoBox]) – Geobox, must same shape as last two axis ofimtime – optional time axis value(s), defaults to None
nodata (
Union[float,int,str,None,Literal['auto']]) – optional nodata value, defaults to Nonecrs_coord_name (
Optional[str]) – allows to change name of the crs coordinate variablealways_yx (
bool) – If True, always use namesy,xfor spatial coordinatesdims (
Optional[Tuple[str,...]]) – Custom names for spatial dimensionsaxis (
Optional[int]) – Which axis of the input array corresponds to Y,Xattrs – Any other attributes to set on the result
- Return type:
- Returns:
xarray DataArray