56
56
from pysteps .nowcasts import utils as nowcast_utils
57
57
from pysteps .postprocessing import probmatching
58
58
from pysteps .timeseries import autoregression , correlation
59
+ from pysteps .utils .check_norain import check_norain
59
60
60
61
try :
61
62
import dask
@@ -77,7 +78,7 @@ class StepsBlendingConfig:
77
78
precip_threshold: float, optional
78
79
Specifies the threshold value for minimum observable precipitation
79
80
intensity. Required if mask_method is not None or conditional is True.
80
- norain_threshold: float, optional
81
+ norain_threshold: float
81
82
Specifies the threshold value for the fraction of rainy (see above) pixels
82
83
in the radar rainfall field below which we consider there to be no rain.
83
84
Depends on the amount of clutter typically present.
@@ -435,7 +436,6 @@ def __init__(
435
436
436
437
# Additional variables for time measurement
437
438
self .__start_time_init = None
438
- self .__zero_precip_time = None
439
439
self .__init_time = None
440
440
self .__mainloop_time = None
441
441
@@ -777,7 +777,7 @@ def __check_inputs(self):
777
777
self .__params .filter_kwargs = deepcopy (self .__config .filter_kwargs )
778
778
779
779
if self .__config .noise_kwargs is None :
780
- self .__params .noise_kwargs = dict ()
780
+ self .__params .noise_kwargs = { "win_fun" : "tukey" }
781
781
else :
782
782
self .__params .noise_kwargs = deepcopy (self .__config .noise_kwargs )
783
783
@@ -1093,17 +1093,19 @@ def transform_to_lagrangian(precip, i):
1093
1093
self .__precip_models = np .stack (temp_precip_models )
1094
1094
1095
1095
# 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 (
1097
1097
self .__precip ,
1098
1098
self .__config .precip_threshold ,
1099
1099
self .__config .norain_threshold ,
1100
+ self .__params .noise_kwargs ["win_fun" ],
1100
1101
)
1101
1102
# The norain fraction threshold used for nwp is the default value of 0.0,
1102
1103
# 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 (
1104
1105
self .__precip_models ,
1105
1106
self .__config .precip_threshold ,
1106
1107
self .__config .norain_threshold ,
1108
+ self .__params .noise_kwargs ["win_fun" ],
1107
1109
)
1108
1110
1109
1111
def __zero_precipitation_forecast (self ):
@@ -1141,7 +1143,7 @@ def __zero_precipitation_forecast(self):
1141
1143
precip_forecast_workers = None
1142
1144
1143
1145
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
1145
1147
1146
1148
if self .__config .return_output :
1147
1149
precip_forecast_all_members_all_times = np .stack (
@@ -1154,8 +1156,8 @@ def __zero_precipitation_forecast(self):
1154
1156
if self .__config .measure_time :
1155
1157
return (
1156
1158
precip_forecast_all_members_all_times ,
1157
- self . __zero_precip_time ,
1158
- self . __zero_precip_time ,
1159
+ zero_precip_time ,
1160
+ zero_precip_time ,
1159
1161
)
1160
1162
else :
1161
1163
return precip_forecast_all_members_all_times
@@ -1177,10 +1179,11 @@ def __prepare_nowcast_for_zero_radar(self):
1177
1179
if done :
1178
1180
break
1179
1181
for j in range (self .__precip_models .shape [0 ]):
1180
- if not blending . utils . check_norain (
1182
+ if not check_norain (
1181
1183
self .__precip_models [j , t ],
1182
1184
self .__config .precip_threshold ,
1183
1185
self .__config .norain_threshold ,
1186
+ self .__params .noise_kwargs ["win_fun" ],
1184
1187
):
1185
1188
if self .__state .precip_models_cascades is not None :
1186
1189
self .__state .precip_cascades [
@@ -2925,7 +2928,7 @@ def forecast(
2925
2928
precip_thr: float, optional
2926
2929
Specifies the threshold value for minimum observable precipitation
2927
2930
intensity. Required if mask_method is not None or conditional is True.
2928
- norain_thr: float, optional
2931
+ norain_thr: float
2929
2932
Specifies the threshold value for the fraction of rainy (see above) pixels
2930
2933
in the radar rainfall field below which we consider there to be no rain.
2931
2934
Depends on the amount of clutter typically present.
0 commit comments