5656from pysteps .nowcasts import utils as nowcast_utils
5757from pysteps .postprocessing import probmatching
5858from pysteps .timeseries import autoregression , correlation
59+ from pysteps .utils .check_norain import check_norain
5960
6061try :
6162 import dask
@@ -77,7 +78,7 @@ class StepsBlendingConfig:
7778 precip_threshold: float, optional
7879 Specifies the threshold value for minimum observable precipitation
7980 intensity. Required if mask_method is not None or conditional is True.
80- norain_threshold: float, optional
81+ norain_threshold: float
8182 Specifies the threshold value for the fraction of rainy (see above) pixels
8283 in the radar rainfall field below which we consider there to be no rain.
8384 Depends on the amount of clutter typically present.
@@ -435,7 +436,6 @@ def __init__(
435436
436437 # Additional variables for time measurement
437438 self .__start_time_init = None
438- self .__zero_precip_time = None
439439 self .__init_time = None
440440 self .__mainloop_time = None
441441
@@ -777,7 +777,7 @@ def __check_inputs(self):
777777 self .__params .filter_kwargs = deepcopy (self .__config .filter_kwargs )
778778
779779 if self .__config .noise_kwargs is None :
780- self .__params .noise_kwargs = dict ()
780+ self .__params .noise_kwargs = { "win_fun" : "tukey" }
781781 else :
782782 self .__params .noise_kwargs = deepcopy (self .__config .noise_kwargs )
783783
@@ -1093,17 +1093,19 @@ def transform_to_lagrangian(precip, i):
10931093 self .__precip_models = np .stack (temp_precip_models )
10941094
10951095 # Check for zero input fields in the radar and NWP data.
1096- self .__params .zero_precip_radar = blending . utils . check_norain (
1096+ self .__params .zero_precip_radar = check_norain (
10971097 self .__precip ,
10981098 self .__config .precip_threshold ,
10991099 self .__config .norain_threshold ,
1100+ self .__params .noise_kwargs ["win_fun" ],
11001101 )
11011102 # The norain fraction threshold used for nwp is the default value of 0.0,
11021103 # since nwp does not suffer from clutter.
1103- self .__params .zero_precip_model_fields = blending . utils . check_norain (
1104+ self .__params .zero_precip_model_fields = check_norain (
11041105 self .__precip_models ,
11051106 self .__config .precip_threshold ,
11061107 self .__config .norain_threshold ,
1108+ self .__params .noise_kwargs ["win_fun" ],
11071109 )
11081110
11091111 def __zero_precipitation_forecast (self ):
@@ -1141,7 +1143,7 @@ def __zero_precipitation_forecast(self):
11411143 precip_forecast_workers = None
11421144
11431145 if self .__config .measure_time :
1144- self . __zero_precip_time = time .time () - self .__start_time_init
1146+ zero_precip_time = time .time () - self .__start_time_init
11451147
11461148 if self .__config .return_output :
11471149 precip_forecast_all_members_all_times = np .stack (
@@ -1154,8 +1156,8 @@ def __zero_precipitation_forecast(self):
11541156 if self .__config .measure_time :
11551157 return (
11561158 precip_forecast_all_members_all_times ,
1157- self . __zero_precip_time ,
1158- self . __zero_precip_time ,
1159+ zero_precip_time ,
1160+ zero_precip_time ,
11591161 )
11601162 else :
11611163 return precip_forecast_all_members_all_times
@@ -1177,10 +1179,11 @@ def __prepare_nowcast_for_zero_radar(self):
11771179 if done :
11781180 break
11791181 for j in range (self .__precip_models .shape [0 ]):
1180- if not blending . utils . check_norain (
1182+ if not check_norain (
11811183 self .__precip_models [j , t ],
11821184 self .__config .precip_threshold ,
11831185 self .__config .norain_threshold ,
1186+ self .__params .noise_kwargs ["win_fun" ],
11841187 ):
11851188 if self .__state .precip_models_cascades is not None :
11861189 self .__state .precip_cascades [
@@ -2925,7 +2928,7 @@ def forecast(
29252928 precip_thr: float, optional
29262929 Specifies the threshold value for minimum observable precipitation
29272930 intensity. Required if mask_method is not None or conditional is True.
2928- norain_thr: float, optional
2931+ norain_thr: float
29292932 Specifies the threshold value for the fraction of rainy (see above) pixels
29302933 in the radar rainfall field below which we consider there to be no rain.
29312934 Depends on the amount of clutter typically present.
0 commit comments