Skip to content

Fill urban roughness gaps with the closure's bare-soil endpoint - #591

Merged
glwagner merged 9 commits into
mainfrom
xk/roughness-gap-fill
Oct 2, 2026
Merged

glwagner merged 9 commits into
mainfrom
xk/roughness-gap-fill

Conversation

@xkykai

@xkykai xkykai commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

aerodynamic_parameters marks cells of invalid morphometry NaN by design, so an (ℓᵐ, d) pair from urban_roughness over a building dataset with missing tiles carries gaps, and there was no supported way to turn that into something a flux closure can consume.

ℓᵐ, d = urban_roughness(h, λᵖ; closure)
fill_aerodynamic_roughness_gaps!(ℓᵐ, d, closure)

Gaps become the closure's own bare-soil endpoint aerodynamic_parameters(closure, 0, 0); the pair is filled together, so a gap in either becomes unbuilt surface in both. Where the morphometry is still to hand, the docstring points at inpainting λᵖ and h instead, which fills from horizontal neighbors and keeps a hole in a city a city.

Closes #583

🤖 Generated with Claude Code

xkykai and others added 2 commits August 25, 2026 16:11
`aerodynamic_parameters` marks cells of invalid morphometry NaN by design, so an
(ℓᵐ, d) pair from a building dataset with missing tiles carries gaps that
propagate NaN through u★, θ★ and q★ into the coupled state.
`fill_aerodynamic_roughness_gaps!` replaces them with
`aerodynamic_parameters(closure, 0, 0)`, filling the pair together.

Closes #583

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@codecov

codecov Bot commented Aug 25, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 82.35294% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/Lands/roughness/urban_roughness_field.jl 82.35% 3 Missing ⚠️

📢 Thoughts on this report? Let us know!

@xkykai
xkykai marked this pull request as ready for review August 26, 2026 00:33
xkykai and others added 4 commits August 25, 2026 17:39
…a gap

`fill_aerodynamic_roughness_gaps!` takes `unbuilt = (ℓ, d)`, defaulting to the
closure's bare-soil endpoint, so gaps known to be open water can be given a
water roughness instead of soil. The pair is validated (ℓ > 0, d ≥ 0), and a
non-positive ℓᵐ counts as a gap alongside the non-finite ones, as #583 asked.

The docstring now says the fill only restores evaluability: bare soil is about
two orders of magnitude rougher than water, and the land flux closure runs
wherever the land component does. It also drops the unverified claim that GHSL
marks open water no-data inside published tiles; the offshore gaps come from
the all-ocean tiles GHSL does not publish.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Comment thread src/Lands/roughness/urban_roughness_field.jl Outdated
Comment thread src/Lands/roughness/urban_roughness_field.jl Outdated
Co-authored-by: Gregory L. Wagner <gregory.leclaire.wagner@gmail.com>
@glwagner
glwagner merged commit 9bb9546 into main Oct 2, 2026
7 of 8 checks passed
@glwagner
glwagner deleted the xk/roughness-gap-fill branch October 2, 2026 05:52
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.

urban_roughness output has no supported gap-filling path before a flux closure

3 participants