UCL / pyCascadia

Implementation of GEBCO cookbook remove-restore and other cleaning of topography/bathymetry. Uses `pyGMT`.
Mozilla Public License 2.0
9 stars 0 forks source link

Remove-restore at high resolutions produces a discontinuity in the data #32

Closed JamieJQuinn closed 3 years ago

JamieJQuinn commented 3 years ago

Running remove-restore with a high resolution output produces a discontinuity along the boundary of the high resolution input data. This could be fixed by gridding the difference grid with the pygmt's surface, by filtering the grid using filter or by windowing using a window width proportional to the low resolution of the base grid.

alessandrofelder commented 3 years ago

Comment on this by @Devaraj-G :

[5] For smoothing the grid at boundaries: [a] Surface function with tension (https://docs.generic-mapping-tools.org/latest/surface.html) [b] Tapering at the boundaries (https://docs.generic-mapping-tools.org/latest/grdblend.html?highlight=taper) But only as a last resort, maybe adjusting tension parameter ~ 0.35 gives a good fit?

JamieJQuinn commented 3 years ago

@Devaraj-G My issue with naively applying surface to the difference grid is that it will change the base grid where there isn't any actual update data. This is because it must solve the tension eqn in the void between the edges of the update grid and the outer edges of the base grid. I presume you'd agree that integrating a high-resolution patch should only affect the area the patch covers.

That's just my issue with naively applying surface to a difference grid the size of the full base grid. We could apply surface only in a subsection of the full base grid (but larger than the update grid) to avoid adding false data beyond the update grid and still smooth the edges of the difference grid, but at that point, why not just taper/window the difference grid...?

alessandrofelder commented 3 years ago

Have either of you got suggestions for a good sample input data and parameters for testing (manually, visually, with --plot, in the first instance) that shows the boundary effect we are trying to get rid of here in the first place?

alessandrofelder commented 3 years ago

Testing this with remove-restore --base ../bath_data/GEBCO_2019_-157.0_62.0_-121.0_35.0.nc --spacing 300 --output test_out.nc ../bath_data/NOAA_South_VancouverIsland_30m.tif --region_of_interest -123 -122 48 49 --plot

JamieJQuinn commented 3 years ago

This was fixed in #46. Closing.