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
Regridding with iris.analysis.UnstructuredNearest
does not preserve dtype
and masks
#4463
Comments
Hey @schlunma, Great to hear from you and thanks for taking the time to raise this issue 👍 Note that, if you're interested in regridding with unstructured grids, I'd highly recommend that you take a look at https://github.com/SciTools-incubator/iris-esmf-regrid We're actively developing this package in conjunction with our current UGRID work, and @stephenworsley (lead developer) would be super keen for feedback... He'd also be on hand to help you with using Note that, like all our regridders, it plums straight into It's also available on both |
Thanks for the quick answer @bjlittle!
|
No worries, glad to help. It's a great question, thanks for asking. The simple answer is no, not yet... It's that new! 😉 Although I'm sure @stephenworsley has plans in the pipeline. Why not create an issue on Perhaps @stephenworsley could provide you with some code examples in the meantime. What do you think @stephenworsley ? What's the best way for @schlunma to spin up and start playing ? 🤔 |
Rudimentary docs would be really useful for me too please and so I've created SciTools-incubator/iris-esmf-regrid#139 |
Note that, at the moment |
Thanks for opening the issue @jonseddon!
That sounds great for a start! I actually have a use case where area-weighted regridding from unstructured grids to lat/lon could come in handy 👍 |
So currently |
Also, I'm interested to know what you believe the correct handling of masks should be. Comments in the code suggest that the current handling is not correct: iris/lib/iris/analysis/trajectory.py Lines 413 to 415 in 3638874
Though I could think of different behaviours which could claim to be "more correct".
I would imagine that the first of these would be easier to implement, especially when additional dimensions are involved. It may also be more appropriate in certain cases, though I could imagine there may also be cases where the second case would be more appropriate. I'd have to do some more research into existing nearest neighbour regridders like ESMF to see which is "standard". |
Hmm...that's a tricky question. For me both options make sense, but I tend to agree more with option 1. From what I can tell from the code (filling the data before interpolation) I guess you are kind of using option 1 at the moment without applying a mask afterwards but just leaving the fill values as is, right? |
That appears to be right as far as I can tell, yes. |
🐛 Bug Report
Hi guys, I found two issues with regridding using
iris.analysis.UnstructuredNearest
:float64
.fill_value
.How To Reproduce
Minimal working example using this dataset (this is an
nc
file, but GitHub does not allownc
files): test.nc.txtTest dataset
gives
Expected behaviour
The
dtype
should be preserved, i.e., in the example bothdtypes
should befloat32
and the data should be masked correctly, i.e., it should look like this:Environment
I know that you are currently refactoring the support of unstructured grids. I'm not entirely sure if this also includes new regridders or not; if this is the case and you are in the middle of rewriting this regridder, please ignore this issue.
Thanks for your help 👍
The text was updated successfully, but these errors were encountered: