Adjust -R based on new -I

If I run gmtinfo on a huge table, I can obtain my -R, e.g.:

$ gmt info bathymetry.asc -I1000 -R637000/650000/8223000/8238000

The -R will be used as input in e.g. xyz2grd, with the given (and compatible) -I.
If I now want to change my -I, I also need to adjust my -R.

Is there a smart way to get a new -R, without having to re-run gmtinfo for each choice of -I?

Example of the way I’m doing it now:

gmt info -I1000 [...]
gmt xyz2grd -I1000 [...]

2 hours later. No, this looks bad, let’s do it again with a new -I

gmt info -I2000 [...]
gmt xyz2grd -I2000 [...]

There must be a smarter way.

Maybe adding +r$new_res to -R would do the trick.

Nope; that only works with codes, -Rcode1,code2,…[+e|r|Rincs].

xyz2grd -I

All coordinates: The following modifiers are supported:

  • +e - Slightly adjust the max x (east) or y (north) to fit exactly the given increment if needed [Default is to slightly adjust the increment to fit the given domain].

?

Maybe, I’ll try.

This might be a non-issue really. As long as the region is a multiple of the increment, it doesn’t matter if the region is a little bit bigger than it needs to be.

Why it looks bad??

Too high resolution - voids in grid. But that’s another issue.

Maybe I’m complicating this.

What I’m trying to figure out, is if it’s an easy way to adjust a region (-R) by giving a new -I, without having to look at the table data again.

I don’t know. But I would think not.

xyz2grd itself simply converts a data set in table format to grid format. So it might be easier to create the grid and then adjust it (increase/decrease its resolution or adjust the region).

Yes, maybe. Thank you all.