Discussion:
getting intersection region of two grids
Eric Fielding
2014-07-06 01:11:32 UTC
Permalink
This may be a frequently asked question, but I looked for a while in the archives and did not find it. I have two grids with different spacings and regions that I want to combine, they only partially overlap. I was going to use grdresample or grdcut on one to match the other, but both grids include area outside of the other, so I can't just use grid A as the region to cut grid B nor grid B as the region to cut grid A. Is there a trick to do this? Or do I have to go in and calculate the intersection region by hand from grdinfo outputs?

Thanks,
++Eric

Mailing list for GMT discussions of all kinds. If you are not sure you have found a bug, discuss it here first.
To formally report bugs or request features, please register and add New Issue on gmt.soest.hawaii.edu
To unsubscribe, send the message "signoff gmt-help" to ***@lists.hawaii.edu
Note: gmt-help will become obsolete on Sept 1, 2014 - please use forum on gmt.soest.hawaii.edu instead.
Paul Wessel
2014-07-06 01:20:37 UTC
Permalink
If your objective is to determine the -Rw/e/s/n they have in comment then, yes, you would have to figure that out via grdinfo. This could be scripted if it was more than a one-time job.
If you want to blend the two grids then grdblend can do this (in GMT 5 it handles any resampling required).

-p
Post by Eric Fielding
This may be a frequently asked question, but I looked for a while in the archives and did not find it. I have two grids with different spacings and regions that I want to combine, they only partially overlap. I was going to use grdresample or grdcut on one to match the other, but both grids include area outside of the other, so I can't just use grid A as the region to cut grid B nor grid B as the region to cut grid A. Is there a trick to do this? Or do I have to go in and calculate the intersection region by hand from grdinfo outputs?
Thanks,
++Eric
Mailing list for GMT discussions of all kinds. If you are not sure you have found a bug, discuss it here first.
To formally report bugs or request features, please register and add New Issue on gmt.soest.hawaii.edu
Note: gmt-help will become obsolete on Sept 1, 2014 - please use forum on gmt.soest.hawaii.edu instead.
Mailing list for GMT discussions of all kinds. If you are not sure you have found a bug, discuss it here first.
To formally report bugs or request features, please register and add New Issue on gmt.soest.hawaii.edu
To unsubscribe, send the message "signoff gmt-help" to ***@lists.hawaii.edu
Note: gmt-help will become obsolete on Sept 1, 2014 - please use forum on gmt.soest.hawaii.edu instead.
Eric Fielding
2014-07-06 01:27:31 UTC
Permalink
Thanks for the fast reply! I am going to do grdmath on the two grids not blend them, so I will just manually calculate the -R region of the intersection of their limits.

Mailing list for GMT discussions of all kinds. If you are not sure you have found a bug, discuss it here first.
To formally report bugs or request features, please register and add New Issue on gmt.soest.hawaii.edu
To unsubscribe, send the message "signoff gmt-help" to ***@lists.hawaii.edu
Note: gmt-help will become obsolete on Sept 1, 2014 - please use forum on gmt.soest.hawaii.edu instead.
Loading...