grdimage: Warning: No valid values in grid

Hi

When I apply grdgradient I got following error:
grdimage: Warning: No valid values in grid [algarve.nc]

My script is :

gmt xyz2grd south_pt.xyz -R-10.0/-8.0/36.0/38.0 -Gsw_pt.grd -I3s
gmt grdclip sw_pt.grd -R-9.1/-8.35/36.95/37.4 -Gsw_pt_clip.nc -Sb-4981/-3000 -V

ps=algarve.eps
GRID=sw_pt_clip.grd

gmtset PS_CHAR_ENCODING Symbol

makecpt -Crainbow -T-300/850/50 -Z > tmp.cpt

gmt grdgradient $GRID -A0/270 -Ne0.6 -Galgarve.nc

gmt grdimage $GRID -R-9.1/-8.35/36.95/37.4 -Ialgarve.nc -JM6i -Ctmp.cpt -B0.5 -P -K >> $ps

gmt pscoast -R-9.1/-8.35/36.95/37.4 -JM6i -Df -P -Ba -K -S -Ia10 -Na3 -W1/0 -Da -O >> $ps
open $ps

The details of each one of the grids that I have created are:
gmt grdinfo sw_pt.nc
sw_pt.nc: Title:
sw_pt.nc: Command: xyz2grd south_pt.xyz -R-10.0/-8.0/36.0/38.0 -Gsw_pt.nc -I3s
sw_pt.nc: Remark:
sw_pt.nc: Gridline node registration used [Geographic grid]
sw_pt.nc: Grid file format: nf = GMT netCDF format (32-bit float), COARDS, CF-1.5
sw_pt.nc: x_min: -10 x_max: -8 x_inc: 0.000833333333333 name: longitude [degrees_east] n_columns: 2401
sw_pt.nc: y_min: 36 y_max: 38 y_inc: 0.000833333333333 name: latitude [degrees_north] n_rows: 2401
sw_pt.nc: z_min: -4981 z_max: 825 name: z
sw_pt.nc: scale_factor: 1 add_offset: 0
sw_pt.nc: format: netCDF-4 chunk_size: 134,134 shuffle: on deflation_level: 3

grdinfo sw_pt_clip.nc
sw_pt_clip.nc: Title:
sw_pt_clip.nc: Command: grdclip sw_pt.nc -R-9.1/-8.35/36.95/37.4 -Gsw_pt_clip.nc -Sb-4981/-3000 -V
sw_pt_clip.nc: Remark:
sw_pt_clip.nc: Gridline node registration used [Geographic grid]
sw_pt_clip.nc: Grid file format: nf = GMT netCDF format (32-bit float), COARDS, CF-1.5
sw_pt_clip.nc: x_min: -9.1 x_max: -8.35 x_inc: 0.000833333333333 name: longitude [degrees_east] n_columns: 901
sw_pt_clip.nc: y_min: 36.95 y_max: 37.4 y_inc: 0.000833333333333 name: latitude [degrees_north] n_rows: 541
sw_pt_clip.nc: z_min: -280 z_max: 825 name: z
sw_pt_clip.nc: scale_factor: 1 add_offset: 0
sw_pt_clip.nc: format: netCDF-4 chunk_size: 129,136 shuffle: on deflation_level: 3

grdinfo algarve.nc
algarve.nc: Title: Produced by grdgradient
algarve.nc: Command: grdgradient sw_pt_clip.nc -A0/270 -Ne0.6 -Galgarve.nc
algarve.nc: Remark: Normalized directional derivative(s)
algarve.nc: Gridline node registration used [Geographic grid]
algarve.nc: Grid file format: nf = GMT netCDF format (32-bit float), COARDS, CF-1.5
algarve.nc: x_min: -9.1 x_max: -8.35 x_inc: 0.000833333333333 name: longitude [degrees_east] n_columns: 901
algarve.nc: y_min: 36.95 y_max: 37.4 y_inc: 0.000833333333333 name: latitude [degrees_north] n_rows: 541
algarve.nc: z_min: 0 z_max: 0 name: z
algarve.nc: scale_factor: 1 add_offset: 0
algarve.nc: format: netCDF-4 chunk_size: 129,136 shuffle: on deflation_level: 3

Note that with grdgradient z_min and z_max are 0.

On previous version of GMT script works perfectly.

Any hint of how to fix this problem.

Yours,
João Fontiela

This is wrong. See what z_min has become

sw_pt_clip.nc: z_min: -280 z_max: 825 name: z

Suggest you add -M to those grdinfo calls. I suspect your xyz2grd left lots of NaNs.

Yep, there is no ~80 m bathymetric grid for that region that I know. Some bits maybe but not all region.