Strange problem with grdimage

After re-installing succesfully MB-System, I got strange figures when using grdiamge.

I explain. I used GMT 6.4 and an old version of MB-System. So I decided to re-installe MB-System using the instructions given by them. Because I used Ubuntu 20.4 they are:
sudo apt upgrade

sudo apt install build-essential

sudo apt install gmt libgmt5 libgmt-dev gmt-common
proj-bin proj-data libproj-dev libgdal-dev
libfftw3-3 libfftw3-dev libmotif-dev
xfonts-100dpi libglu1-mesa-dev gfortran

After that I ran a script containing grdimage and the result was an empty map.

Just to be sure I decided to run Tutorial Example 15:

####################
gmt begin GMT_tut_15
    gmt set GMT_THEME cookbook
    gmt makecpt -Crainbow -T1000/5000
    gmt grdimage @earth_relief_30s -R-108/-103/35/40 -JM6i -B -BWSnE
    gmt colorbar -DJTC -I0.4 -Bxa -By+lm
gmt end show
####################

I attach the figure to let you what I mean.

Please, any help will be very much appreciated.

Juan
GMT_tut_15.pdf (127.1 KB)

Hello. I suspect there might be an issue with the @earth_relief_30s grid. Could you try using @earth_relief_06m instead and see if the problem persists?

Dear Esteban,

Indeed. You were absoutely right.

The region selected (-R-108/-103/35/40) encompass 2 files:

  • N30W105.earth* _relief_30s_p.nc
  • N30W120.earth_relief_30s_p.nc

Using grdinfo I checked their contents and I discovered that:

  • N30W105.earth_relief_30s_p.nc is OK
  • N30W120.earth_relief_30s_p.nc has only 0 values, so it is spoiled and should be repaired.

See below the output of grdinfo.

Regarding the previous script, the one it was the cause for testing grdimage with something easy as GMT_tut_15, now is running. Very strange. I guess it could have been a lack of RAM, because if I remeber well I was working with my notebook several days without shutting down. And now I had to start up the notebook, because it went down due to lack of battery, so now RAM was “fresh”. Maybe it could be the explanation for crushing before and running now. Maybe…

In any case, Esteban, thank you very much indeed for your help

Bets regards

Juan Diaz-Naveas

N30W105.earth_relief_30s_p.nc: Title: Produced by grdconvert
N30W105.earth_relief_30s_p.nc: Command:
N30W105.earth_relief_30s_p.nc: Remark:
N30W105.earth_relief_30s_p.nc: Pixel node registration used [Geographic grid]
N30W105.earth_relief_30s_p.nc: Grid file format: ns = GMT netCDF format (16-bit integer), CF-1.7
N30W105.earth_relief_30s_p.nc: x_min: -105 x_max: -90 x_inc: 0.00833333333333 (30 sec) name: longitude n_columns: 1800
N30W105.earth_relief_30s_p.nc: y_min: 30 y_max: 45 y_inc: 0.00833333333333 (30 sec) name: latitude n_rows: 1800
N30W105.earth_relief_30s_p.nc: v_min: -11.5 v_max: 3883 name: z
N30W105.earth_relief_30s_p.nc: scale_factor: 0.5 add_offset: 0 packed z-range: [-23,7766]
N30W105.earth_relief_30s_p.nc: format: netCDF-4 chunk_size: 129,129 shuffle: on deflation_level: 9
N30W105.earth_relief_30s_p.nc: Default CPT: geo

N30W120.earth_relief_30s_p.nc: Title: Produced by grdconvert
N30W120.earth_relief_30s_p.nc: Command:
N30W120.earth_relief_30s_p.nc: Remark:
N30W120.earth_relief_30s_p.nc: Pixel node registration used [Geographic grid]
N30W120.earth_relief_30s_p.nc: Grid file format: ns = GMT netCDF format (16-bit integer), CF-1.7
N30W120.earth_relief_30s_p.nc: x_min: -120 x_max: -105 x_inc: 0.00833333333333 (30 sec) name: longitude n_columns: 1800
N30W120.earth_relief_30s_p.nc: y_min: 30 y_max: 45 y_inc: 0.00833333333333 (30 sec) name: latitude n_rows: 1800
N30W120.earth_relief_30s_p.nc: v_min: 0 v_max: 0 name: z
N30W120.earth_relief_30s_p.nc: scale_factor: 0.5 add_offset: 0 packed z-range: [0,0]
N30W120.earth_relief_30s_p.nc: format: netCDF-4 chunk_size: 129,129 shuffle: on deflation_level: 9
N30W120.earth_relief_30s_p.nc: Default CPT: geo

Hi JDN.

The most common cause in these cases is a problem during the download of N30W120.earth_relief_30s_p.nc.

I would suggest deleting that file from your local GMT cache so it gets downloaded again cleanly, and then rerunning the script.

Dear Esteban,

Again, you were right.

I deleted my local file N30W120.earth_relief_30s_p.nc, then I rerun the script and everything went smooth.

Thanks a lot

Juan Diaz-Naveas