4SAIL Polar BRDF and the Angular NDVI Effect

Where the principal-plane tutorial sweeps a single line through view-angle space, this one runs 4SAIL over the full (VZA, VAZ) half-sphere in a single batched call and uses the result to look at the angular dependence of NDVI.

Two ideas are worth highlighting:

  • FourSAILGeometrySet lets you evaluate 4SAIL for an entire directional grid in one go — no Julia-level loop over view angles.
  • NDVI is not a single number for a canopy: even a vegetation-only scene with a fixed leaf spectrum shows several percent of angular spread, with a dip on the hotspot side.
using CanopyOptics
d3_from_file (generic function with 1 method)

Scene

const sza_deg     = 30.0
const lai         = 4.0
const lambda_nm   = [685.0, 800.0]
const soil_albedo = 0.0
const hotspot_h   = 0.05
0.05

Dense (VZA, VAZ) grid. FourSAILGeometrySet consumes flattened (VZA, VAZ) vectors; we reshape the results back to a 2D grid after.

vzas_deg = collect(0.0:5.0:80.0)
vazs_deg = collect(0.0:5.0:355.0)
n_vza, n_vaz = length(vzas_deg), length(vazs_deg)

vza_all = repeat(vzas_deg; inner = n_vaz)
raa_all = repeat(vazs_deg; outer = n_vza)   # 4SAIL's raa = azimuth difference
1224-element Vector{Float64}:
   0.0
   5.0
  10.0
  15.0
  20.0
  25.0
  30.0
  35.0
  40.0
  45.0
   ⋮
 315.0
 320.0
 325.0
 330.0
 335.0
 340.0
 345.0
 350.0
 355.0

Leaf optics from PROSPECT-PRO

leaf = CanopyOptics.LeafProspectProProperties{Float64}(
    N = 1.5, Ccab = 40.0, Ccar = 8.0,
    Canth = 0.0, Cbrown = 0.0,
    Cw = 0.012, Cm = 0.009,
    Cprot = 0.0, Ccbc = 0.0,
)

opti = CanopyOptics.LeafOpticalProperties(400.0:1.0:2500.0)
T_grid, R_grid = CanopyOptics.prospect(leaf, opti)
λ_grid   = [Float64(v.val) for v in opti.λ]
grid_idx = [argmin(abs.(λ_grid .- λ)) for λ in lambda_nm]
R_leaf   = R_grid[grid_idx]
T_leaf   = T_grid[grid_idx]
2-element Vector{Float64}:
 0.01210607760826451
 0.4745523417367443

One batched 4SAIL call for the entire half-sphere

LD    = CanopyOptics.planophile_leaves2(Float64)
geoms = FourSAILGeometrySet(LD;
    sza_deg = sza_deg,
    vza_deg = vza_all,
    raa_deg = raa_all,
    quadrature = CanopyOptics.CanopyQuadrature(n_leaf = 64, n_azimuth = 16),
)

result = foursail(R_leaf, T_leaf, soil_albedo, geoms, lai;
                  hotspot = hotspot_h, mode = :full)
FourSAILResult{Matrix{Float64}}([0.018169740222920203 0.018169740222920203 … 0.018169740222920203 0.018169740222920203; 0.5075977217087424 0.5075977217087424 … 0.5075977217087424 0.5075977217087424], [0.017646826301755472 0.017646826301755472 … 0.017646826301755472 0.017646826301755472; 0.48638381283573984 0.48638381283573984 … 0.48638381283573984 0.48638381283573984], [0.017633311166857926 0.017633311166857926 … 0.02007271365041951 0.02007271365041951; 0.4858126584264018 0.4858126584264018 … 0.5718169086168068 0.5718169086168068], [0.020939916653607095 0.020939916653607095 … 0.021765875358171236 0.02180326895189167; 0.5116555910097065 0.5116555910097065 … 0.5501697690005578 0.5504115530118225], [0.031513618028839445 0.031513618028839445 … 0.031513618028839445 0.031513618028839445; 0.2530640686409402 0.2530640686409402 … 0.2530640686409402 0.2530640686409402], [0.02069805440963778 0.02069805440963778 … 0.02144774736729815 0.021485140961018584; 0.2370880191329726 0.2370880191329726 … 0.267024404453387 0.2672661884646518], [0.02069805440963778 0.02069805440963778 … 0.02144774736729815 0.021485140961018584; 0.2370880191329726 0.2370880191329726 … 0.267024404453387 0.2672661884646518], [0.00024186224396931458 0.00024186224396931458 … 0.0003181279908730871 0.0003181279908730871; 0.27456757187673386 0.27456757187673386 … 0.2831453645471708 0.2831453645471708])

result.rsot is (nwavelength × ndirections). Reshape each wavelength row back to (nvza × nvaz):

brf = Array{Float64}(undef, length(lambda_nm), n_vza, n_vaz)
for iλ in eachindex(lambda_nm)
    brf[iλ, :, :] .= permutedims(reshape(result.rsot[iλ, :], n_vaz, n_vza))
end

R_red = @view brf[1, :, :]
R_nir = @view brf[2, :, :]
NDVI  = (R_nir .- R_red) ./ (R_nir .+ R_red)

println("685 nm BRF extrema: ", extrema(R_red))
println("800 nm BRF extrema: ", extrema(R_nir))
println("NDVI extrema:        ", extrema(NDVI))
685 nm BRF extrema: (0.015692625457667794, 0.03545253604872071)
800 nm BRF extrema: (0.4739802110071939, 0.6778698605400529)
NDVI extrema:        (0.9005988422114304, 0.9408661261348098)

Anchor the angular NDVI effect to nadir so we can see how much it varies across the view hemisphere relative to the most common space-based reference geometry.

nadir_ndvi = NDVI[1, 1]
ΔNDVI = NDVI .- nadir_ndvi
println("NDVI at nadir: ", nadir_ndvi,
        "   ΔNDVI extrema (relative to nadir): ", extrema(ΔNDVI))
NDVI at nadir: 0.9213665291865567   ΔNDVI extrema (relative to nadir): (-0.02076768697512632, 0.019499596948253095)

Polar BRDF plots

Interactive polar hemisphere plots over (VZA, VAZ) with 0° azimuth at top (same azimuth as the sun in 4SAIL's convention). The red star marks the hotspot direction at (vza = sza, vaz = 0°).

Δlim = maximum(abs, ΔNDVI)
hs_marker = [(; vza = sza_deg, vaz = 0.0, color = "#ef4444", label = "hotspot")]

D3Figure(
    title = "4SAIL polar BRDF and NDVI angular effect",
    subtitle = "SZA = $(Int(sza_deg))°, LAI = $(lai), planophile LAD, soil albedo = $(soil_albedo), h = $(hotspot_h)",
    cols = 2,
    rowHeight = 310,
    panels = [
        d3_polar(vzas_deg, vazs_deg, brf[1, :, :];
                 title = "685 nm BRF (rsot)", cbarLabel = "BRF",
                 colormap = "viridis", markers = hs_marker),
        d3_polar(vzas_deg, vazs_deg, brf[2, :, :];
                 title = "800 nm BRF (rsot)", cbarLabel = "BRF",
                 colormap = "viridis", markers = hs_marker),
        d3_polar(vzas_deg, vazs_deg, NDVI;
                 title = "NDVI", cbarLabel = "NDVI",
                 colormap = "viridis", markers = hs_marker),
        d3_polar(vzas_deg, vazs_deg, ΔNDVI;
                 title = "NDVI − NDVI(nadir)", cbarLabel = "ΔNDVI",
                 colormap = "balance", clim = [-Δlim, Δlim], markers = hs_marker),
    ],
)

Reading the figure

  • The 685 nm BRDF is dim and dominated by the hotspot peak: most of the red signal is the directly back-scattered branch, because chlorophyll absorbs almost everything that scatters into the diffuse field.
  • The 800 nm BRDF is much brighter and noticeably flatter, with a broad bowl shape — multiple scattering smears the angular contrast out across the upper hemisphere.
  • The two effects combine in the NDVI panel: NDVI dips on the hotspot side (where the red BRF is locally lifted) and rises on the forward-scatter side. Even with a fixed leaf spectrum and a horizontally homogeneous canopy this is a several-percent angular variation — large enough to matter for cross-instrument comparison if view geometries differ.

This page was generated using Literate.jl.