Hi!
I am having some problems trying to use grdimage (or plotting a DEM) using -JG.
In past versions of GMT I have used the “-p” option in grdimage to make perspective plots with an overlain grid on my basemap.
However, this time, in GMT 6.5, I am making a plot that is similar-ish to
this example (bottom one); so using the perspective projection “-JG” for a large slice of the planet.
Now, my script runs fine when I am just using ‘coast’ like the example shows
PROJ=-JG${longitude}/${latitude}/12c+z${altitude}+a${azimuth}+t${tilt}+w${twist}+v${Width}/${Height}
gmt basemap $PROJ -Rg -BESnw+gslategray -By10g5 -Ba20xg10
gmt coast $PROJ -By10g5 -Ba20xg10 -Glightbrown -Slightblue -W -Ia/blue -Di -Na -Rg
But when I try to switch ‘coast’ to a grid being displayed (specifically the DEM of Mars which is what need to be plotting):
gmt grdimage ./grids/mars_dem.tif -C’matlab/copper’ -t35 -I+a-45+nt0.5+m0
I get the following error:
grdimage [ERROR]: gmt_gdalread: Computed -srcwin falls outside raster size of 720x360 in the x-direction.
grdimage [ERROR]: ERROR reading file with gdalread.
grdimage (gmtapi_import_grid): Could not open file [./grids/mars_dem.tif]
[Session gmt (0)]: Error returned from GMT API: GMT_GRID_READ_ERROR (18)
By the way, when I add some points using gmt plot, it also works perfectly fine, it’s just the grdimage that gmt doesn’t like in this perspective mode.
The DEM/grid file is fine by the way, I plot it in the same subfigure just before for a global map using “-JN”, so the problem is the “-JG” projection or something else.
Happy to provide more detail/code/variables/images/data if and when needed.
Many thanks for any help in advance!