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

NaN bathy value sneaking in when bottom right corner of mesh is just outside the bbox #142

Open
HamishB opened this issue Nov 23, 2020 · 2 comments
Labels
bug Something isn't working enhancement New feature or request

Comments

@HamishB
Copy link

HamishB commented Nov 23, 2020

Hi,

around half the time I run m = interp(m, gdat); on a high res. inset mesh I get NaNs sneaking into m.b. Sometimes even two of them. This happens at nodes which end up just ever so slightly outside the bbox, even though there is valid elevation data in the gdat DEM well beyond the given bbox. If the (possibly massive) DEM is being clipped to the bbox, perhaps a small buffer area could be added to the clipping box? e.g. 1% of the width or height of the bbox or an extra row/column or two of the DEM grid.

(often the bottom right corner, but not always)

dumb work-around: just re-run mshopts.build.grd until sum(isnan(m.b)) == 0.

thanks,
Hamish

@krober10nd krober10nd added bug Something isn't working enhancement New feature or request labels Nov 23, 2020
@krober10nd
Copy link
Collaborator

Yes, we only read in the portion of the domain that intersects with the bbox. A buffer is a good idea when reading the DEM.

@krober10nd
Copy link
Collaborator

krober10nd commented Nov 23, 2020

Also, just a commentary I wouldn't interpolate from the gdat object. I would interpolate from the original DEM at the DEM's native resolution.

The idea being that the gdat may downsample the DEM to match the minimum mesh resolution depending on available memory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants