# How to draw a topographic map of the moon in GMT

**URL:** <https://forum.generic-mapping-tools.org/t/how-to-draw-a-topographic-map-of-the-moon-in-gmt/770>\
**Category:** Q&A\
**Created:** [August 13, 2020, 9:31am UTC](https://forum.generic-mapping-tools.org/t/how-to-draw-a-topographic-map-of-the-moon-in-gmt/770 "2020-08-13T09:31:54Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![brightness0906](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/brightness0906/32/499_2.png) [@brightness0906](https://forum.generic-mapping-tools.org/u/brightness0906)\
**Post date:** [August 13, 2020, 9:31am UTC](https://forum.generic-mapping-tools.org/t/how-to-draw-a-topographic-map-of-the-moon-in-gmt/770/1 "2020-08-13T09:31:54Z")

</div>

hi,

I am studying GMT software recently, and my recent studies are all about cartography on the earth. I want to know how to use GMT to get some topographic maps and elevation maps of the moon, like the following:

 ![1](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/1X/73b96cd1e53806f706ea84dccca656f312c9d604.jpeg)

I don’t know how to change the default background of GMT from Earth to Moon.  
Looking forward to your reply.

bright

---

<div class="post-metadata">

**Author:** ![pwessel](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/pwessel/32/30_2.png) [@pwessel](https://forum.generic-mapping-tools.org/u/pwessel)\
**Post date:** [August 13, 2020, 6:49pm UTC](https://forum.generic-mapping-tools.org/t/how-to-draw-a-topographic-map-of-the-moon-in-gmt/770/2 "2020-08-13T18:49:18Z")

</div>

While we have a pending NASA proposal to also supply planetary DEMs, we do not at the moment. You can download moon DEMS and plot them in GMT just like you would any other grid. Using --PROJ\_ELLIPSOID= **Moon** will be helpful as well.

---

<div class="post-metadata">

**Author:** ![brightness0906](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/brightness0906/32/499_2.png) [@brightness0906](https://forum.generic-mapping-tools.org/u/brightness0906)\
**Post date:** [August 14, 2020, 1:14am UTC](https://forum.generic-mapping-tools.org/t/how-to-draw-a-topographic-map-of-the-moon-in-gmt/770/4 "2020-08-14T01:14:00Z")

</div>

Hi

Thanks for your reply.I don’t know how to use GMT very well，so I have two doubts. I hope you can help me.

The first question is what kind of data format GMT supports and how can I read it? The second problem is about "- proj\_ Is ellipsoid = moon ".This is to change the default ellipsoid of GMT, I just need to enter “GMT set proj”\_ Is the ellipsoid = moon "command OK? Do I have to do this when I deal with lunar elevation data?

Looking for your reply  
bright

---

<div class="post-metadata">

**Author:** ![pwessel](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/pwessel/32/30_2.png) [@pwessel](https://forum.generic-mapping-tools.org/u/pwessel)\
**Post date:** [August 14, 2020, 1:50am UTC](https://forum.generic-mapping-tools.org/t/how-to-draw-a-topographic-map-of-the-moon-in-gmt/770/5 "2020-08-14T01:50:08Z")

</div>

GMT can read any grid almost, sine we use GDAL for things we dont support natively. Usually, such data might come in a ndfCDRT file or a Geotiff.  
In your script you could type  
gmt set PROJ\_ELLIPSOID moon  
to change the default.

---

<div class="post-metadata">

**Author:** ![brightness0906](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/brightness0906/32/499_2.png) [@brightness0906](https://forum.generic-mapping-tools.org/u/brightness0906)\
**Post date:** [August 14, 2020, 12:21pm UTC](https://forum.generic-mapping-tools.org/t/how-to-draw-a-topographic-map-of-the-moon-in-gmt/770/7 "2020-08-14T12:21:44Z")

</div>

Hi

I downloaded the DEM of the polar regions of the moon, in tif format.The website is"  
[https://astropedia.astrogeology.usgs.gov/download/Moon/LRO/LOLA/ancillary/LRO\_LOLA\_DEM\_NPolar875\_10m.tif](https://astropedia.astrogeology.usgs.gov/download/Moon/LRO/LOLA/ancillary/LRO_LOLA_DEM_NPolar875_10m.tif)"

When I run the command"  
gmt grdimage E:\Mars\LRO\_LOLA\_DEM\_NPolar875\_10m.tif -R-180/180/87.5/90 -JA0/90/12c -Baf"  
The result is“psconvert [ERROR]: Unable to decode BoundingBox file C:/Users/brightness/.gmt/sessions/gmt\_session.5160/psconvert\_15052c.bb (maybe no non-white features were plotted?) ”

The file cannot be used directly for drawing, how should I adjust the data?

Looking for your reply

---

<div class="post-metadata">

**Author:** ![pwessel](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/pwessel/32/30_2.png) [@pwessel](https://forum.generic-mapping-tools.org/u/pwessel)\
**Post date:** [August 14, 2020, 6:37pm UTC](https://forum.generic-mapping-tools.org/t/how-to-draw-a-topographic-map-of-the-moon-in-gmt/770/8 "2020-08-14T18:37:35Z")

</div>

If you run gmt grdinfo on that file you will see it is not geographic but probably projected coordinates for a polar projection. You cannot use -JA on a Cartesian file. You should look for a file with longitude,latitudes; I know that exists.

---

<div class="post-metadata">

**Author:** ![brightness0906](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/brightness0906/32/499_2.png) [@brightness0906](https://forum.generic-mapping-tools.org/u/brightness0906)\
**Post date:** [August 15, 2020, 1:54am UTC](https://forum.generic-mapping-tools.org/t/how-to-draw-a-topographic-map-of-the-moon-in-gmt/770/9 "2020-08-15T01:54:44Z")

</div>

Thanks，

It is indeed a Cartesian coordinate system, not a geographic coordinate system.How can I convert the data to a geographic coordinate system? You said “look for a file with longitude,latitudes”，I am not sure what this document refers to? Can you guide me further？I really appreciate your help

Looking for your reply

---

<div class="post-metadata">

**Author:** ![timhume](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/timhume/32/296_2.png) [@timhume](https://forum.generic-mapping-tools.org/u/timhume)\
**Post date:** [August 29, 2020, 11:06pm UTC](https://forum.generic-mapping-tools.org/t/how-to-draw-a-topographic-map-of-the-moon-in-gmt/770/10 "2020-08-29T23:06:49Z")

</div>

Hi,

Plotting maps of other planets is cool. Here’s a script to do it (sorry if the formatting is a bit messed up). Hack it to your heart’s content 😃 I cannot remember where I found the data file; search for the file name of the GeoTiff file.

```
#!/usr/bin/env bash
#
# Plot lunar map
#

#
# Convert the GeoTiff file to geographical NetCDF file. Then convert it to a coarser resolution for plottting.
#
if [[! -e moon.grd]]
then
        gmt grdproject Lunar_LRO_LOLA_Global_LDEM_118m_Mar2014.tif -Gmoon.grd \
                -I -JQ0/0/10916406.15 -C -Rd -V
fi

if [[! -e coarsemoon.grd]]
then
        gmt grdsample moon.grd -Gcoarsemoon.grd -I0.5/.05 -Rd
fi

gmt begin map pdf,png A+m1c
        gmt gmtset FONT_ANNOT_PRIMARY 10p,Helvetica,black
        gmt gmtset FONT_LABEL 14p,Helvetica,black
        gmt gmtset FONT_TITLE 18p,Helvetica,black
        gmt gmtset FORMAT_GEO_MAP dddF
        gmt gmtset MAP_ANNOT_OBLIQUE 15
        gmt gmtset MAP_ANNOT_OBLIQUE 15
        gmt gmtset PROJ_ELLIPSOID moon
        gmt gmtset PROJ_LENGTH_UNIT c

        gmt grdimage coarsemoon.grd -Cbathy -JR30 -Rd -B+t"Lunar Topography" \
        -Bpxyf10a30g30 -Q -I+d
        gmt plot -Wthick,red <<- END
        -90 0
        0 90
        90 0
        0 -90
        -90 0
        END
  gmt colorbar -DJBC+w15/0.25+h -Bpxf500a2000 \
    -Bpx+l"Elevation (m)"
gmt end

```

 ![map](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/1X/f65a4b2b5239ea8109ffda12052e227760d393b5.png)
