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

Duration subdivision KGO updates after resolving forecast period and cell method issues #74

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bayliffe
Copy link
Contributor

@bayliffe bayliffe commented Feb 7, 2025

KGO for duration subdivision plugin updated such that the forecast periods reflect the end point and ranges of the new shorter periods. The inclusion of duplicate cell methods has also been prevented.

Example

Consider kgo_daymask.nc The subdivided cube has 2 shorter 3-hour periods.

First period

forecast_period             1220400 seconds, bound=(1209600, 1220400) seconds
forecast_reference_time     2024-12-03 00:00:00
time                        2024-12-17 03:00:00, bound=(2024-12-17 00:00:00, 2024-12-17 03:00:00)

We can check that the forecast period is correct, this measuring between the forecast reference time and the time point.

(cube[0].coord("time").cell(0).point - cube[0].coord("forecast_reference_time").cell(0).point).total_seconds()
>>> 1220400.0

Second period

We can do the same for the second period.

forecast_period             1231200 seconds, bound=(1220400, 1231200) seconds
forecast_reference_time     2024-12-03 00:00:00
time                        2024-12-17 06:00:00, bound=(2024-12-17 03:00:00, 2024-12-17 06:00:00)

For the point difference we get:

(cube[1].coord("time").cell(0).point - cube[1].coord("forecast_reference_time").cell(0).point).total_seconds()
>>> 1231200.0

which again, is correct. We can also check that the lower bound of the forecast period range aligns with the lower bound of the forecast time:

(cube[1].coord("time").cell(0).bound[0] - cube[1].coord("forecast_reference_time").cell(0).point).total_seconds()
>>> 1220400.0

and indeed it does.

…riods reflect the end point and ranges of the new shorter periods.
@brhooper brhooper removed their assignment Feb 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants