pyflwdir.dem.slope#

pyflwdir.dem.slope(elevtn, nodata=-9999.0, latlon=False, transform=(1.0, 0.0, 0.0, 0.0, -1.0, 0.0, 0.0, 0.0, 1.0))[source]#

Returns the local gradient

The slope is calculated on the basis of the dem in a 3 x 3 cell window, using 2nd order partial derivatives. The slope [m/m] is given as the increase in height per distance in horizontal direction.

Parameters:
  • elevnt (1D array of float) – elevation raster

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

  • latlon (bool, optional) – True if WGS84 coordinates, by default False

  • transform (affine transform) – Two dimensional transform for 2D linear mapping, by default gis_utils.IDENTITY

Returns:

slope [m/m]

Return type:

1D array of float