Note
Go to the end to download the full example code.
Multidirectional hillshade#
Plot shaded relief map using a single and multiple illumination angles.
import matplotlib.pyplot as plt
import hyoga
# initialize figure
fig, axes = plt.subplots(ncols=3)
# open demo data with refined topography
with hyoga.open.example('pism.alps.vis.refined.nc') as ds:
ds = ds.sel(x=slice(400e3, 435e3))
# plot bedrock altitude
for ax in axes:
ds.hyoga.plot.bedrock_altitude(ax=ax, cmap='Topographic', vmin=0)
# add hillshades
ds.hyoga.plot.bedrock_hillshade(
ax=axes[0], altitude=45, azimuth=315)
ds.hyoga.plot.bedrock_hillshade(
ax=axes[1], altitude=45, azimuth=[255, 315, 15],
weight=[0.25, 0.5, 0.25])
ds.hyoga.plot.bedrock_hillshade(
ax=axes[2], altitude=45, azimuth=[15, 75, 135, 195, 255, 315],
weight=[0.2, 0.125, 0.1, 0.125, 0.2, 0.25])
# set titles
axes[0].set_title('One direction')
axes[1].set_title('Three directions (default)')
axes[2].set_title('Six directions')
# show
plt.show()
Total running time of the script: (0 minutes 0.465 seconds)