From fee1a7bd5ceb68e91f361403604482c0eba44441 Mon Sep 17 00:00:00 2001 From: gnrgomes Date: Mon, 18 Mar 2024 12:48:47 +0100 Subject: [PATCH 1/2] Add hourly variables tests --- tests/test_gridding.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_gridding.py b/tests/test_gridding.py index 53b92d3..6d0998f 100755 --- a/tests/test_gridding.py +++ b/tests/test_gridding.py @@ -298,7 +298,7 @@ def test_generate_netcdf_hourly(self): reference = Dataset(reference_output) out = Dataset(output_netcdf) - self.compare_netcdfs(out, reference, variable_name='pr1') + self.compare_netcdfs(out, reference, variable_name=variable_code) out = None reference = None From 5273bea77677120196d161c58b252f557f83e457 Mon Sep 17 00:00:00 2001 From: gnrgomes Date: Mon, 18 Mar 2024 12:49:10 +0100 Subject: [PATCH 2/2] Add hourly variables tests --- .../configuration/1arcmin/config_pd6.txt | 22 +++++++++++++++++++ .../configuration/1arcmin/config_rg6.txt | 19 ++++++++++++++++ .../configuration/1arcmin/config_tn6.txt | 20 +++++++++++++++++ .../configuration/1arcmin/config_tx6.txt | 20 +++++++++++++++++ .../configuration/1arcmin/config_ws6.txt | 19 ++++++++++++++++ 5 files changed, 100 insertions(+) create mode 100644 src/lisfloodutilities/gridding/configuration/1arcmin/config_pd6.txt create mode 100644 src/lisfloodutilities/gridding/configuration/1arcmin/config_rg6.txt create mode 100644 src/lisfloodutilities/gridding/configuration/1arcmin/config_tn6.txt create mode 100644 src/lisfloodutilities/gridding/configuration/1arcmin/config_tx6.txt create mode 100644 src/lisfloodutilities/gridding/configuration/1arcmin/config_ws6.txt diff --git a/src/lisfloodutilities/gridding/configuration/1arcmin/config_pd6.txt b/src/lisfloodutilities/gridding/configuration/1arcmin/config_pd6.txt new file mode 100644 index 0000000..55f94b7 --- /dev/null +++ b/src/lisfloodutilities/gridding/configuration/1arcmin/config_pd6.txt @@ -0,0 +1,22 @@ +[PROPERTIES] + +VAR_CODE = pd6 +CELL_METHODS = time: mean +UNIT = hPa +UNIT_CONVERSION = 1.0 +HEIGHT_CORRECTION_FACTOR = 0.00025 +# After the height correction allows removing negative values by setting them to zero +TRUNCATE_NEGATIVE_VALUES = True +VALUE_MIN = 0 +VALUE_MAX = 50 +VALUE_SCALE = 0.1 +VALUE_OFFSET = 0.0 +DATA_TYPE_PACKED = i2 +STANDARD_NAME = water_vapor_partial_pressure_in_air +LONG_NAME = 6 Hourly Average Vapor Pressure + +[VAR_TIME] + +UNIT_PATTERN = hours since %%Y-%%m-%%d %%H:%%M:%%S.%%f +UNIT = hours since 1990-01-01 06:00:00.0 +FREQUENCY = 6 diff --git a/src/lisfloodutilities/gridding/configuration/1arcmin/config_rg6.txt b/src/lisfloodutilities/gridding/configuration/1arcmin/config_rg6.txt new file mode 100644 index 0000000..b905b24 --- /dev/null +++ b/src/lisfloodutilities/gridding/configuration/1arcmin/config_rg6.txt @@ -0,0 +1,19 @@ +[PROPERTIES] + +VAR_CODE = rg6 +CELL_METHODS = time: sum +UNIT = J/m2 +UNIT_CONVERSION = 1.0 +VALUE_MIN = 0 +VALUE_MAX = 115000000 +VALUE_SCALE = 10000.0 +VALUE_OFFSET = 0.0 +DATA_TYPE_PACKED = i2 +STANDARD_NAME = integral_wrt_time_of_surface_downwelling_shortwave_flux_in_air +LONG_NAME = 6 Hourly Calculated Radiation + +[VAR_TIME] + +UNIT_PATTERN = hours since %%Y-%%m-%%d %%H:%%M:%%S.%%f +UNIT = hours since 1990-01-01 06:00:00.0 +FREQUENCY = 6 diff --git a/src/lisfloodutilities/gridding/configuration/1arcmin/config_tn6.txt b/src/lisfloodutilities/gridding/configuration/1arcmin/config_tn6.txt new file mode 100644 index 0000000..2e2b574 --- /dev/null +++ b/src/lisfloodutilities/gridding/configuration/1arcmin/config_tn6.txt @@ -0,0 +1,20 @@ +[PROPERTIES] + +VAR_CODE = tn6 +CELL_METHODS = time: minimum +UNIT = degree_Celsius +UNIT_CONVERSION = 1.0 +HEIGHT_CORRECTION_FACTOR = 0.006 +VALUE_MIN = -55 +VALUE_MAX = 50 +VALUE_SCALE = 0.1 +VALUE_OFFSET = 0.0 +DATA_TYPE_PACKED = i2 +STANDARD_NAME = air_temperature +LONG_NAME = 6 Hourly Minimum Temperature + +[VAR_TIME] + +UNIT_PATTERN = hours since %%Y-%%m-%%d %%H:%%M:%%S.%%f +UNIT = hours since 1990-01-01 06:00:00.0 +FREQUENCY = 6 diff --git a/src/lisfloodutilities/gridding/configuration/1arcmin/config_tx6.txt b/src/lisfloodutilities/gridding/configuration/1arcmin/config_tx6.txt new file mode 100644 index 0000000..fe9db71 --- /dev/null +++ b/src/lisfloodutilities/gridding/configuration/1arcmin/config_tx6.txt @@ -0,0 +1,20 @@ +[PROPERTIES] + +VAR_CODE = tx6 +CELL_METHODS = time: maximum +UNIT = degree_Celsius +UNIT_CONVERSION = 1.0 +HEIGHT_CORRECTION_FACTOR = 0.006 +VALUE_MIN = -55 +VALUE_MAX = 55 +VALUE_SCALE = 0.1 +VALUE_OFFSET = 0.0 +DATA_TYPE_PACKED = i2 +STANDARD_NAME = air_temperature +LONG_NAME = 6 Hourly Maximum Temperature + +[VAR_TIME] + +UNIT_PATTERN = hours since %%Y-%%m-%%d %%H:%%M:%%S.%%f +UNIT = hours since 1990-01-01 06:00:00.0 +FREQUENCY = 6 diff --git a/src/lisfloodutilities/gridding/configuration/1arcmin/config_ws6.txt b/src/lisfloodutilities/gridding/configuration/1arcmin/config_ws6.txt new file mode 100644 index 0000000..8a24d94 --- /dev/null +++ b/src/lisfloodutilities/gridding/configuration/1arcmin/config_ws6.txt @@ -0,0 +1,19 @@ +[PROPERTIES] + +VAR_CODE = ws6 +CELL_METHODS = time: mean +UNIT = m/s +UNIT_CONVERSION = 1.0 +VALUE_MIN = 0 +VALUE_MAX = 45 +VALUE_SCALE = 0.1 +VALUE_OFFSET = 0.0 +DATA_TYPE_PACKED = i2 +STANDARD_NAME = wind_speed +LONG_NAME = 6 Hourly Average Wind Speed + +[VAR_TIME] + +UNIT_PATTERN = hours since %%Y-%%m-%%d %%H:%%M:%%S.%%f +UNIT = hours since 1990-01-01 06:00:00.0 +FREQUENCY = 6