Conversation
|
Changing the Dfsu default for track extraction to "inverse_distance" makes these tests fail: |
|
Changing the Dfsu default for point extraction from "contained" (=isel) to "nearest" does not make sense (we should maybe consider if it should even be allowed), and it is not easy to change it to "inverse_distance" as it is not directly supported for Dfsu2DH objects (that we use for .dfsu files), but only for mikeio.Datasets 🙄. So if we wanna change the default to inverse_distanc, we should first find nearest points, then interpolator and then multiply together and create a mikeio.Dataset. Maybe better if this functionality was in MIKE IO... We would need something like this (incomplete): |
|
I have already changed the spatial interp method of GridModelResult point extraction from "nearest" to "linear". It required changing 1 test and 1 notebook. It is less robust but at least consistent with track extraction now which also uses "linear". |
|
Remind me why we are doing our own interpolation instead of using https://docs.scipy.org/doc/scipy/reference/generated/scipy.interpolate.griddata.html for interpolation in unstructured grids. |
It can be hard to remember. It's been a long time since I implemented this in MIKE IO. But as far as I remember I struggled to find something efficient enough for multi-timestep situations (you don't to re-calculate the weights for every timestep). But there could probably be something out there which does a much better job! |
|
I have now implemented the inverse distance weighting for dfsu files too. Changing the default to inverse distance, gives these pytest fails: |
|
@ecomodeller , I will merge this at 10ish if you have no further comments |
Allow user to select spatial interp method when matching.
Not sure what the new argument should be called 🤔. My first idea was
spatial_interp_method, but it's long and when the choice is "contained" it doesn't seem like a good name. Maybespatial_methodis better? Orspatial_matching?Choosing good default is not easy. 😬
Before this PR the defaults were:
We need to clean this up before the release!
Proposed new spatial interpolation defaults:
Some problems/considerations: