Skip to content
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

How-to guide for slope map of the moon #32

Merged
merged 2 commits into from
Jun 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions docs/gallery/images/slope.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
How to make a slope map
-----------------------

This tutorial show how to make a slope map of the moon from a geographic grid.

We utilize ``grdgradient`` to calculate the gradient magnitude (i.e., dz/dr).
Since we are working with geographic coordinates (longitude and latitude),
it is crucial to set the correct ellipsoid parameter (in this case, for the moon).
Finally, we convert this gradient to degrees with ``grdmath``.

.. gmtplot::

# Make a slope map of the moon.
# Calculate gradient magnitude
gmt grdgradient @moon_relief_15m -D -Sgradient.nc -fg --PROJ_ELLIPSOID=moon
# Convert gradient to degrees
gmt grdmath gradient.nc ATAND = moon_slope.nc
# Make map with colorbar
gmt begin moon png
gmt makecpt -Clajolla -T0/12 -I
gmt grdimage moon_slope.nc -JW15c -B0
gmt colorbar -DJRM+o0.5c/0c+w90%/0.5c+ef -Ba+l"Slope (@.)"
gmt end
# Delete temporal files
rm gradient.nc
10 changes: 10 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,16 @@ Symbols and markers
Images, contours, and fields
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. grid:: 2 3 3 4

.. grid-item-card:: :doc:`gallery/images/slope`
:padding: 1
:link-type: doc
:link: gallery/images/slope

.. image:: _images/6b12ba3c82f97e0841efb186eef0aa40.png


3d plots
~~~~~~~~

Expand Down