xdem.DEM.hillshade#
- DEM.hillshade(method=None, surface_fit='Florinsky', azimuth=315.0, altitude=45.0, z_factor=1.0, mp_config=None)[source]#
Generate a hillshade from the given DEM. The value 0 is used for nodata, and 1 to 255 for hillshading.
Based on Horn (1981), http://dx.doi.org/10.1109/PROC.1981.11918.
- Parameters:
method (
Literal['Horn','ZevenbergThorne']) – Deprecated; use surface_fit instead.surface_fit (
Literal['Horn','ZevenbergThorne','Florinsky']) – Surface fit method to use for slope and aspect: “Horn”, “ZevenbergThorne” or “Florinsky”.azimuth (
float) – The shading azimuth in degrees (0-360°) going clockwise, starting from north.altitude (
float) – The shading altitude in degrees (0-90°). 90° is straight from above.z_factor (
float) – Vertical exaggeration factor.mp_config (
MultiprocConfig|None) – Multiprocessing configuration, run the function in multiprocessing if not None.engine – Engine to use for computing the attribute, “scipy” or “numba”.
- Raises:
AssertionError – If the given DEM is not a 2D array.
ValueError – If invalid argument types or ranges were given.
- Return type:
TypeVar(RasterType, bound= Raster)- Returns:
A hillshade with the dtype “float32” with value ranges of 0-255.