-
Notifications
You must be signed in to change notification settings - Fork 26
Closed
Description
At the moment the patterns supported in earthkit.data.utils.pattern allow to substitute a datetime to a specified format in a string. It would be useful to be able to apply a timedelta to the given datetime before the substitution.
Example:
In this case we have analysis data for a date:
/home/ecmv9074/hpcperm/cmc_data/2025011200_000
/home/ecmv9074/hpcperm/cmc_data/2025011206_000
...
path: /home/ecmv9074/hpcperm/cmc_data/{date:strftime(%Y%m%d)}{date:strftime(%H)}_000
But for this same validity date the file name pattern is 6h before for the forecast file. In that case the strftime can't be use:
/home/ecmv9074/hpcperm/cmc_data/2025011118_006
/home/ecmv9074/hpcperm/cmc_data/2025011200_006
...
path: /home/ecmv9074/hpcperm/cmc_data/{date:???}{date:???}_006
The idea would be to add a new pattern TYPE that would take a date and a timedelta to substitute the resulting datetime in the string.
path: /home/ecmv9074/hpcperm/cmc_data/{date:strftimedelta(-6h;%Y%m%d)}{date:strftimedelta(-6h;%H)}_006
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels