From 1ca11c97e41d448a99f4eac90be727625d3f9fca Mon Sep 17 00:00:00 2001 From: Inne Vanderkelen Date: Fri, 16 Jan 2026 11:34:58 +0100 Subject: [PATCH 1/3] remove bug in CCLM inputconvertor --- src/valenspy/input/converter_functions.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/valenspy/input/converter_functions.py b/src/valenspy/input/converter_functions.py index 0c79fd06..f2777875 100644 --- a/src/valenspy/input/converter_functions.py +++ b/src/valenspy/input/converter_functions.py @@ -80,14 +80,7 @@ def CCLM_to_CF(ds: xr.Dataset) -> xr.Dataset: ds[new_var] = ds[var].sel(pressure=pressure) ds = ds.drop_vars(var) ds = ds.drop_dims("pressure") - - # Seems to be failing because the last time step of the dataset is at 11:00:00, while all others are at 11:30:00. - # One option: - ds = ds.isel(time=slice(0,-1)) - # Other options: - # ds = ds.assign_coords(time=(ds.time.dt.floor('H'))) Note ciel does not work as the last time step is at 11:00:00 and the ceil function will round it to 12:00:00 - # Original option (only for hourly data) - # new_time = ds_cclm.tas.time.astype('datetime64[D]') + np.timedelta64(12, 'h') + return ds From 1bcf59cdb2133608ffcfe9f4423fe6382bff537d Mon Sep 17 00:00:00 2001 From: Inne Vanderkelen Date: Wed, 11 Feb 2026 10:49:24 +0100 Subject: [PATCH 2/3] fix bug in variable naming --- src/valenspy/ancilliary_data/CCLM_lookup.yml | 2 +- src/valenspy/input/converter_functions.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/valenspy/ancilliary_data/CCLM_lookup.yml b/src/valenspy/ancilliary_data/CCLM_lookup.yml index c0d80be7..04e27f6a 100755 --- a/src/valenspy/ancilliary_data/CCLM_lookup.yml +++ b/src/valenspy/ancilliary_data/CCLM_lookup.yml @@ -140,7 +140,7 @@ sfcWindmax: raw_grid_mapping: rotated_pole raw_cell_methods: 'time: point' -sfcWindmax: +sfcWindmax50m: raw_name: SFCWIND_50M_MAX raw_long_name: daily maximum of 10m wind speed (vector product of u_10m and v_10m) raw_units: m s-1 diff --git a/src/valenspy/input/converter_functions.py b/src/valenspy/input/converter_functions.py index f2777875..4b6fb496 100644 --- a/src/valenspy/input/converter_functions.py +++ b/src/valenspy/input/converter_functions.py @@ -80,7 +80,8 @@ def CCLM_to_CF(ds: xr.Dataset) -> xr.Dataset: ds[new_var] = ds[var].sel(pressure=pressure) ds = ds.drop_vars(var) ds = ds.drop_dims("pressure") - + + #ds = ds.assign_coords(time=ds.time.dt.floor("D") + np.timedelta64(12, "h") return ds From a4ca39f54146c8a8f6f49bcc8a99591ae0a94829 Mon Sep 17 00:00:00 2001 From: Inne Vanderkelen Date: Wed, 11 Feb 2026 11:25:54 +0100 Subject: [PATCH 3/3] fix typo --- src/valenspy/ancilliary_data/CCLM_lookup.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/valenspy/ancilliary_data/CCLM_lookup.yml b/src/valenspy/ancilliary_data/CCLM_lookup.yml index 04e27f6a..da28d416 100755 --- a/src/valenspy/ancilliary_data/CCLM_lookup.yml +++ b/src/valenspy/ancilliary_data/CCLM_lookup.yml @@ -142,7 +142,7 @@ sfcWindmax: sfcWindmax50m: raw_name: SFCWIND_50M_MAX - raw_long_name: daily maximum of 10m wind speed (vector product of u_10m and v_10m) + raw_long_name: daily maximum of 10m wind speed (vector product of u_50m and v_50m) raw_units: m s-1 raw_grid_mapping: rotated_pole raw_cell_methods: 'time: point'