Skip to content

Fractional open-water coverage for the recharge mask and polder DRN - #71

Merged
bdestombe merged 1 commit into
mainfrom
fractional-open-water-coverage
Jul 25, 2026
Merged

Fractional open-water coverage for the recharge mask and polder DRN#71
bdestombe merged 1 commit into
mainfrom
fractional-open-water-coverage

Conversation

@bdestombe

Copy link
Copy Markdown
Member

Supports NHFLO/models#135: fully fractional handling of open-water cell coverage in 09pwnmodel2.

  • riv_from_oppervlakte_pwn stores ds['panden_coverage'] — the panden-covered fraction of each cell, from the intersected piece areas.
  • recharge_pond_mask(fractional=True) uses that fraction at panden cells (summed with the lake coverage, clipped at 1) instead of a hard 1.0. When the variable is absent the previous behavior (1.0 at panden RIV cells) is preserved, which keeps the existing contract tests green.
  • drn_from_waterboard_data's exclude generalizes from a boolean drop mask to an open-water fraction: the DRN conductance is scaled by the drainable land share 1 - exclude, and the reach is dropped where the land share is zero. Boolean masks scale by 0/1 and behave exactly as before (all 24 pre-existing polder/lakes/panden tests pass unchanged).

The models script combines this with the RWS rws_oppwater_area fraction (and the BGT fraction in the polders_in_detail branch) into one sw_frac, scales RCH and the new EVT package by 1 - sw_frac, and passes it as the polder-DRN exclude — see the companion commit on NHFLO/models#135.

Note: the models notebook CI installs nhflotools@main, so NHFLO/models#135 needs this PR merged first (the old boolean-only ~exclude raises on a float fraction).

Tests: 142 passed, 1 xfailed (3 new: panden coverage known-answer, combined lake+panden fraction with clipping, land-share-scaled DRN conductance).

- riv_from_oppervlakte_pwn stores ds['panden_coverage']: the panden-covered
  fraction of each cell from the intersected piece areas.
- recharge_pond_mask(fractional=True) uses that fraction at panden cells
  (summed with the lake coverage and clipped at 1) instead of a hard 1.0;
  without the variable the previous 1.0-at-panden-cells behavior is kept.
- drn_from_waterboard_data's exclude generalizes from a boolean drop mask
  to an open-water fraction: the conductance is scaled by the drainable
  land share 1 - exclude, dropping the reach where the share is zero.
  Boolean masks behave exactly as before.
- Tests: known-answer panden coverage, combined lake+panden fraction with
  clipping, and land-share-scaled DRN conductance.
@bdestombe

Copy link
Copy Markdown
Member Author

The rch an evt should only be subtracted from the lakes, because they have their own rainfall and evaporation

@bdestombe
bdestombe merged commit ae709a2 into main Jul 25, 2026
2 checks passed
@bdestombe
bdestombe deleted the fractional-open-water-coverage branch July 25, 2026 09:47
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.

1 participant