# Surimposed geophysical fields and topography

**URL:** <https://forum.generic-mapping-tools.org/t/surimposed-geophysical-fields-and-topography/401>\
**Category:** Q&A\
**Created:** [April 21, 2020, 6:07am UTC](https://forum.generic-mapping-tools.org/t/surimposed-geophysical-fields-and-topography/401 "2020-04-21T06:07:36Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![wbm06](https://avatars.discourse-cdn.com/v4/letter/w/34f0e0/32.png) [@wbm06](https://forum.generic-mapping-tools.org/u/wbm06)\
**Post date:** [April 21, 2020, 6:07am UTC](https://forum.generic-mapping-tools.org/t/surimposed-geophysical-fields-and-topography/401/1 "2020-04-21T06:07:36Z")

</div>

Dear all, I am using GMT5 and I am trying to get on the same figure LAB depth and surface topography. But I did not understand what I misunderstood or miss to get this figure. Any comments or suggestions.

Cheers

/bin/rm tmp.ps tmp.cpt

gmt makecpt -Crainbow -T40/300/50 -Z \>tmp.cpt

#### Make a basemap of central and southern Africa:

gmt psbasemap -R-1.5/50.5/-35.5/11.5 -JM14 -Ba2f1 -P -X2.0 -Y15 -K \>tmp.ps

#### Convert the xyz file into GRD file using xyz2grd

awk ‘{print $1, $2, $3}’ LAB.xyz | gmt xyz2grd -R -I0.5 -Gtmp.grd  
#gmt grdimage tmp.grd -JM -Ctmp.cpt -E50 -K -O \>\>tmp.ps

#### Resample tmp.grd from coarse (0.5 deg.) into finer resolution (0.1 degree) using grdsample.

# The output file is tmph.grd.

gmt grdsample tmp.grd -Gtmph.grd -I0.1

### Cut out the portion of elevation data from a global database

#### The output is topo0.grd

gmt grdcut etopo1\_bedrock\_africa.grd -Gtopo0.grd -R

### Resample it into the same interval as tmph.grd

grdsample topo0.grd -Gtopoh.grd -I0.1

#### Produce the gradient file. This time I usd -Nt to make a more dramatic shade

gmt grdgradient topoh.grd -Gtopoh.int -A45 -Nt

#### Produce the image using the resampled grd file and tmp.int

gmt grdimage tmph.grd -Itopoh.int -Ctmp.cpt -R -J -O -K \>\>tmp.ps

#### Overlay with coastlines and political boudnaries

gmt pscoast -R -JM -B2f2 -A1000 -W1 -N1 -D -P -V -K -O \>\> tmp.ps

#### Plot the scale bar at the bottom of the plot

gmt psscale -Ctmp.cpt -Dx8c/1c+w6c/0.5c+jTC+h -Bxaf+l"LAB " -By+lkm -K -O -Y-2.5 \>\> tmp.ps

---

<div class="post-metadata">

**Author:** ![Joaquim](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/joaquim/32/16_2.png) [@Joaquim](https://forum.generic-mapping-tools.org/u/Joaquim)\
**Post date:** [April 21, 2020, 10:51pm UTC](https://forum.generic-mapping-tools.org/t/surimposed-geophysical-fields-and-topography/401/2 "2020-04-21T22:51:48Z")

</div>

Sorry, but is the question exactly?

---

<div class="post-metadata">

**Author:** ![wbm06](https://avatars.discourse-cdn.com/v4/letter/w/34f0e0/32.png) [@wbm06](https://forum.generic-mapping-tools.org/u/wbm06)\
**Post date:** [April 21, 2020, 11:49pm UTC](https://forum.generic-mapping-tools.org/t/surimposed-geophysical-fields-and-topography/401/3 "2020-04-21T23:49:47Z")

</div>

Sorry, my question is how can we get topography in background and LAB depth or Moho depth on the top. The script I put here doesn’t work and I dont know why.

---

<div class="post-metadata">

**Author:** ![Esteban82](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/esteban82/32/54_2.png) [@Esteban82](https://forum.generic-mapping-tools.org/u/Esteban82)\
**Post date:** [April 21, 2020, 11:54pm UTC](https://forum.generic-mapping-tools.org/t/surimposed-geophysical-fields-and-topography/401/4 "2020-04-21T23:54:04Z")

</div>

Maybe you could add transparency (-t50) to the top grid.

---

<div class="post-metadata">

**Author:** ![wbm06](https://avatars.discourse-cdn.com/v4/letter/w/34f0e0/32.png) [@wbm06](https://forum.generic-mapping-tools.org/u/wbm06)\
**Post date:** [April 22, 2020, 12:46am UTC](https://forum.generic-mapping-tools.org/t/surimposed-geophysical-fields-and-topography/401/5 "2020-04-22T00:46:20Z")

</div>

> [@Esteban82](#):
>
> -t50

which line of the script?

---

<div class="post-metadata">

**Author:** ![Esteban82](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/esteban82/32/54_2.png) [@Esteban82](https://forum.generic-mapping-tools.org/u/Esteban82)\
**Post date:** [April 22, 2020, 12:49am UTC](https://forum.generic-mapping-tools.org/t/surimposed-geophysical-fields-and-topography/401/6 "2020-04-22T00:49:49Z")

</div>

> [@wbm06](#):
>
> gmt grdimage tmph.grd -Itopoh.int -Ctmp.cpt -R -J -O -K \>\>tmp.ps

In this line of the script.

---

<div class="post-metadata">

**Author:** ![wbm06](https://avatars.discourse-cdn.com/v4/letter/w/34f0e0/32.png) [@wbm06](https://forum.generic-mapping-tools.org/u/wbm06)\
**Post date:** [April 22, 2020, 1:24am UTC](https://forum.generic-mapping-tools.org/t/surimposed-geophysical-fields-and-topography/401/7 "2020-04-22T01:24:03Z")

</div>

> [@Esteban82](#):
>
> gmt grdimage tmph.grd -Itopoh.int -Ctmp.cpt -R -J -O -K \>\>tmp.ps

Thanks Esteban82. It seems that I have another problem. For mysterious reasons tmph.grd and topoh.grd are not the same size. 🤔
