esm-tools / pymorize

A Python based Tool to CMORize NetCDF Data
MIT License
0 stars 1 forks source link

Calculate output time ranges #15

Closed mandresm closed 2 months ago

mandresm commented 3 months ago

Calculates year ranges for the output (https://github.com/FESOM/seamore/blob/7725366f7b68ea3824ac6baa500ea49531722b72/lib/cmorizer.rb#L182-L195)

This range calculation is not straight forward as we do not only specify the first and last year, and the step of the output, but we also specify the major_first_digit, so in which precise year we are storing a range. That means our first output file can have a different time range as the following ones. For example:

first: 2023
last: 2051
majort_first_digit: 1
step: 10

In the case above the following files labelled with the year key should cover the values time spans:

2031: 2023-2030
2041: 2031-2040
2051: 2041-2050

It does something similar if the stepping exceeds the last bound.

I am wondering... is this extra complicated logic really necessary? --> ask Christopher

Limitations:

Called by:

Calls: range_years