GMT in Windows

Hello, My name is Arthur and I am new on this platform.
It has been a while since i used GMT. I am aware a lot has changed since then.
I learnt GMT using the Windows environment. I am not well informed about other platforms. Recently, I resumed using GMT in windows using my old setup files i had saved. However, I faced some challenge which I hope i could acquire assistance from this forum. I had downloaded a grid file (DEM). The range extent of the grid is 25.0/39:59:30/-5.0/10.0. When i run the script below. I see that the grid doesnt effect the settings of the range i defined

I wrote the script below

@echo off
set psfile=maps.eps
set farbe=-Ccolour_table.cpt
set range=-R29.4/32/-0.3/5
set proj=-JM18

grdraster 1 %range% -Gtopo.grd -I0.5m -V
grdfilter topo.grd -Gfiltered.grd -D1 -Fc0.1 -V
grdgradient filtered.grd -A360 -Gtopo.shd -Nt0.5 -V
grdimage filtered.grd %farbe% -Itopo.shd %range% %proj% -X2.00 -Y5.0 -Ei -K -P -V > %psfile%

pscoast %range% %proj% -N1/2p/255,.- -X0.0 -Y0.0 -Bpa0.5f0.1 -Lf29.70/1.10/0.1/50k -Df -Ir/5/150/200/255 -C150/200/255 -O -K -V >> %psfile%

For a simple experiment you could do this:

  1. Remove the grdraster, grdfilter and grdgradient commands
  2. Let the grdimage command simply be

grdimage @earth_relief_30s %farbe% -I+nt0.5+a360 %range% %proj% -X2.00 -Y5.0 -Ei -K -P -V > %psfile%

You can experiment with a even higher resolution topography data by checking out the documentation.

Thanks for the response. I have removed the grdraster, grdfilter and grdgradient commands and it seemed to be running well but then i got the message
grdimage: Could not find file [+nt0.5+a360]

msg
I am not sure what went wrong

Well, yes … and nothing (the GMT paradox :slight_smile:)

There is nothing OS specific on GMT. Be it on Windows or the others, nothing changes in this regard.

Because you typed it, you left a space between -I and +nt0.5+a360

Hello,

I am sure i did not leave any space between -I and +nt0.5+a360 as you see in the code below. It still gives me the same error message. I placed the earth_relief_30s.grd file in the same directory with this batch file, could that have any effect or am i supposed to place them in some other directory? or it is with the settings of the environment. another question, when it is running, why does it take some time before it completes?

@echo off
SET GMTHOME=C:\programs\gmt6
SET HOME=C:\programs\gmt6
SET LIB=%LIB%;%GMTHOME%\LIB
SET PATH=%PATH%;%GMTHOME%\BIN;

set psfile=maps.eps
set farbe=-Ccolour_table.cpt
set range=-R29.4/32/-0.3/2.5
set proj=-JM18

grdimage earth_relief_30s.grd %farbe% -I+nt0.5+a360 %range% %proj% -X2.00 -Y5.0 -K -P -V > %psfile%

To keep it simple, just do -I+d for now (I may be wrong on the other syntax).
No need to place any data anywhere. GMT downloads in the background and assembles the grid needed. Takes some time first time but fast later.
Keep the name as given: @earth_relief_15s, always with the leading @. But to get a crude plot quickly try 06m instead.

Yes but thing is what is written in the post message and the other is what is actually run :slight_smile:

As Paul said, keep your example simple and without all those variables. This works fine for me and does more or less the same thing

grdimage @earth_relief_06m -I+nt0.5+a360 -R29.4/32/-0.3/2.5 -JM16 -png lixo

We are talking of which GMT version?

Thank you very much. I am getting a grasp of this version bit by bit. It is in fact better than the old versions. but I still have some issues. Like how to shift the make to positions i prefer. You can see that it is shifted to the bottom left, cutting part of the text. and there is alot of space above and right of it. I have looked around but failed to find a solution. Kindly assist.

set range=-R29.5/35/-1/4
set proj=-JM18
set farbe= -Cgraycolour_table.cpt

gmt begin maps eps
gmt grdcut @earth_relief_01m %range% -Gtopo_map.nc
gmt grdimage topo_map.nc %range% %proj% -I+d %farbe% -Ei --FONT_ANNOT_PRIMARY=9p
gmt pscoast %range% -N1/1.5p,.- -Ba0.5f0.5 -Df -Ir/5/150/200/255 -W0.5p -BWSen+tKibiro -S150/200/255 -Lg31/0.05+w100+f+u --FONT_ANNOT_PRIMARY=12p
gmt end show

Again, please don’t obfuscate the script with needless variables. Try this

gmt begin maps
	gmt grdimage @earth_relief_01m -R29.5/35/-1/4 -JM18 -I+d -Cgraycolour_table.cpt -Ei --FONT_ANNOT_PRIMARY=9p
	gmt pscoast -N1/1.5p,.- -Ba0.5f0.5 -Df -Ir/5/150/200/255 -W0.5p -BWSen+tKibiro -S150/200/255 -Lg31/0.05+w100+f+u --FONT_ANNOT_PRIMARY=12p
gmt end show

I think this is because you selected and eps format. If you use a raster format (like png), then the size of your final image is adjusted to the map (i.e. the white areas are cut).