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

Adds collapse_by_hour_of_day operator #1034

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Adds collapse_by_hour_of_day operator #1034

wants to merge 3 commits into from

Conversation

daflack
Copy link
Contributor

@daflack daflack commented Jan 16, 2025

Fixes #1029

Adds an operator to collapse by hour of the day to allow for diurnal cycle aggregation.

Contribution checklist

Aim to have all relevant checks ticked off before merging. See the developer's guide for more detail.

  • Documentation has been updated to reflect change.
  • New code has tests, and affected old tests have been updated.
  • All tests and CI checks pass.
  • Ensured the pull request title is descriptive.
  • Conda lock files have been updated if dependencies have changed.
  • Attributed any Generative AI, such as GitHub Copilot, used in this PR.
  • Marked the PR as ready to review.

@daflack daflack added the enhancement New feature or request label Jan 16, 2025
@daflack daflack self-assigned this Jan 16, 2025
@daflack daflack marked this pull request as draft January 16, 2025 11:35
Copy link
Contributor

github-actions bot commented Jan 16, 2025

Coverage

@daflack daflack marked this pull request as ready for review January 16, 2025 14:10
@daflack daflack requested review from jfrost-mo and jwarner8 January 16, 2025 14:11
@daflack
Copy link
Contributor Author

daflack commented Jan 16, 2025

Note for when reviewing: This works for pp files - where code is automatically read in to have 2 dim_coords that are associated with time: "forecast_period" and "forecast_reference_time" or if you wanted to split by hour for a single multi-day forecast, as in the tests.

However, in setting up the validity time equivalent branch and tests I noted that netcdf files are read in slightly differently to pp files. With netcdf files a CubeList with each cube representing a different forecast is created and that list could not be merged. I have since managed to work out how to recreate the type of cube required to allow aggregation over multiple case studies easily. I will apply this as a different issue and PR as this will influence the ability to aggregate over cases regardless of how it is done (e.g. hour of day, lead time, validity time).

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

Successfully merging this pull request may close these issues.

Collapse by hour of day
1 participant