-
Notifications
You must be signed in to change notification settings - Fork 85
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
Correct use of NeighbourhoodProcessing #1893
Comments
Hi Enric, Apologies for the slow response, but we've had a long weekend here in the UK for Easter. You've hit upon an issue that we don't encounter because of the way we use IMPROVER, but it remains something that it would be nice to correct. The issueOur processing using IMPROVER always uses files that contain a single validity time, i.e. there is not a leading The
and then provide a cube with a lead-time of 5 hours (T+5). This function will calculate that the radius to use for neighbourhood processing should be 15000m, assuming a linear change in radius with lead-time. In the case where a cube is provided with multiple times, as in your example, this function will return multiple radii that correspond to each of the relevant lead-times. For example:
The plugin currently then assigns this to The immediate solutionThe immediate workaround for your case is to slice over the A variation on your own solution is this:
A better solutionThis issue ought to be resolved to allow the neighbourhood plugin to handle multiple times. I've created the following issue for this to be done, though it is not high-priority work for us. If you felt it was something you could do, we always welcome contributions, but otherwise it will be done at some unknown future date. I hope that's helpful and describes why you are seeing this issue. Let me know if you have any further questions, and if not, please close this issue. Regards, |
Hi Ben, No worries at all! We also had a long weekend here in Catalonia. Thank you very much for all your explanations and your rapid response, it was very helpful. It's clear now for me how to use the current Thank you again, Regards, |
Hello,
First of all, thank you for sharing this Python package, it's extremely useful! At the Meteorological Service of Catalonia we built a probability blending scheme based on Improver tools (neighbourhood, blending and calibration). Now, we're trying to simplify the code and I came across the
lead_times
parameter (I don't remember if it was available in previous versions) in the NeighbourhoodProcessing class. I have a doubt regarding how to properly use this class.where
When I call
square_nbhood.process(cube)
where cube is<iris 'Cube' of probability_of_precipitation_amount_above_threshold / (1) (time: 6; projection_y_coordinate: 688; projection_x_coordinate: 688)>
, I get the following error:If I call
square_nbhood.process(cube)
using:Everything seems fine. So my doubt is, the correct way to implement NeighbourhoodProcessing with multiple
lead_times
is the second one? Because, if I check the source code forBaseNeighbourhoodProcessing
(lines 389-395 of improver.improver.nbhood.nbhood.py) it already does the slicing I do before callingsquare_nbhood.process(cube)
, so I don't see why I have to previously slice the cube.I hope I've explained myself well, please let me know if I didn't. Thank you very much!
The text was updated successfully, but these errors were encountered: