10
10
11
11
# fmt:off
12
12
steps_arg_values = [
13
- (1 , 3 , 4 , 8 , None , None , False , "spn" , True , 4 , False , False , 0 , False , None ),
14
- (1 , 3 , 4 , 8 , "obs" , None , False , "spn" , True , 4 , False , False , 0 , False , None ),
15
- (1 , 3 , 4 , 8 , "incremental" , None , False , "spn" , True , 4 , False , False , 0 , False , None ),
16
- (1 , 3 , 4 , 8 , None , "mean" , False , "spn" , True , 4 , False , False , 0 , False , None ),
17
- (1 , 3 , 4 , 8 , None , "mean" , False , "spn" , True , 4 , False , False , 0 , True , None ),
18
- (1 , 3 , 4 , 8 , None , "cdf" , False , "spn" , True , 4 , False , False , 0 , False , None ),
19
- (1 , [1 , 2 , 3 ], 4 , 8 , None , "cdf" , False , "spn" , True , 4 , False , False , 0 , False , None ),
20
- (1 , 3 , 4 , 8 , "incremental" , "cdf" , False , "spn" , True , 4 , False , False , 0 , False , None ),
21
- (1 , 3 , 4 , 6 , "incremental" , "cdf" , False , "bps" , True , 4 , False , False , 0 , False , None ),
22
- (1 , 3 , 4 , 6 , "incremental" , "cdf" , False , "bps" , False , 4 , False , False , 0 , False , None ),
23
- (1 , 3 , 4 , 6 , "incremental" , "cdf" , False , "bps" , False , 4 , False , False , 0 , True , None ),
24
- (1 , 3 , 4 , 9 , "incremental" , "cdf" , False , "spn" , True , 4 , False , False , 0 , False , None ),
25
- (2 , 3 , 10 , 8 , "incremental" , "cdf" , False , "spn" , True , 10 , False , False , 0 , False , None ),
26
- (5 , 3 , 5 , 8 , "incremental" , "cdf" , False , "spn" , True , 5 , False , False , 0 , False , None ),
27
- (1 , 10 , 1 , 8 , "incremental" , "cdf" , False , "spn" , True , 1 , False , False , 0 , False , None ),
28
- (2 , 3 , 2 , 8 , "incremental" , "cdf" , True , "spn" , True , 2 , False , False , 0 , False , None ),
29
- (1 , 3 , 6 , 8 , None , None , False , "spn" , True , 6 , False , False , 0 , False , None ),
30
- (1 , 3 , 6 , 8 , None , None , False , "spn" , True , 6 , False , False , 0 , False , "bps" ),
31
- # TODO: make next test work! This is currently not working on the main branch
32
- # (2, 3, 4, 8, "incremental", "cdf", True, "spn", True, 2, False, False, 0, False),
33
- # (2, 3, 4, 8, "incremental", "cdf", False, "spn", True, 2, False, False, 0, False),
13
+ (1 , 3 , 4 , 8 , None , None , False , "spn" , True , 4 , False , False , 0 , False , None , None ),
14
+ (1 , 3 , 4 , 8 , "obs" , None , False , "spn" , True , 4 , False , False , 0 , False , None , None ),
15
+ (1 , 3 , 4 , 8 , "incremental" , None , False , "spn" , True , 4 , False , False , 0 , False , None , None ),
16
+ (1 , 3 , 4 , 8 , None , "mean" , False , "spn" , True , 4 , False , False , 0 , False , None , None ),
17
+ (1 , 3 , 4 , 8 , None , "mean" , False , "spn" , True , 4 , False , False , 0 , True , None , None ),
18
+ (1 , 3 , 4 , 8 , None , "cdf" , False , "spn" , True , 4 , False , False , 0 , False , None , None ),
19
+ (1 , [1 , 2 , 3 ], 4 , 8 , None , "cdf" , False , "spn" , True , 4 , False , False , 0 , False , None , None ),
20
+ (1 , 3 , 4 , 8 , "incremental" , "cdf" , False , "spn" , True , 4 , False , False , 0 , False , None , None ),
21
+ (1 , 3 , 4 , 6 , "incremental" , "cdf" , False , "bps" , True , 4 , False , False , 0 , False , None , None ),
22
+ (1 , 3 , 4 , 6 , "incremental" , "cdf" , False , "bps" , False , 4 , False , False , 0 , False , None , None ),
23
+ (1 , 3 , 4 , 6 , "incremental" , "cdf" , False , "bps" , False , 4 , False , False , 0 , True , None , None ),
24
+ (1 , 3 , 4 , 9 , "incremental" , "cdf" , False , "spn" , True , 4 , False , False , 0 , False , None , None ),
25
+ (2 , 3 , 10 , 8 , "incremental" , "cdf" , False , "spn" , True , 10 , False , False , 0 , False , None , None ),
26
+ (5 , 3 , 5 , 8 , "incremental" , "cdf" , False , "spn" , True , 5 , False , False , 0 , False , None , None ),
27
+ (1 , 10 , 1 , 8 , "incremental" , "cdf" , False , "spn" , True , 1 , False , False , 0 , False , None , None ),
28
+ (2 , 3 , 2 , 8 , "incremental" , "cdf" , True , "spn" , True , 2 , False , False , 0 , False , None , None ),
29
+ (1 , 3 , 6 , 8 , None , None , False , "spn" , True , 6 , False , False , 0 , False , None , None ),
30
+ (1 , 3 , 6 , 8 , None , None , False , "spn" , True , 6 , False , False , 0 , False , "bps" , None ),
34
31
# Test the case where the radar image contains no rain.
35
- (1 , 3 , 6 , 8 , None , None , False , "spn" , True , 6 , True , False , 0 , False , None ),
36
- (5 , 3 , 5 , 6 , "incremental" , "cdf" , False , "spn" , False , 5 , True , False , 0 , False , None ),
37
- (5 , 3 , 5 , 6 , "incremental" , "cdf" , False , "spn" , False , 5 , True , False , 0 , True , None ),
32
+ (1 , 3 , 6 , 8 , None , None , False , "spn" , True , 6 , True , False , 0 , False , None , None ),
33
+ (5 , 3 , 5 , 6 , "incremental" , "cdf" , False , "spn" , False , 5 , True , False , 0 , False , None , None ),
34
+ (5 , 3 , 5 , 6 , "incremental" , "cdf" , False , "spn" , False , 5 , True , False , 0 , True , None , None ),
38
35
# Test the case where the NWP fields contain no rain.
39
- (1 , 3 , 6 , 8 , None , None , False , "spn" , True , 6 , False , True , 0 , False , None ),
40
- (5 , 3 , 5 , 6 , "incremental" , "cdf" , False , "spn" , False , 5 , False , True , 0 , True , None ),
36
+ (1 , 3 , 6 , 8 , None , None , False , "spn" , True , 6 , False , True , 0 , False , None , None ),
37
+ (5 , 3 , 5 , 6 , "incremental" , "cdf" , False , "spn" , False , 5 , False , True , 0 , True , None , None ),
41
38
# Test the case where both the radar image and the NWP fields contain no rain.
42
- (1 , 3 , 6 , 8 , None , None , False , "spn" , True , 6 , True , True , 0 , False , None ),
43
- (5 , 3 , 5 , 6 , "incremental" , "cdf" , False , "spn" , False , 5 , True , True , 0 , False , None ),
44
- (5 , 3 , 5 , 6 , "obs" , "mean" , True , "spn" , True , 5 , True , True , 0 , False , None ),
39
+ (1 , 3 , 6 , 8 , None , None , False , "spn" , True , 6 , True , True , 0 , False , None , None ),
40
+ (5 , 3 , 5 , 6 , "incremental" , "cdf" , False , "spn" , False , 5 , True , True , 0 , False , None , None ),
41
+ (5 , 3 , 5 , 6 , "obs" , "mean" , True , "spn" , True , 5 , True , True , 0 , False , None , None ),
45
42
# Test for smooth radar mask
46
- (1 , 3 , 6 , 8 , None , None , False , "spn" , True , 6 , False , False , 80 , False , None ),
47
- (5 , 3 , 5 , 6 , "incremental" , "cdf" , False , "spn" , False , 5 , False , False , 80 , False , None ),
48
- (5 , 3 , 5 , 6 , "obs" , "mean" , False , "spn" , False , 5 , False , False , 80 , False , None ),
49
- (1 , 3 , 6 , 8 , None , None , False , "spn" , True , 6 , False , True , 80 , False , None ),
50
- (5 , 3 , 5 , 6 , "incremental" , "cdf" , False , "spn" , False , 5 , True , False , 80 , True , None ),
51
- (5 , 3 , 5 , 6 , "obs" , "mean" , False , "spn" , False , 5 , True , True , 80 , False , None ),
52
- (5 , [1 , 2 , 3 ], 5 , 6 , "obs" , "mean" , False , "spn" , False , 5 , True , True , 80 , False , None ),
53
- (5 , [1 , 3 ], 5 , 6 , "obs" , "mean" , False , "spn" , False , 5 , True , True , 80 , False , None ),
43
+ (1 , 3 , 6 , 8 , None , None , False , "spn" , True , 6 , False , False , 80 , False , None , None ),
44
+ (5 , 3 , 5 , 6 , "incremental" , "cdf" , False , "spn" , False , 5 , False , False , 80 , False , None , None ),
45
+ (5 , 3 , 5 , 6 , "obs" , "mean" , False , "spn" , False , 5 , False , False , 80 , False , None , None ),
46
+ (1 , 3 , 6 , 8 , None , None , False , "spn" , True , 6 , False , True , 80 , False , None , None ),
47
+ (5 , 3 , 5 , 6 , "incremental" , "cdf" , False , "spn" , False , 5 , True , False , 80 , True , None , None ),
48
+ (5 , 3 , 5 , 6 , "obs" , "mean" , False , "spn" , False , 5 , True , True , 80 , False , None , None ),
49
+ (5 , [1 , 2 , 3 ], 5 , 6 , "obs" , "mean" , False , "spn" , False , 5 , True , True , 80 , False , None , None ),
50
+ (5 , [1 , 3 ], 5 , 6 , "obs" , "mean" , False , "spn" , False , 5 , True , True , 80 , False , None , None ),
51
+ # Test the usage of a max_mask_rim in the mask_kwargs
52
+ (1 , 3 , 6 , 8 , None , None , False , "bps" , True , 6 , False , False , 80 , False , None , 40 ),
53
+ (5 , 3 , 5 , 6 , "obs" , "mean" , False , "bps" , False , 5 , False , False , 80 , False , None , 40 ),
54
+ (5 , 3 , 5 , 6 , "incremental" , "cdf" , False , "bps" , False , 5 , False , False , 80 , False , None , 25 ),
55
+ (5 , 3 , 5 , 6 , "incremental" , "cdf" , False , "bps" , False , 5 , False , False , 80 , False , None , 40 ),
56
+ (5 , 3 , 5 , 6 , "incremental" , "cdf" , False , "bps" , False , 5 , False , False , 80 , False , None , 60 ),
54
57
]
55
58
# fmt:on
56
59
70
73
"smooth_radar_mask_range" ,
71
74
"resample_distribution" ,
72
75
"vel_pert_method" ,
76
+ "max_mask_rim" ,
73
77
)
74
78
75
79
@@ -90,6 +94,7 @@ def test_steps_blending(
90
94
smooth_radar_mask_range ,
91
95
resample_distribution ,
92
96
vel_pert_method ,
97
+ max_mask_rim ,
93
98
):
94
99
pytest .importorskip ("cv2" )
95
100
@@ -162,13 +167,18 @@ def test_steps_blending(
162
167
metadata ["zr_a" ] = 200.0
163
168
metadata ["zr_b" ] = 1.6
164
169
165
- # Also set the outdir_path and clim_kwargs
170
+ # Also set the outdir_path, clim_kwargs and mask_kwargs
166
171
outdir_path_skill = "./tmp/"
167
172
if n_models == 1 :
168
173
clim_kwargs = None
169
174
else :
170
175
clim_kwargs = dict ({"n_models" : n_models , "window_length" : 30 })
171
176
177
+ if max_mask_rim is not None :
178
+ mask_kwargs = dict ({"mask_rim" : 10 , "max_mask_rim" : max_mask_rim })
179
+ else :
180
+ mask_kwargs = None
181
+
172
182
###
173
183
# First threshold the data and convert it to dBR
174
184
###
@@ -288,6 +298,7 @@ def test_steps_blending(
288
298
conditional = False ,
289
299
probmatching_method = probmatching_method ,
290
300
mask_method = mask_method ,
301
+ resample_distribution = resample_distribution ,
291
302
smooth_radar_mask_range = smooth_radar_mask_range ,
292
303
callback = None ,
293
304
return_output = True ,
@@ -301,7 +312,7 @@ def test_steps_blending(
301
312
noise_kwargs = None ,
302
313
vel_pert_kwargs = None ,
303
314
clim_kwargs = clim_kwargs ,
304
- mask_kwargs = None ,
315
+ mask_kwargs = mask_kwargs ,
305
316
measure_time = False ,
306
317
)
307
318
0 commit comments