From dd39358048359192ba3a02de89cb33a5c14f7110 Mon Sep 17 00:00:00 2001 From: Simon De Kock Date: Wed, 17 Jul 2024 18:15:00 +0200 Subject: [PATCH] Added proposals of Danielle in pull request #379 --- pysteps/blending/steps.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pysteps/blending/steps.py b/pysteps/blending/steps.py index 020066710..894841794 100644 --- a/pysteps/blending/steps.py +++ b/pysteps/blending/steps.py @@ -213,7 +213,8 @@ def forecast( (currently it is 1 km/min), None=no masking. smooth_radar_mask_range: int, Default is 0. If 0 this generates a normal forecast. To create a smooth mask, this range - should be a positive value. The smooth radar mask for the radar removes + should be a positive value, representing a buffer band of a number of pixels + by which the mask is cropped and smoothed. The smooth radar mask removes the hard edges between NWP and radar in the final blended product. probmatching_method: {'cdf','mean',None}, optional Method for matching the statistics of the forecast field with those of @@ -1469,8 +1470,8 @@ def worker(j): ) # Ensure mask values are between 0 and 1 - mask_model = new_mask - mask_radar = 1 - new_mask + mask_model = np.clip(new_mask, 0, 1) + mask_radar = np.clip(1 - new_mask, 0, 1) # Handle NaNs in R_f_new and R_f_new_mod_only by setting NaNs to 0 in the blending step R_f_new_mod_only_no_nan = np.nan_to_num(