hydromt.gis.raster_utils.full#

hydromt.gis.raster_utils.full(coords: dict[str, ~numpy.ndarray], *, nodata: float | int = nan, fill_value: float | int | None = None, dtype: type = <class 'numpy.float32'>, shape: tuple[int] | None = None, dims: tuple[str] | None = None, name: str | None = None, attrs: dict[str, ~typing.Any] | None = None, crs: dict[str, ~typing.Any] | int | str | None = None, lazy: bool = False) DataArray[source]#

Return a full DataArray based on a geospatial coords dictionary.

Parameters:
  • coords (dict[str, np.ndarray]) – Coordinates (tick labels) to use for indexing along each dimension (max 3). The coordinate sequence should be (dim0, y, x) of which the first is optional.

  • nodata (float | int, optional) – No data value for new DataArray, important for reading with e.g. GDAL/ QGIS. By default nan.

  • fill_value (float | int, optional) – Fill value of the new DataArray. If not provided, the same value as the nodata value is used. By default None.

  • dtype (type, optional) – Data type, should be provided as a dtype defined by numpy (e.g. np.float32). By default np.float32.

  • shape (tuple[int], optional) – Length along (dim0, y, x) dimensions, of which the first is optional. When provided, it should match the lengths of the provided coordinates. By default None.

  • dims (tuple[str], optional) – Name(s) of the data dimension(s), by default None.

  • name (str, optional) – DataArray name, by default None.

  • attrs (dict[str, Any], optional) – Additional attributes to assign to the DataArray. By default None.

  • crs (dict[str, Any] | int | str, optional) – Coordinate Reference System. Accepted is EPSG codes (int or str) and proj (str or dict). By default None.

  • lazy (bool, optional) – If True return DataArray with a dask rather than numpy array, by default False.

Returns:

da – Newly created DataArray.

Return type:

xr.DataArray