Closed WPringle closed 3 years ago
So it looks like there's three general cases:
1) Uniform grid DEM with both axes featuring same grid spacings. 2) Varying grid spacings in x and y axes. 3) Varying grid spacings along the x/y axis itself potentially at the same time (this is the irregular case that did not work).
I'll test this this weekend and get back to you.
Yes, that's right.
I made a test (just modification of Example2) using the DEM used in the issue #203 and it seemed to fix that alignment using the updated varying grid spacings along the x/y axes.
Could you send me this test please?
Thinking about this logic, seems maybe a bit faulty.
if max(dx) ~= min(dx)
This also could be the case for dy.
I would make this
if max(dx) ~= min(dx) || max(dy) ~= min(dy)
True that's a good change
what I would like to see is a test in the tests
folder that demonstrates all three cases that I enumerated below work.
For example, generate a DEM from an analytical function and then build the mesh over and over again with finer solution and compare the interpolated bathymetry with the analytical function.
Given that this problem has now appeared three times, it's important this doesn't happen again.
fair enough, I can work on that.
Let me know if you need any help
Made a test using a subset of the CUDEM with different resolution types. Please check it out
Made sure test does not pass with the previous interpolation method.
Testing for irregular DEM grid in FindLinearIdx function in order tointerpolate properly using cell-averaged method for irregular DEM grid