# Gravity map

**URL:** <https://forum.generic-mapping-tools.org/t/gravity-map/2211>\
**Category:** Q&A\
**Created:** [October 22, 2021, 12:14pm UTC](https://forum.generic-mapping-tools.org/t/gravity-map/2211 "2021-10-22T12:14:09Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shubha](https://avatars.discourse-cdn.com/v4/letter/s/e9a140/32.png) [@Shubha](https://forum.generic-mapping-tools.org/u/Shubha)\
**Post date:** [October 22, 2021, 12:14pm UTC](https://forum.generic-mapping-tools.org/t/gravity-map/2211/1 "2021-10-22T12:14:09Z")

</div>

I have long lat and data, I want to make gravity anomaly map ?

---

<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:** [October 22, 2021, 1:51pm UTC](https://forum.generic-mapping-tools.org/t/gravity-map/2211/2 "2021-10-22T13:51:41Z")

</div>

Hi Shubha!!

I see that you have a some doubts. I think you can find some help in the tutorial section (sections 3 and 4). I copy the links below.

[https://docs.generic-mapping-tools.org/latest/tutorial/session-3.html#gridding-of-arbitrarily-spaced-data](https://docs.generic-mapping-tools.org/latest/tutorial/session-3.html#gridding-of-arbitrarily-spaced-data).

> **[Session Four — GMT 6.2.0 documentation](https://docs.generic-mapping-tools.org/latest/tutorial/session-4.html)**

---

<div class="post-metadata">

**Author:** ![Shubha](https://avatars.discourse-cdn.com/v4/letter/s/e9a140/32.png) [@Shubha](https://forum.generic-mapping-tools.org/u/Shubha)\
**Post date:** [October 23, 2021, 9:18am UTC](https://forum.generic-mapping-tools.org/t/gravity-map/2211/3 "2021-10-23T09:18:39Z")

</div>

gmt psbasemap -R65/100/5/40 -JM4i -B5/5WSen -K -Y4 \>map.ps  
gmt xyz2grd gravity.xyz -Ix1/y1 -R65/100/5/40 -Goutput.gravity.nc  
grdimage gravity\_nn.nc -R -J -O -K -Cfinal.cpt \>\>map.ps  
gmt pscoast -R -J -O -K -Na \>\>map.ps  
psscale -D/-2/12/0.5h -B10::/:mgal: -Cfinal.cpt -O -K \>\> map.ps  
#pscolorbar -Dx1i/7i+w4i/0.5i+h -Cfinal.cpt -Ba -B+tcontinuous -I0.5  
This my script but I am not able to proceed further,

---

<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:** [October 25, 2021, 12:43am UTC](https://forum.generic-mapping-tools.org/t/gravity-map/2211/4 "2021-10-25T00:43:56Z")

</div>

If you actually are running -Ix1/y1 then that is wrong syntax. Should not be any x or y at all.  
Also looks like you are using GMT 4 syntax. While that is supported it is better if you stick to GMT 6 syntax (see your -B args).  
Your psscale seems to have a missing gmt and also a missing arg to -D. Again this is ancient syntax so better if you do this with GMT 6 syntax.

Once you fix this (and if the psscale is the last command then remove the -K for that command) you might be close.

---

<div class="post-metadata">

**Author:** ![Shubha](https://avatars.discourse-cdn.com/v4/letter/s/e9a140/32.png) [@Shubha](https://forum.generic-mapping-tools.org/u/Shubha)\
**Post date:** [October 25, 2021, 4:47am UTC](https://forum.generic-mapping-tools.org/t/gravity-map/2211/5 "2021-10-25T04:47:05Z")

</div>

actually, my gravity.xyz file is not responding. And, made the correction which you prescribed.

---

<div class="post-metadata">

**Author:** ![Shubha](https://avatars.discourse-cdn.com/v4/letter/s/e9a140/32.png) [@Shubha](https://forum.generic-mapping-tools.org/u/Shubha)\
**Post date:** [October 25, 2021, 4:58am UTC](https://forum.generic-mapping-tools.org/t/gravity-map/2211/6 "2021-10-25T04:58:47Z")

</div>

please help me.

---

<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:** [October 25, 2021, 6:16am UTC](https://forum.generic-mapping-tools.org/t/gravity-map/2211/7 "2021-10-25T06:16:03Z")

</div>

What does

`gmt info gravity.xyz`

return? Also, please paste in here the first 10 lines of that file as well.

---

<div class="post-metadata">

**Author:** ![Shubha](https://avatars.discourse-cdn.com/v4/letter/s/e9a140/32.png) [@Shubha](https://forum.generic-mapping-tools.org/u/Shubha)\
**Post date:** [October 25, 2021, 7:18am UTC](https://forum.generic-mapping-tools.org/t/gravity-map/2211/8 "2021-10-25T07:18:14Z")

</div>

[grav.txt](https://forum.generic-mapping-tools.org/uploads/short-url/ccBbWEpttjP9cD8SPZxM8FLndPf.txt) (1.9 KB)

 ![Screenshot (222)](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/2X/1/188439e597ab803b5bed3592e1a3023061979c0a.png)

I have attached data too.

---

<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:** [October 25, 2021, 7:52am UTC](https://forum.generic-mapping-tools.org/t/gravity-map/2211/9 "2021-10-25T07:52:55Z")

</div>

You are being too sloppy here. It was you who said the file was gravity.xyz but it cannot be found. So your xyz2grd command fails because of that as well as the next steps that depend on that output. You have a call to a nonexistent pscolormap module that messes things up.  
From the lines in grav.txt it seems your point spacing is 1 arc minutes, not 5. So pay attention to details.

---

<div class="post-metadata">

**Author:** ![Shubha](https://avatars.discourse-cdn.com/v4/letter/s/e9a140/32.png) [@Shubha](https://forum.generic-mapping-tools.org/u/Shubha)\
**Post date:** [October 25, 2021, 9:53am UTC](https://forum.generic-mapping-tools.org/t/gravity-map/2211/10 "2021-10-25T09:53:41Z")

</div>

Thank You, I resolve the problem.
