Enable independent HC and RC in wind downscaling#2324
Draft
mo-AliceLake wants to merge 24 commits intofeature_update_wind_downscalingfrom
Draft
Enable independent HC and RC in wind downscaling#2324mo-AliceLake wants to merge 24 commits intofeature_update_wind_downscalingfrom
mo-AliceLake wants to merge 24 commits intofeature_update_wind_downscalingfrom
Conversation
… and function names, etc
3 tasks
* Pinning proj to 9.7.1 * Adding myself to contributors list * Fix numpy-update test failures * Reverting float() change
82e18ff to
41f9625
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
DRAFT since this branches off #2315 so needs rebasing after that is reviewed and merged.
Description
This PR restructures the WindTerrainAdjustment plugin (previously RoughnessCorrection) to provide clean, explicit control over applying Roughness Correction (RC), Height Correction (HC), or their combined behaviour. The goal is to make HC‑only and RC‑only configurations explicitly selectable, allowing clearer scientific experimentation and operational configurations (e.g. HC‑only over UK-domain, etc).
Previously, HC and RC were tightly coupled within a single routine. Running only one of the corrections was possible but relied on implicit side‑effects (e.g. suppressing RC by passing z0=None), which was neither obvious nor robust. This PR replaces those implicit behaviours with a clear interface.
Previously, HC and RC were tightly coupled inside a single routine (do_rc_hc_all). This made it difficult to:
Summary of Changes
Introduced explicit correction modes:
do_rc_hc_allroutine into three:do_hc()do_rc()do_hc_and_rc()(chained, preserving legacy HC+RC behaviour)modeargument to the plugin constructor, allowing users to select:"hc_and_rc"(default, identical to previous behaviour)"hc""rc"Clarified RC dependency on z0:
In the new interface, requesting RC (mode="rc" or "hc_and_rc") now requires a valid roughness‑length (z0) field. If it is missing, the plugin raises a clear ValueError.
This replaces the old implicit behaviour where suppressing RC was only achievable indirectly by passing z0=None. The new behaviour is explicit and predictable.
Unified masking and validation
Missing‑data, sea‑point, and invalid‑height masking has been consolidated and made consistent across RC, HC, and combined modes.
Testing