pyflwdir.dem.slope#

pyflwdir.dem.slope(elevtn: ndarray, nodata: float = -9999.0, latlon: bool = False, transform: ndarray = array([1., 0., 0., 0., -1., 0.])) → ndarray[source]#

Return the local slope magnitude.

The slope is calculated from the DEM in a 3-by-3-cell window using second-order partial derivatives. It is the magnitude of the elevation gradient, in metres per metre.

Parameters:
  • elevtn (2D array of float) – Elevation raster.

  • nodata (float, optional) – No-data value, by default -9999.0.

  • latlon (bool, optional) – True if coordinates use the WGS84 geographic coordinate system, by default False.

  • transform (np.ndarray, optional) – 2D array with 6 elements representing the affine transformation for raster, By default, the identity transform (1, 0, 0, 0, -1, 0).

Returns:

Slope magnitude [m/m].

Return type:

2D array of float