From 051da876c2be5fab0fd597a5c8c35dbd4ab4fa58 Mon Sep 17 00:00:00 2001 From: "Navid C. Constantinou" Date: Tue, 14 May 2024 17:41:56 +0300 Subject: [PATCH] don't hardcode mask --- tests/test_expt_class.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/test_expt_class.py b/tests/test_expt_class.py index 8cd6841f..6de6201b 100644 --- a/tests/test_expt_class.py +++ b/tests/test_expt_class.py @@ -112,7 +112,10 @@ def generate_temperature_arrays(nx, ny, number_vertical_layers): temp_in_C = np.random.randn(ny, nx, number_vertical_layers) temp_in_C_masked = np.copy(temp_in_C) - temp_in_C_masked[20:24, 32:35, :] = float("nan") + if int(ny/4+4) < ny-1 and int(nx/3+4) < nx+1: + temp_in_C_masked[int(ny/3):int(ny/3+5), int(nx):int(nx/4+4), :] = float("nan") + else: + raise ValueError("use bigger domain") temp_in_K = np.copy(temp_in_C) + 273.15 temp_in_K_masked = np.copy(temp_in_C_masked) + 273.15