slope#
- slope(xds: str | CloudPath | Path | tuple[ndarray | MaskedArray, dict] | DataArray | Dataset | DatasetReader | DatasetWriter, in_pct: bool = False, in_rad: bool = False, **kwargs) DataArray | Dataset[source]#
Compute the slope of a DEM (in degrees).
Goal: replace gdaldem CLI
- Parameters:
xds (AnyRasterType) – Path to the DEM, its dataset, its
xarrayor a tuple containing its array and metadatain_pct (bool) – Outputs slope in percents
in_rad (bool) – Outputs slope in radians. Not taken into account if
in_pct == True
- Returns:
Slope
- Return type: