Bug #700

grdimage a non-global grid data on a global basemap

Added by Dongdong over 2 years ago. Updated about 2 years ago.

Status:ClosedStart date:2015-04-27
Priority:NormalDue date:
Assignee:-% Done:


Target version:Candidate for next bugfix release
Affected version:4.x-svn Platform:


The data I use is not a global data, whose range is -R-100/100/-50/50:

$ grdinfo topo.nc 
topo.nc: Title: ETOPO5 global topography
topo.nc: Command: grdraster -R-100/100/-50/50 1 -Gabc.nc
topo.nc: Remark: /opt/GMT-4.5.13/share/dbase/etopo5.i2
topo.nc: Gridline node registration used
topo.nc: Grid file format: nf (# 18) GMT netCDF format (float)  (COARDS-compliant) [DEFAULT] 
topo.nc: x_min: -100 x_max: 100 x_inc: 0.0833333333333 name: longitude [degrees_east] nx: 2401
topo.nc: y_min: -50 y_max: 50 y_inc: 0.0833333333333 name: latitude [degrees_north] ny: 1201
topo.nc: z_min: -8103 z_max: 7833 name: m
topo.nc: scale_factor: 1 add_offset: 0

I want to plot this non-global data on a global basemap with -R-180/180/-90/90, so I use commands below:

$ grd2cpt topo.nc -Crelief > mytopo.cpt
$ grdimage topo.nc -R-180/180/-90/90 -JX10c -B30 -Cmytopo.cpt -V > test.ps  
grdimage: Allocates memory and read data file
GMT_grd_is_global: no!

The grdimage command just reports GMT_grd_is_global: no! and stops.

If the -R180/180/-90/90 in grdimage is slightly modified to something like -R-170/180/-90/-90 or -R-179.9999/180/-90/90, it works well. But this is not exactly what I want, the basemap is not exactly global.

I have tested four versions of GMT under Linux 64 bits, using nearly the same commands:

1. GMT-4.5.13: fail;
2. GMT4-dev: fail;
3. GMT-5.1.1: succeed;
4. GMT5-dev: succeed;

So it seems to be a bug of grdimage in GMT4, not in GMT5.


#1 Updated by Paul over 2 years ago

  • Status changed from New to Resolved

Should be fixed in r10307.

#2 Updated by Paul about 2 years ago

  • Status changed from Resolved to Closed

Closing this guy.

Also available in: Atom PDF