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

Fixed bug in ICON CMORizer that lead to shifted time coordinates #2038

Merged
merged 17 commits into from Jun 1, 2023

Conversation

schlunma
Copy link
Contributor

@schlunma schlunma commented May 18, 2023

Description

By default, ICON reports aggregated data at the end of the output interval, e.g., the 2020 January mean is reported as 1 February 2020 ( 20200201). Since the raw output does not contain time bounds, this is impossible to tell from the data alone. This affects all other time frequencies (e.g., daily data is shifted by half a day, 6hr data by 3 hours, etc.).

This PR fixes this by shifting all time points back by 1/2 of the output interval. This feature is enabled by default, but can be disabled in the recipe/extra facets by shift_time: false.

I tested this successfully on real monthly, daily, 3hourly and hourly ICON data. After this fix, the ICON top-of-the-atmosphere incoming solar radiation is in sync with observations:

timeseries_ambiguous_exp_ambiguous_variable_group_ambiguous_dataset_Amon

Closes #2024
Closes #2017

Link to documentation: https://esmvaltool--2038.org.readthedocs.build/projects/ESMValCore/en/2038/quickstart/find_data.html#icon


Before you get started

Checklist

It is the responsibility of the author to make sure the pull request is ready to review. The icons indicate whether the item will be subject to the 🛠 Technical or 🧪 Scientific review.


To help with the number pull requests:

@schlunma schlunma added the bug Something isn't working label May 18, 2023
@schlunma schlunma added this to the v2.9.0 milestone May 18, 2023
@schlunma schlunma self-assigned this May 18, 2023
@schlunma schlunma marked this pull request as ready for review May 18, 2023 13:29
@codecov
Copy link

codecov bot commented May 18, 2023

Codecov Report

Merging #2038 (908ad2b) into main (70861d4) will increase coverage by 0.03%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #2038      +/-   ##
==========================================
+ Coverage   92.94%   92.97%   +0.03%     
==========================================
  Files         235      235              
  Lines       12550    12604      +54     
==========================================
+ Hits        11664    11718      +54     
  Misses        886      886              
Impacted Files Coverage Δ
esmvalcore/cmor/_fixes/icon/icon.py 100.00% <100.00%> (ø)

Copy link
Contributor

@remi-kazeroni remi-kazeroni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for addressing this issue @schlunma! Code looks good to me and the documentation on this topic is clear. This PR makes it easier to work with ICON output. Apart from a tiny suggestion, this is good to be merged.

doc/quickstart/find_data.rst Outdated Show resolved Hide resolved
@valeriupredoi
Copy link
Contributor

@schlunma pls address the optional review comment from Remi, fix the conflict, then ping me here and I shall merge 🍺

@schlunma
Copy link
Contributor Author

schlunma commented Jun 1, 2023

ping @valeriupredoi 🍻

Copy link
Contributor

@valeriupredoi valeriupredoi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awesome, cheers, gents!

@valeriupredoi valeriupredoi merged commit 6e14388 into main Jun 1, 2023
3 checks passed
@valeriupredoi valeriupredoi deleted the icon_shift_time branch June 1, 2023 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ICON output is shifted in time Typo in Timerange documentation examples
3 participants