hydromt.gis.DataArray.raster.from_numpy#
- static gis.DataArray.raster.from_numpy(data, transform, nodata=None, attrs=None, crs=None)#
Transform a 2D/3D numpy array into a DataArray with geospatial attributes.
The data dimensions should have the y and x on the second last and last dimensions.
- Parameters:
data (
numpy.array
,2-dimensional
) – values to parse into DataArraytransform (
affine transform
) – Two dimensional affine transform for 2D linear mappingattrs (
dict
, optional) – additional attributescrs (
int
,dict
, orstr
, optional) – Coordinate Reference System. Accepts EPSG codes (int or str); proj (str or dict) or wkt (str)
- Returns:
da – xarray.DataArray with geospatial information
- Return type:
RasterDataArray