-
Notifications
You must be signed in to change notification settings - Fork 224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add gallery example for grdgradient #1428
Add gallery example for grdgradient #1428
Conversation
Co-authored-by: Yao Jiayuan <coreman.seism@gmail.com>
At #1425 I suggest also extending the |
# Load sample grid (3 arc second global relief) in target area | ||
grid = pygmt.datasets.load_earth_relief(resolution="03s", region=region) | ||
|
||
# calculate the reflection of a light source projecting from west to east(azimuth 270) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# calculate the reflection of a light source projecting from west to east(azimuth 270) | |
# calculate the reflection of a light source projecting from west to east (azimuth 270 degrees) |
# --------------- plotting the hillshade map ----------- | ||
pygmt.makecpt(cmap="gray", series=[-1.5, 0.3, 0.01]) | ||
fig.grdimage( | ||
grid=dgrid, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can anyone confirm the definition of a hillshaded map? Based on my own understanding, hillshading means plotting the elevation data grid
, and also apply the (-1,1) intensity grid dgrid
for each point. Thus a hillshaded map should be like this (the CPT range should also be changed to reflect the elevation range):
grid=dgrid, | |
grid=grid, | |
shading=dgrid, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no one answer to this. I think what is plotted in this gallery example could be considered a 'hillshade map' (showing only the hillshade component) but not a 'hillshaded map' implying that the hillshade component alters the appearance of other data (e.g., elevation) that are shown on the map.
My opinion is that it would be better to plot a slope map for the simple grdgradient gallery example and that hillshading should be covered in a different tutorial that can go into different strategies (e.g., multi-directional, mixing slope and hillshade for illumination, transparent overlays versus grdgradient's shading parameter, etc). Sorry for not commenting about this earlier. It will be a great addition to have an example for grdgradient.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no one answer to this. I think what is plotted in this gallery example could be considered a 'hillshade map' (showing only the hillshade component) but not a 'hillshaded map' implying that the hillshade component alters the appearance of other data (e.g., elevation) that are shown on the map.
Agree with @meghanrjones regarding this point! I think the example itself is good as is in the current form but would also suggest to add another example/tutorial on this topic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ill agree that a slops map is more intuitive when you think on the gradient of a DEM. On the other hand, at least in my experience, shade maps are more intuitive to use(you are seeing the topography directly).
Co-authored-by: Michael Grund <23025878+michaelgrund@users.noreply.github.com>
Co-authored-by: Michael Grund <23025878+michaelgrund@users.noreply.github.com>
Co-authored-by: Michael Grund <23025878+michaelgrund@users.noreply.github.com>
Co-authored-by: Michael Grund <23025878+michaelgrund@users.noreply.github.com>
Co-authored-by: Michael Grund <23025878+michaelgrund@users.noreply.github.com>
Co-authored-by: Michael Grund <23025878+michaelgrund@users.noreply.github.com>
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yohaimagen Nice work. The example now looks good to me.
Maybe we can change the title to "Calculating grid gradient and radiance". |
…imagen/pygmt into grdgradient_gallery_example
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Except the minor changes I suggested this PR looks good to me.
Co-authored-by: Michael Grund <23025878+michaelgrund@users.noreply.github.com> Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
Co-authored-by: Michael Grund <23025878+michaelgrund@users.noreply.github.com> Co-authored-by: Will Schlitzer <schlitzer90@gmail.com> Co-authored-by: Meghan Jones <meghanj@alum.mit.edu> Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
adding a gallery example of producing a hillshade map out of a Data Elevation Model with
pygmt.grdgradient
Preview at https://pygmt-git-fork-yohaimagen-grdgradientgalleryexample-gmt.vercel.app/gallery/images/grdgradient.html
Fixes #1425