Cross-cutting grids with grdview

Hi all,

If I have a relatively flat grid (e.g. grid1 is water table at depth z) and another grid which is inclined (eg. grid 2 is a fault), then the last grid to be plotted in perspective view will overprint the former grid for all values of X&Y for which grid2 has values.

If I’m viewing from a slightly elevated angle, shouldn’t I only see the parts of grid2 for which z is ABOVE grid1?

Thanks in advance

gmt begin test1
    gmt grdview water_table.nc -JX6i -JZ8c -Qs -p -V -Cmy_polar3.cpt -R264800/267500/4153800/4155600/-400/-200 -BSEnwZ -Bafg+l"UTM meters" -Bz25+l"m TVDSS" -t80
    gmt grdview fault3.nc -JX6i -JZ8c -I0.3 -Qs -p -V -Cmy_seis.cpt -BSEnwZ -Bafg+l"UTM meters" -Bz25+l"m TVDSS" -R264800/267500/4153800/4155600/-400/-200
gmt end show

No, you will only see the second grid (assuming it cover the same region).

Maybe you could try adding transparency to it (-t50) or using a mask.

Thanks, I was playing with transparencies a bit -notice my original code has a transparency on one of the grids- and although the transparency allows you to see the underlying grids, what I really wanted to do is HIDE parts of the grid when they go behind or under another grid. GMT plots things just fine but I’m trying to be cheeky and use it as a 3D package which I don’t think is what it was intended to do.

If the grids have the same region and resolution, it would be relatively easy to do this using grdmath by setting all values of grid2 < grid1 to NaN in order to get those values to be transparent. If the two grids do not have the same extent/spacing, you could still do this after resampling.