# Gradient problem using earth\_relief\_03s

**URL:** <https://forum.generic-mapping-tools.org/t/gradient-problem-using-earth-relief-03s/787>\
**Category:** Q&A\
**Created:** [August 18, 2020, 10:27am UTC](https://forum.generic-mapping-tools.org/t/gradient-problem-using-earth-relief-03s/787 "2020-08-18T10:27:08Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sebastian](https://avatars.discourse-cdn.com/v4/letter/s/4da419/32.png) [@Sebastian](https://forum.generic-mapping-tools.org/u/Sebastian)\
**Post date:** [August 18, 2020, 10:27am UTC](https://forum.generic-mapping-tools.org/t/gradient-problem-using-earth-relief-03s/787/1 "2020-08-18T10:27:08Z")

</div>

Dear all,

I am trying to make the best of the time corona is giving me and therefore am building my own map of germany with the newly available earth reliefs. As long as I use a lower resolution than 15s everything works fine, but every time I try to use a higher resolution some problems with dimensions of the intensity grid in regard to the data grid arise.

To make my problem more comprehensible I created a minimum working example of my code:

- grdgradient @earth\_relief\_03s -Nt0.6 -A315 -Gearth\_relief\_03s\_int.nc -R5.6666/15.1666/47.1666/55.1666\*

- psbasemap -Bag1d -R5.6666/15.1666/47.1666/55.1666 -JM10/95c -X-0.2c -Y2c -P --PS\_MEDIA=Custom\_100cx135c -K -O \>\> resultingMap.ps \*

- psclip borderGermany.ASC -R5.6666/15.1666/47.1666/55.1666 -JM10/95c -K -O \>\> resultingMap.ps

- grdimage -V @earth\_relief\_03s -R5.6666/15.1666/47.1666/55.1666 -JM10/95c -Iearth\_relief\_15s\_int.nc -CWorld2.cpt -P -K -O \>\> resultingMap.ps\*

- psclip -C -K -O \>\> resultingMap.ps\*

- psxy borderGermany.ASC -R5.6666/15.1666/47.1666/55.1666 -JM10/95c -P -W1.2p -K -O \>\> resultingMap.ps\*

- psconvert -Tf -Vv resultingMap.ps\*

The resulting error throws the message:

**grdimage [ERROR]: Dimensions of intensity grid do not match that of the data grid!**  
**GMT: Module return with failure while executing the command**  
**grdimage -V @earth\_relief\_03s -R5.6666/15.1666/47.1666/55.1666 -JM10/95c -Iearth\_relief\_03s\_int.nc -CWorld2.cpt -P -K -O \>\> resultingMap.ps**

What is interesting about this problem ist, that the code runs without errors als long as the resolution is rougher than 15s. To be honest I am not able to comprehend why the resolution should be a problem. For convenience and to eliminate this point as possible error I already downloaded the higher resolutions for offline usage.

If somebody could please be so kind and give me hint what I have to change at my code to get it done I would be very thankful.

Best regards  
Sebastian

P.S.: Here is my border-file I use to clip the region.  
[borderGermany.zip](https://forum.generic-mapping-tools.org/uploads/short-url/ynQI8hPTJMuUPsc5WTtexjHT1Up.zip) (74.5 KB)

---

<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 18, 2020, 7:23pm UTC](https://forum.generic-mapping-tools.org/t/gradient-problem-using-earth-relief-03s/787/2 "2020-08-18T19:23:39Z")

</div>

Looks like we are getting round-off in different directions. The reason is your -R is not a nice multiple of 3 arc seconds so it has to be rounded to the nearest multiple somewhere, but maybe in different directions. Worked fine if I used **-R5.6625/15.16666666/47.1625/55.16666666** for instance.

---

<div class="post-metadata">

**Author:** ![Sebastian](https://avatars.discourse-cdn.com/v4/letter/s/4da419/32.png) [@Sebastian](https://forum.generic-mapping-tools.org/u/Sebastian)\
**Post date:** [August 18, 2020, 8:01pm UTC](https://forum.generic-mapping-tools.org/t/gradient-problem-using-earth-relief-03s/787/3 "2020-08-18T20:01:45Z")

</div>

Dear Mr. Wessel,

thank you very much for your support. Now it’s running just fine and the map is abolutely gorgeous.

Best regards  
Sebastian

---

<div class="post-metadata">

**Author:** ![Sebastian](https://avatars.discourse-cdn.com/v4/letter/s/4da419/32.png) [@Sebastian](https://forum.generic-mapping-tools.org/u/Sebastian)\
**Post date:** [August 18, 2020, 10:43pm UTC](https://forum.generic-mapping-tools.org/t/gradient-problem-using-earth-relief-03s/787/4 "2020-08-18T22:43:39Z")

</div>

Dear Mr Wessel,  
I’m writing again, because I recognized that even when taking care that the region is definied by a nice multiple of 1 arc seconds and even 3 arc seconds the problem arises again. I’ve played a litlle with the regions and as far as I can unterstand for example

> ‘-R7.4958/10.5041/47.4958/49.8333’

is a nice multiple of 1 and 3 arc seconds (based on what input earth relief is used) but nervertheless the following error message occurs (the whole output on the console is given in the attached txt  
[problem.zip](https://forum.generic-mapping-tools.org/uploads/short-url/2BRq8HhzL5h9m1z20ozY7ujSXh8.zip) (1.7 KB) ):

grdimage [ERROR]: Dimensions of intensity grid do not match that of the data grid!  
GMT: Module return with failure while executing the command  
grdimage -V @earth\_relief\_01s -R7.4958/10.5041/47.4958/49.8333 -JM9/45c -Iearth\_relief\_01s\_int.nc -CWorld2.cpt -P -K -O \>\> \>\> resultingMap.ps

Could you please tell me what I have to consider when choosing the regions? Something about my hypothesis that given region boarder must be an integer multiple of the used resolution of the earth relief seems to be not right. Thank you very much for your time.

Best regards  
Sebastian

---

<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 18, 2020, 10:56pm UTC](https://forum.generic-mapping-tools.org/t/gradient-problem-using-earth-relief-03s/787/5 "2020-08-18T22:56:26Z")

</div>

No quite. For example, 7.4958 = 7:29:44.88 but should be 7:29:45 to be a multiple of 1 or 3 arc secs. ROund-off and not enough decimals. Eaiest to use

-R7:29:45/10:30:15/… etc

---

<div class="post-metadata">

**Author:** ![Sebastian](https://avatars.discourse-cdn.com/v4/letter/s/4da419/32.png) [@Sebastian](https://forum.generic-mapping-tools.org/u/Sebastian)\
**Post date:** [August 18, 2020, 11:05pm UTC](https://forum.generic-mapping-tools.org/t/gradient-problem-using-earth-relief-03s/787/6 "2020-08-18T23:05:30Z")

</div>

Quite logical… I’m feeling a little bit stupid right now. 😃

Thank you for your support and to the whole team for such a great software.

---

<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 18, 2020, 11:44pm UTC](https://forum.generic-mapping-tools.org/t/gradient-problem-using-earth-relief-03s/787/7 "2020-08-18T23:44:50Z")

</div>

Your’welcome, and thanks for posting.

---

<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 31, 2020, 3:45am UTC](https://forum.generic-mapping-tools.org/t/gradient-problem-using-earth-relief-03s/787/8 "2020-08-31T03:45:50Z")

</div>

Master repo updated with fix so that your original -R should work again.
