Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handling of time ranges (mostly in datafinder) #345

Closed
zklaus opened this issue Oct 30, 2019 · 10 comments
Closed

Handling of time ranges (mostly in datafinder) #345

zklaus opened this issue Oct 30, 2019 · 10 comments
Labels
enhancement New feature or request

Comments

@zklaus
Copy link

zklaus commented Oct 30, 2019

There are a couple of issues with the current handling of time ranges in the data finder:

The intuitive choice seems to be to specify time ranges as a single string item per dataset, and adopting the CMIP convention for the format (that has stayed consistent from CMIP5 to CMIP6) that is also used for obs4MIPs these days.

This could also open up the possibility of having special values like corresponding to determine the correct range from other datasets and would allow the explicit use of the -clim suffix that appears in climatological variables such as those in the monC table.

Challenges might include older obs4MIPs datasets that separate the two parts of their timerange with _ instead of - and non-standard datasets.

So to sum up the idea is:

What do you guys think?

@zklaus zklaus added the enhancement New feature or request label Oct 30, 2019
@bouweandela
Copy link
Member

I think this would mostly be applicable to the way we specify times in the recipe. What do you think about this, @mattiarighi ?

@mattiarighi
Copy link
Contributor

Sounds convenient.
How would the new dataset key look like?

timerange: 1996-2001

?

How many formats are we going to support?
I can think about the following ones:

timerange: 1996-2001
timerange: 199603-200110
timerange: 19960105-20010509

@zklaus
Copy link
Author

zklaus commented Nov 8, 2019

Ideally, I would like to go completely with CMIP, ie quoting from the abovementioned document:

The <time_range> is a string generated consistent with the following:
If frequency = “fx” then
<time_range>=””
else
<time_range> = N1-N2[suffix] where N1 and N2 are integers of the form ‘yyyy[MM[dd[hh[mm[ss]]]]]’ (expressed as a string, where where ‘yyyy’, ‘MM’, ‘dd’, ‘hh’ ‘mm’ and ‘ss’ are integer year, month, day, hour, minute, and second, respectively)
endif

where suffix is defined as follows:
if the variable identified by variable_id has a time dimension with a “climatology” attribute then
suffix = “-clim”
else
suffix = “”
endif

and where the precision of the time_range strings is determined by the “frequency” global attribute as specified in Table 2.

and Table 2 is

Frequency Precision of time label Notes
yr, dec, yrPt “yyyy” Label with the years recorded in the  first and last coordinate values.
mon, monC “yyyyMM” For “mon”, label with the months recorded in the  first and last coordinate values; for “monC” label with the first and last months contributing to the climatology.
day “yyyyMMdd” Label with the days recorded in the  first and last coordinate values.
6hr, 3hr, 1hr, 1hrCM, 6hrPt, 3hrPt, 1hrPt “yyyyMMddhhmm” Label 1hrCM files with the beginning of the first hour and the end of the last hour contributing to climatology (rounded to the nearest minute); for other frequencies in this category, label with the first and last time-coordinate values (rounded to the nearest minute).
subhrPt “yyyyMMddhhmmss” Label with the first and last time-coordinate values (rounded to the nearest second)
fx Omit time label This frequency applies to variables that are independent of time (“fixed”).

@mattiarighi
Copy link
Contributor

Makes sense.

It might be quite some work to adapt all recipes and test them after this change, but I support it.
Other opinions? @ESMValGroup/esmvaltool-coreteam

@jvegreg
Copy link
Contributor

jvegreg commented Dec 2, 2019

It's great news for me. I would need something like this for the decadal predictions support

@BenMGeo
Copy link

BenMGeo commented Dec 6, 2019

I fully support this. In C3S_511 we have to analyze data "as is". I currently filled the noncomplete years "by hand" with missing values.

Would make my life easier ;)

@bouweandela
Copy link
Member

It sounds like everyone would be really happy to have this feature. @zklaus Would you be able to implement it?

@zklaus
Copy link
Author

zklaus commented Dec 27, 2019

I'll have a look in the new year, that is after 2020-01-13.

@Peter9192
Copy link
Contributor

We're addressing at least part of this issue in #358

@zklaus
Copy link
Author

zklaus commented Feb 20, 2023

I think this has been addressed in #1133

@zklaus zklaus closed this as completed Feb 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants