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

fix: change extrapolation values for resampling outside radar domain to zero #419

Closed
wants to merge 1 commit into from

Conversation

RubenImhoff
Copy link
Contributor

Fix for issue #416.

The small fix introduced here, which sets all extrapolation component values to zero outside the radar domain (instead of to the NWP value as in the code now), gives the following results for the case indicated in #390:

Radar observations (up to 60 minutes ahead):
radar_observations

Blended forecast for ensemble member 0, without the smoothing mask as introduced in #379:
forecast_withoutsmoothing

Blended forecast for ensemble member 0, with the smoothing mask:
forecast_with_smoothing

See also #390 for the previous results. The first lead time is still not perfect, but we got a lot closer already. What do you think?

Copy link

codecov bot commented Aug 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.88%. Comparing base (917c83b) to head (56817b3).
Report is 4 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #419   +/-   ##
=======================================
  Coverage   83.88%   83.88%           
=======================================
  Files         160      160           
  Lines       12780    12780           
=======================================
  Hits        10720    10720           
  Misses       2060     2060           
Flag Coverage Δ
unit_tests 83.88% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@RubenImhoff RubenImhoff requested review from dnerini, ladc and aitaten August 9, 2024 10:56
@RubenImhoff
Copy link
Contributor Author

@ladc, what are your thoughts here?

@RubenImhoff RubenImhoff self-assigned this Aug 20, 2024
@RubenImhoff RubenImhoff marked this pull request as ready for review August 20, 2024 08:24
@ladc
Copy link
Contributor

ladc commented Aug 21, 2024

I also tried to fix this issue in the commit c7b7e0c (when addressing issue #370) but in a more complicated way. I changed the resampling to allow nan values in one of the arrays, and disregard the corresponding pixels in the resampling procedure. The results are different for the control member, but I cannot see a difference for a random member. Here's the animation comparing 447260c (first, Ruben's fix applied to my control member branch) and 7ef8a32 (last, my control member branch with modifications to resample_distributions and nonparam_match_empirical_cdf to allow nans).
In figure 1, there's a reduction in intensity in the control member for timestep 1 (maybe due to the explicit addition of zeroes in the resampling?) which is not present in figure 2, and I prefer the latter. I'm going to go through my code again to check if I haven't made any errors.

control_ens_mean_obs_447260c
control_ens_mean_obs_7ef8a32

@RubenImhoff
Copy link
Contributor Author

@ladc, I agree that your implementation would even be cleaner. If you're confident about it, could you push those resampling changes to this branch?

@ladc
Copy link
Contributor

ladc commented Aug 23, 2024

Hi everyone,
Sorry for the delay and the proliferation of branches. I've pushed my code with a ton of tests and you can find the result in the corresponding pull request #428

@dnerini
Copy link
Member

dnerini commented Aug 26, 2024

Are we closing this in favour of #428?

@ladc
Copy link
Contributor

ladc commented Aug 26, 2024

That's OK for me.

@ladc ladc closed this Aug 26, 2024
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

Successfully merging this pull request may close these issues.

3 participants