Skip to content

es.hillshade() #953

@kstueb

Description

@kstueb

The function hillshade = es.hillshade(arr)...
...from earthpy.spatial yields a correct hillshade raster only if the arr represents a DTM with a spatial resolution of 1m.

This is easily fixed if the line x, y = np.gradient(arr) in the function hillshade() is replaced with x, y = np.gradient(arr, resolution), where resolution is the spatial resolution of the DTM passed to the function as additional parameter.

https://earthpy.readthedocs.io/en/latest/_modules/earthpy/spatial.html#hillshade

Oversteepened hillshade generated with es.hillshade() from a 25m resolution DTM:
image

Correct hillshade from the same DTM calculated with the proposed correction to es.hillshade():
image

Both hillshades plotted with ep.plot_bands()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions