Skip to content

Fix T_2M/TD_2M bias by sourcing lead times 1–6 from previous INCA run#163

Open
teobuz wants to merge 8 commits into
mainfrom
MRB-876-shifted_runs
Open

Fix T_2M/TD_2M bias by sourcing lead times 1–6 from previous INCA run#163
teobuz wants to merge 8 commits into
mainfrom
MRB-876-shifted_runs

Conversation

@teobuz
Copy link
Copy Markdown
Contributor

@teobuz teobuz commented May 26, 2026

The INCA runs in the archive have a known bug where T_2M and TD_2M are incorrect at lead times 1–6 for runs initialized at full hours. This PR works around it by loading those steps from the run 10 minutes prior (at :50), while keeping step 0 from the current reftime.

The fix applies only to hourly frequency and the two affected parameters. A helper _open_convert() was extracted to reduce duplication in the loading logic.

@teobuz teobuz requested a review from dnerini May 26, 2026 14:17
teobuz and others added 3 commits May 26, 2026 16:42
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@dnerini dnerini changed the title introduced exeption for T_2M and TD_2M, use previous run for steps 1-6 Fix T_2M/TD_2M bias by sourcing lead times 1–6 from previous INCA run May 28, 2026
Comment on lines +440 to +441
elif u == "mm/h":
da = da.assign_attrs({**da.attrs, "units": "kg m-2"})
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is this correct? We are converting from a rate to an accumulation. This particular conversion only works if values are for hourly accumulations. Is that always the case?

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.

3 participants