Closed alessandrofelder closed 2 years ago
@dimitrasal prefers to guarantee the spacing at the expense of a slightly larger domain, when resampling happens.
Yes, that is correct. Documented in the grdsample docs as
-Ix_inc[+e|n][/y_inc[+e|n]] ... +e to 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].
Previously, the
grid.resample
function would not guarantee that the resampled grid had the exact user-specified spacing. This is becausegmt grdsample
would by default guarantee the specified region (and slightly adapt the spacing accordingly). This causedpyCascadia
problems down the line, specifically when using interpolation to calculate the difference grid, which relies on knowing the spacing.An alternative solution might be to store the spacing returned by
grdsample
in our grid class, and use that going forward. I will ask @dimitrasal for preferences.