Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better way to smooth bathymetry than "repeated interpolation"? #253

Open
glwagner opened this issue Nov 15, 2024 · 2 comments
Open

Better way to smooth bathymetry than "repeated interpolation"? #253

glwagner opened this issue Nov 15, 2024 · 2 comments
Labels
bathymetry ⛰️ When things aren't as smooth as expected enhancement New feature or request

Comments

@glwagner
Copy link
Member

glwagner commented Nov 15, 2024

Right now we rely on a sort of crude and uncontrolled method to smooth bathymetry, eg from the bathymetry generation example

h_rough = regrid_bathymetry(grid; interpolation_passes = 3)
h_smooth = regrid_bathymetry(grid; interpolation_passes = 40)

It doesn't really seem possible to predict what the effect of the "interpolation passes" is. Obviously more of them smooths, but how much do they smooth? How much do we need? Is there any way to understand what the net outcome is, regardless of the grid we are on?

I think this method was implemented not because it is a good method to use, but because it was convenient to simply "keep interpolating". Convenience isn't always the best motivation...

I think diffusion or a moving average might be a better way to smooth bathymetry. This would preserve the total ocean volume. Also, rather than specifying "number of passes" I feel like it would be more useful to be able to specify something like the "maximum gradient" or "maximum curvature" and iterate until that criterion is reached.

@glwagner glwagner added enhancement New feature or request bathymetry ⛰️ When things aren't as smooth as expected labels Nov 15, 2024
@NoraLoose
Copy link
Collaborator

I think diffusion or a moving average might be a better way to smooth bathymetry. This would preserve the total ocean volume. Also, rather than specifying "number of passes" I feel like it would be more useful to be able to specify something like the "maximum gradient" or "maximum curvature" and iterate until that criterion is reached.

That's basically what we do when we prepare the bathymetry for a ROMS simulation. We perform two consecutive steps, first a domain-wide smoothing (to avoid grid-scale instabilities) and then an iterative local smoothing until the maximum slope criterion is satisfied. For more details, see the ROMS-Tools documentation.

@NoraLoose
Copy link
Collaborator

The domain-wide smoothing step might be more relevant for a terrain-following coordinate (as in ROMS) than for a z-coordinate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bathymetry ⛰️ When things aren't as smooth as expected enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants