Skip to content

Use the selected canopy quadrature for directional extinction - #243

Open
cfranken wants to merge 11 commits into
mainfrom
fix/canopy-projection-quadrature
Open

cfranken wants to merge 11 commits into
mainfrom
fix/canopy-projection-quadrature

Conversation

@cfranken

@cfranken cfranken commented Nov 7, 2026 •

Copy link
Copy Markdown
Member

When CanopySurface.canopy_quadrature.n_leaf differs from the projection routine's default, the canopy cache uses one leaf-angle quadrature for directional extinction and another for scattering. Internal layer absorption then disagrees with the leaf-area-integrated APAR. This remains present on current main, including the recent canopy polarization fix.

Pass canopy.canopy_quadrature to CanopyOptics.G before applying clumping and moving the projection array to the selected architecture. Require CanopyOptics 0.2.1 in the package and test environments, which provides consistent projection/scattering normalization through RemoteSensingTools/CanopyOptics.jl#63.

Dependency: CanopyOptics #63 is merged and v0.2.1 is published and registered in General. This PR is ready for review. Hosted checks were rerun after registration. The minimum version prevents silently combining the new cache preparation with the old phase normalization; no manifest or local dependency path is committed.

Validation on Julia 1.12.6 with the companion CanopyOptics checkout:

  • Existing canopy tests: 71 passed, including forward RT, solar-source scaling, Stokes energy conservation and the soil-albedo Jacobian regression.
  • New regression: 64 passed, comparing cached extinction against an independent normalized leaf-projection integral for FP32/FP64, Stokes I/IQU, scalar/spectral optics, and clumping.
  • Full companion CanopyOptics suite: 85,617 passed.

From test/, run julia --project=.. -e 'using Test; include("test_canopy.jl")' with the companion CanopyOptics checkout developed in the environment. The complete atmospheric suite and GPU/Metal execution were not rerun for this cache-preparation fix.

The larger differences between native two-stream and multi-stream APAR are a separate closure-accuracy issue; this PR fixes the inconsistent numerical leaf measure.

cfranken referenced this pull request in RemoteSensingTools/CanopyOptics.jl Nov 7, 2026
@cfranken
cfranken marked this pull request as ready for review November 7, 2026 03:17
Copilot AI balanced review requested due to automatic review settings November 7, 2026 03:17

Copilot AI left a comment

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.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

Co-authored-by: cfranken <10467190+cfranken@users.noreply.github.com>

This branch has not been deployed

No deployments
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.

4 participants