From 3e6513119c3217b09d1358c00b4f6e8f0392607d Mon Sep 17 00:00:00 2001 From: Simon De Kock Date: Thu, 18 Jul 2024 11:37:17 +0200 Subject: [PATCH] Added test for smooth radar mask --- pysteps/tests/test_blending_steps.py | 51 ++++++++++++++++------------ 1 file changed, 30 insertions(+), 21 deletions(-) diff --git a/pysteps/tests/test_blending_steps.py b/pysteps/tests/test_blending_steps.py index 3f4a0580b..dcab52fb1 100644 --- a/pysteps/tests/test_blending_steps.py +++ b/pysteps/tests/test_blending_steps.py @@ -8,31 +8,39 @@ steps_arg_values = [ - (1, 3, 4, 8, None, None, False, "spn", True, 4, False, False), - (1, 3, 4, 8, "obs", None, False, "spn", True, 4, False, False), - (1, 3, 4, 8, "incremental", None, False, "spn", True, 4, False, False), - (1, 3, 4, 8, None, "mean", False, "spn", True, 4, False, False), - (1, 3, 4, 8, None, "cdf", False, "spn", True, 4, False, False), - (1, 3, 4, 8, "incremental", "cdf", False, "spn", True, 4, False, False), - (1, 3, 4, 6, "incremental", "cdf", False, "bps", True, 4, False, False), - (1, 3, 4, 6, "incremental", "cdf", False, "bps", False, 4, False, False), - (1, 3, 4, 9, "incremental", "cdf", False, "spn", True, 4, False, False), - (2, 3, 10, 8, "incremental", "cdf", False, "spn", True, 10, False, False), - (5, 3, 5, 8, "incremental", "cdf", False, "spn", True, 5, False, False), - (1, 10, 1, 8, "incremental", "cdf", False, "spn", True, 1, False, False), - (2, 3, 2, 8, "incremental", "cdf", True, "spn", True, 2, False, False), - (1, 3, 6, 8, None, None, False, "spn", True, 6, False, False), + (1, 3, 4, 8, None, None, False, "spn", True, 4, False, False, 0), + (1, 3, 4, 8, "obs", None, False, "spn", True, 4, False, False, 0), + (1, 3, 4, 8, "incremental", None, False, "spn", True, 4, False, False, 0), + (1, 3, 4, 8, None, "mean", False, "spn", True, 4, False, False, 0), + (1, 3, 4, 8, None, "cdf", False, "spn", True, 4, False, False, 0), + (1, 3, 4, 8, "incremental", "cdf", False, "spn", True, 4, False, False, 0), + (1, 3, 4, 6, "incremental", "cdf", False, "bps", True, 4, False, False, 0), + (1, 3, 4, 6, "incremental", "cdf", False, "bps", False, 4, False, False, 0), + (1, 3, 4, 9, "incremental", "cdf", False, "spn", True, 4, False, False, 0), + (2, 3, 10, 8, "incremental", "cdf", False, "spn", True, 10, False, False, 0), + (5, 3, 5, 8, "incremental", "cdf", False, "spn", True, 5, False, False, 0), + (1, 10, 1, 8, "incremental", "cdf", False, "spn", True, 1, False, False, 0), + (2, 3, 2, 8, "incremental", "cdf", True, "spn", True, 2, False, False, 0), + (1, 3, 6, 8, None, None, False, "spn", True, 6, False, False, 0), # Test the case where the radar image contains no rain. - (1, 3, 6, 8, None, None, False, "spn", True, 6, True, False), - (5, 3, 5, 6, "incremental", "cdf", False, "spn", False, 5, True, False), + (1, 3, 6, 8, None, None, False, "spn", True, 6, True, False, 0), + (5, 3, 5, 6, "incremental", "cdf", False, "spn", False, 5, True, False, 0), # Test the case where the NWP fields contain no rain. - (1, 3, 6, 8, None, None, False, "spn", True, 6, False, True), - (5, 3, 5, 6, "incremental", "cdf", False, "spn", False, 5, False, True), + (1, 3, 6, 8, None, None, False, "spn", True, 6, False, True, 0), + (5, 3, 5, 6, "incremental", "cdf", False, "spn", False, 5, False, True, 0), # Test the case where both the radar image and the NWP fields contain no rain. - (1, 3, 6, 8, None, None, False, "spn", True, 6, True, True), - (5, 3, 5, 6, "incremental", "cdf", False, "spn", False, 5, True, True), - (5, 3, 5, 6, "obs", "mean", True, "spn", True, 5, True, True), + (1, 3, 6, 8, None, None, False, "spn", True, 6, True, True, 0), + (5, 3, 5, 6, "incremental", "cdf", False, "spn", False, 5, True, True, 0), + (5, 3, 5, 6, "obs", "mean", True, "spn", True, 5, True, True, 0), + # Test for smooth radar mask + (1, 3, 6, 8, None, None, False, "spn", True, 6, False, False, 80), + (5, 3, 5, 6, "incremental", "cdf", False, "spn", False, 5, False, False, 80), + (5, 3, 5, 6, "obs", "mean", False, "spn", False, 5, False, False, 80), + (1, 3, 6, 8, None, None, False, "spn", True, 6, False, True, 80), + (5, 3, 5, 6, "incremental", "cdf", False, "spn", False, 5, True, False, 80), + (5, 3, 5, 6, "obs", "mean", False, "spn", False, 5, True, True, 80), ] + steps_arg_names = ( "n_models", "n_timesteps", @@ -46,6 +54,7 @@ "expected_n_ens_members", "zero_radar", "zero_nwp", + "smooth_radar_mask_range", )