grdimage issue while plotting NaN's

Added by Harsha 10 months ago

Hi all,
I'm trying to plot the swath of a multibeam survey line. My input is an xyz file containing all the points from that survey line. I've converted the xyz to a grid using surface command and I'm plotting the grid using grdimage. I'm using grdimage with -Q option which should make z=NaN's transparent. But grdimage is plotting even the NaN's. I'm using the following gmt commands. Can you please tell me where am I going wrong?

%input xyz file is

%generating evenly spaced xyz data using blockmedian
blockmedian -R158/159/32/33 -I150e >

%generating a grid and replacing points with nodata with NaN's using -do option
surface -R158/159/32/33 -I150e -do -Gline1.grd -T0.25 -V

%generating cpt file for the grid
makecpt -Csealand -T-6000/1000/10 > bathy.cpt

%generating illumination data
grdgradient line1.grd -Nt1 -A45 -Gline_il.grd

%generating the multibeam swath plot
grdimage line1.grd -Iline_il.grd -JM7i -Q -R158/159/32/33 -Cbathy.cpt -V >


Replies (1)

RE: grdimage issue while plotting NaN's - Added by Paul 10 months ago

Well, you have no NaNs in your grid. Surface fills in every node. You will need to make a mask using your blockmedian with grdmask and multiply that mask with your grid. Now you will have NaNs and grdimage will skip them.