You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add resample distributions function for probability matching (#390)
* feat: first attempt to add resample distributions function for probability matching
* fix: remove erroneous import
* feat: add resampling option to probability matching step
* fix: make sure there are no nans in the resampling function
* fix: fill up space outside radar domain with model data and change function names
* docs: add info about the weights
* fix: add requested changes from review
* fix: add tests and make sure probability stays within bounds
* Better docstrings
* Minor code improvements
* Add test
* Run black
* Handle nans outside of resampling method
---------
Co-authored-by: Daniele Nerini <daniele.nerini@gmail.com>
Method for matching the statistics of the forecast field with those of
211
+
the most recently observed one. 'cdf'=map the forecast CDF to the observed
212
+
one, 'mean'=adjust only the conditional mean value of the forecast field
213
+
in precipitation areas, None=no matching applied. Using 'mean' requires
214
+
that mask_method is not None.
208
215
mask_method: {'obs','incremental',None}, optional
209
216
The method to use for masking no precipitation areas in the forecast field.
210
217
The masked pixels are set to the minimum value of the observations.
211
218
'obs' = apply precip_thr to the most recently observed precipitation intensity
212
219
field, 'incremental' = iteratively buffer the mask with a certain rate
213
220
(currently it is 1 km/min), None=no masking.
221
+
resample_distribution: bool, optional
222
+
Method to resample the distribution from the extrapolation and NWP cascade as input
223
+
for the probability matching. Not resampling these distributions may lead to losing
224
+
some extremes when the weight of both the extrapolation and NWP cascade is similar.
225
+
Defaults to True.
214
226
smooth_radar_mask_range: int, Default is 0.
215
227
Method to smooth the transition between the radar-NWP-noise blend and the NWP-noise
216
228
blend near the edge of the radar domain (radar mask), where the radar data is either
217
-
not present anymore or is not reliable. If set to 0 (grid cells), this generates a normal forecast without smoothing. To create a smooth mask, this range
218
-
should be a positive value, representing a buffer band of a number of pixels
219
-
by which the mask is cropped and smoothed. The smooth radar mask removes
220
-
the hard edges between NWP and radar in the final blended product. Typically, a value between 50 and 100 km can be used. 80 km generally gives good results.
0 commit comments