fatiando / verde

Processing and gridding spatial data, machine-learning style
https://www.fatiando.org/verde
BSD 3-Clause "New" or "Revised" License
599 stars 72 forks source link

Merge overlapping grids #451

Open ckohnke opened 4 months ago

ckohnke commented 4 months ago

Description of the desired feature:

Grid stitching methods to handle grid discrepancies at overlapping grid points. This may already be possible with the tools in Verde and an example may be beneficial if it is.

Using airborne magnetic data as an example:

Are you willing to help implement and maintain this feature?

Potentially. I've been having trouble finding mathematical methods and processes to handle such situations.

leouieda commented 3 months ago

@ckohnke thanks for opening the issue! I have a few thoughts on this:

  1. For gravity and magnetics, I really don't like these stitching approaches because they can heavily bias the long wavelengths. For those, I'd rather go back to the original data and use a single equivalent source model to re-grid them all.
  2. You're right about there not being a good way to do this. For grids of other data types (topography, etc), maybe we could try to blend them in some way that only introduces distortions in the boundaries and doesn't propagate them to the whole grid. Or maybe warn users if there are a lot of discrepancies.
  3. GMT's grdblend does something like this already. It's not yet available in PyGMT. We could try to implement something similar to what it does using xarray. It doesn't seem like it would be too difficult to do.
leouieda commented 3 months ago

It would also be worth looking into what xarray has for merging datasets. Perhaps that could be enough and we don't have to implement it ourselves.