Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Flipped y axis of the DEM when passing it into the LightSource shade functions
  • Loading branch information
daminton committed Mar 10, 2022
1 parent f5636b9 commit 65427e4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions python/ctem/ctem/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def image_dem(user, DEM):
solar_angle = 20.0 # user['solar_angle']

ls = LightSource(azdeg=azimuth, altdeg=solar_angle)
dem_img = ls.hillshade(DEM, vert_exag=ve, dx=pix, dy=pix)
dem_img = ls.hillshade(np.flip(DEM, axis=0), vert_exag=ve, dx=pix, dy=pix)

# Generate image to put into an array
height = gridsize / dpi
Expand Down Expand Up @@ -116,7 +116,7 @@ def image_shaded_relief(user, DEM):
else:
shadedmaxh = user['shadedmaxh']

dem_img = ls.shade(DEM, cmap=cmap, blend_mode=mode, fraction=1.0,
dem_img = ls.shade(np.flip(DEM, axis=0), cmap=cmap, blend_mode=mode, fraction=1.0,
vert_exag=ve, dx=pix, dy=pix,
vmin=shadedminh, vmax=shadedmaxh)

Expand Down

0 comments on commit 65427e4

Please sign in to comment.