Open malininae opened 4 months ago
You can achieve this with something like:
documentation:
title: test extract_time.
description: test extract_time.
authors:
- malinina_elizaveta
preprocessors:
preproc_regions:
custom_order: true
convert_units:
units: degrees_C
datasets:
- dataset: ERA5
project: OBS6
type: reanaly
version: v1
tier: 3
diagnostics:
heatwave:
description: just a test
variables:
current:
short_name: tasmax
timerange: '20240102/20240717'
mip: day
preprocessor: preproc_regions
scripts: null
See here and here https://github.com/ESMValGroup/ESMValCore/issues/2048 for more information.
While working on #2304, I've discovered that
clip_timerange
would give you a wrong end date if theend_day
andend_month
aren't the 31st of December. Example, I need to process ERA5 data for the current year which ends on the 18th of July of 2024. Out of fun I'm passing the 17th of July 2024 as an end date, example:Now, what I would expect, the cube to be cropped to 2024-01-01 - 2024-07-17, but because the
timerange
that gets passed into theclip_timerange(cube: Cube, timerange: str)
is2024/2024
, the cube gets to be clipped to 2024-01-01 - 2025-01-01. While I can see that the described use case might be more on a rare side, I think it's still important to be fixed.Pinging @bouweandela, since he wrote a bunch of time preprocessors.