Closed JamieJQuinn closed 3 years ago
Just for testing, there is a clear discontinuity when using:
remove-restore --base ../bath_data/GEBCO_2019_-157.0_62.0_-121.0_35.0.nc --spacing 0.001 --output test.nc ../bath_data/sample_data.tif --region_of_interest -123.3 -122.8 48.800 49.00 --plot
which is alleviated when adding the --window_width
flag with a value 10 times the output grid spacing:
remove-restore --base ../bath_data/GEBCO_2019_-157.0_62.0_-121.0_35.0.nc --spacing 0.001 --output test.nc ../bath_data/sample_data.tif --region_of_interest -123.3 -122.8 48.800 49.00 --window_width 0.05 --plot
The one test failure looks like a connectivity issue, I'm not worried...
Currently remove-restore applies a difference grid to the base grid directly. This presents an issue at the boundary of the difference grid (for example, where there is no high-resolution data in a region) and creates a discontinuity between high and low resolution regions (see #32). We have already tried:
surface
instead ofnearneighbour
however this introduces unacceptably large changes to the base grid far from the region being updated, regardless of tension parameter.The solution which appears to work well is windowing. A border of a certain width is created around the boundary of the difference grid and the data within that boundary smoothed. This softens the boundary between the difference grid and the base grid and removes the hard discontinuity.
The actual way in which this is implemented is as follows:
grdfilter
to create a window either side of the no-data boundary