hydromt.Dataset.raster.from_numpy#

static Dataset.raster.from_numpy(data_vars, transform, attrs=None, crs=None)#

Transform multiple numpy arrays to a Dataset object.

The arrays should have identical shape.

Parameters:
  • data_vars (- dict-like) –

    A mapping from variable names to numpy arrays. The following notations are accepted:

    • {var_name: array-like}

    • {var_name: (array-like, nodata)}

    • {var_name: (array-like, nodata, attrs)}

  • transform (affine transform) – Two dimensional affine transform for 2D linear mapping

  • attrs (dict, optional) – additional global attributes

  • crs (int, dict, or str, optional) – Coordinate Reference System. Accepts EPSG codes (int or str); proj (str or dict)

Returns:

ds – Dataset of data_vars arrays

Return type:

xr.Dataset