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

Infinite cutoff extrapolation can return NaN values if crop=True #366

Open
robbibt opened this issue Nov 26, 2024 · 1 comment
Open

Infinite cutoff extrapolation can return NaN values if crop=True #366

robbibt opened this issue Nov 26, 2024 · 1 comment

Comments

@robbibt
Copy link
Contributor

robbibt commented Nov 26, 2024

For our Australian applications, we often run our modelling with both extrapolate=True and cutoff=np.inf to ensure we get at least some modelled tides for areas just outside the modelling domain (even if they're less accurate). I've recently started running code using crop=True, as it makes a huge difference to run-times. However, I've noticed that I'm now getting many NaN values in areas where we used to get modelled tides.

I'm pretty sure this is because the cropping step is resulting in no valid consituent data within the clipped analysis extent, so there's no data to actually extrapolate. I'm not sure there's really a good solution to this - when using cropped model files, there's no way to access data outside the clipped extent without loading it into memory (which defeats the purpose of crop=True). I think there could be two ways to make this a bit less unexpected:

  1. Raise a warning if crop=True and extrapolate=True, yet no data is availble to extrapolate. This would at least give the user a heads-up that extrapolation is not performing as expected
  2. Expose the buffer used under-the-hood as a configurable parameter, allowing users to select a larger buffer as required to reduce the impact of cropping on extrapolated results. I've raised a separate issue for this one, as I think it would be a handy feature even beyond this specific issue: Allow cropping "buffer" as a customisable parameter #367
@tsutterley
Copy link
Owner

Hey @robbibt, I think option 2 will work really well. I'll start putting that together.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants