Translate grid

Is there an easy way of translating a grid with gmt, that doesnt involve dumping the grid as xyz and then manually adding/subtracting a distance to the coordinates? In my specific case I’m thinking about projected units, but geodetic as well, if possible.

As far as I know grdmath only operates on the attributes (e.g. z-value) og a grid; not the coordinates themselves.

Why? I want to take the topography of something ‘intuitive and known’ and superimpose on e.g. the abyssal plains of the ocean. Just to see what it looks like.

grdedit -R?

Thanks Joaquim.

Now I have my patch, but the grid region after grdcut and grdedit in my patch differs from my original grid which I intend to superimpose onto; how could I adjust my patch grid region to correspond to my original -R? Lot’s of NaN’s,of course.

$ gmt grdmath utm.nc patch.nc ADD = test.nc
grdmath [ERROR]: grid files not of same size!

You probably will need to resample one of them to match the other with grdsample, but I thought you were doing a drape with grdview.

Thanks, I’ll check grdsample. I did not intend to use grdview (but who knows).

Basically, what I’m trying to do is:

  • cut a patch (or copying really) from my original grid
  • move it 600 km north
  • add the patch’s z-values (topo/bathy) to the original grid
  • admire what your county would look like if it was 3000 meter below sea level. Or something like that.

Not sure how good this method is or what the results will be like, but you never know until you’ve tried.