Spectral Band Aggregation
Plain-array wavenumber band integration, wavelength–wavenumber grid conversion, and composable leaf spectrum evaluation across UV, shortwave, and thermal bands. See the Spectral Band Aggregation guide for mathematical conventions, fallback rules, and pigment-share aggregation.
Band Averaging & Sub-Band Partition Shares
CanopyOptics.band_average — Function
band_average(values, edges, bands, weight = FlatWeight(); parent_band = nothing)Compute the flux-weighted mean of fine-grid spectral bin means values across each band in bands by exact wavenumber overlap of the fine bins with every band:
\[\bar{v}_b = \frac{\int_{\nu_{\mathrm{lo},b}}^{\nu_{\mathrm{hi},b}} v(\nu)\,w(\nu)\,d\nu}{\int_{\nu_{\mathrm{lo},b}}^{\nu_{\mathrm{hi},b}} w(\nu)\,d\nu}.\]
values:Npiecewise-constant bin means on[edges[i], edges[i + 1]].edges:N + 1finite, nonnegative, strictly ascending wavenumber bin edges incm⁻¹.bands:(2, nbnd)matrix of band limits[ν_lo; ν_hi]incm⁻¹with0 <= ν_lo < ν_hi.weight:AbstractSpectralWeight(defaultFlatWeight).parent_band: optional parent interval ((2, 1)matrix or 2-element vector/tuple[ν_lo, ν_hi]). Whenbandsholds sub-bands ofparent_band, passingparent_bandresolves the effective weight (includingTabulatedWeightcoverage/zero-flux fallback toFlatWeight) once forparent_bandand uses it across all sub-bands sosum(subband_weights(sub_bands, parent_band, weight) .* band_average(values, edges, sub_bands, weight; parent_band = parent_band))always recombines toonly(band_average(values, edges, parent_band, weight)).
Throws an ArgumentError naming the band if any band is invalid or not fully covered by [first(edges), last(edges)] (never returning silent zeros). If weight is a TabulatedWeight whose grid does not cover a parent band (or integrates to zero over that band), that band falls back explicitly to FlatWeight as a placeholder optical mean.
See band_average! for the in-place variant (zero heap allocation when arrays and built-in weight share a matching Float32 or Float64 element type), subband_weights for normalized sub-band partition shares, and CanopyOptics.band_weight for physical band-integrated weights.
Examples
julia> edges = [1000.0, 2000.0, 3000.0];
julia> bands = [1500.0 1000.0; 2500.0 3000.0];
julia> band_average([0.2, 0.6], edges, bands, FlatWeight())
2-element Vector{Float64}:
0.4
0.4CanopyOptics.band_average! — Function
band_average!(dest, values, edges, bands, weight = FlatWeight(); parent_band = nothing) -> destOverwrite dest in place with the exact-overlap band means of values over bands weighted by weight, and return dest (zero heap allocation when dest, input arrays, and built-in weight share a matching Float32 or Float64 element type; FlatWeight() matches both).
dest must not alias values, edges, bands, parent_band, or weight's storage (throws ArgumentError if aliased; disjoint views of a shared buffer are permitted). Throws DimensionMismatch when array dimensions disagree and ArgumentError naming the band if any band in bands is invalid, lies outside parent_band, or is not fully covered by edges. See band_average.
CanopyOptics.subband_weights — Function
subband_weights(sub_bands, parent_band, weight = FlatWeight())Compute normalized dimensionless sub-band flux shares w_j (0 <= w_j <= 1, sum(w_j) ≈ 1) for a contiguous partition sub_bands ((2, m) matrix) of a single parent_band ((2, 1) matrix or 2-element vector/tuple [ν_lo, ν_hi]).
subband_weights resolves the effective weight once on parent_band, matching band_average(v, edges, sub_bands, weight; parent_band = parent_band):
- If
weightis aTabulatedWeightthat does not coverparent_band, or whose integral across the entireparent_bandis zero, allmsub-bands fall back jointly toFlatWeight(Δν_j / Δν_parent); ifparent_bandis covered with positive integrated weight while an individual sub-band has zero density (e.g. a dark< 280 nmUV sub-interval), that sub-band receives share0. - If
weightis aPlanckWeight, all sub-bands shareparent_band's relative Wien-tail exponent shift so relative shares never underflow to0/0inFloat32orFloat64.
Consequently, sum(subband_weights(sub_bands, parent_band, weight) .* band_average(v, edges, sub_bands, weight; parent_band = parent_band)) reproduces only(band_average(v, edges, parent_band, weight)) across all weights, coverage regimes, and precisions. See subband_weights! for the in-place variant (zero heap allocation when arrays and built-in weight share a matching Float32 or Float64 element type).
Examples
julia> sub = [12850.0 14285.7; 14285.7 16000.0];
julia> w = subband_weights(sub, [12850.0; 16000.0;;], FlatWeight());
julia> isapprox(sum(w), 1.0)
trueCanopyOptics.subband_weights! — Function
subband_weights!(dest, sub_bands, parent_band, weight = FlatWeight()) -> destOverwrite dest in place with the normalized sub-band shares of sub_bands within parent_band under weight, and return dest (zero heap allocation when dest, sub_bands, parent_band, and built-in weight share a matching Float32 or Float64 element type; dest must not alias sub_bands, parent_band, or weight's storage). See subband_weights.
Spectral Weights & Wavelength–Wavenumber Conversion
CanopyOptics.AbstractSpectralWeight — Type
AbstractSpectralWeightSupertype for wavenumber spectral weighting functions $w(\nu)$ (per cm⁻¹) used by band_average, band_average!, subband_weights, subband_weights!, CanopyOptics.band_weight, and CanopyOptics.band_weight!.
Concrete subtypes provided by CanopyOptics are FlatWeight, PlanckWeight, and TabulatedWeight (including ReferenceSolar). Custom subtypes may implement CanopyOptics.weight_interval_integral.
CanopyOptics.FlatWeight — Type
FlatWeight()Uniform spectral weight $w(\nu) = 1$ per cm⁻¹, weighting fine bins purely by their wavenumber overlap $\Delta\nu$ with each band.
Examples
julia> FlatWeight() isa AbstractSpectralWeight
trueCanopyOptics.PlanckWeight — Type
PlanckWeight(T)Blackbody spectral exitance weight $M_\nu(\nu, T) = \pi B_\nu(\nu, T)$ in $\mathrm{W\,m^{-2}\,(cm^{-1})^{-1}}$ at temperature T in K:
\[M_\nu(\nu, T) = \frac{2\pi \times 10^8 h c^2\,\nu^3}{\exp(100\,h c\,\nu / (k_B T)) - 1},\]
integrated in coordinates relative to each overlap's lower wavenumber edge via composite 8-point Gauss–Legendre quadrature. Temperature T must be finite and satisfy 1 <= T <= 10^8 K.
Examples
julia> PlanckWeight(300.0)
PlanckWeight{Float64}(300.0)CanopyOptics.TabulatedWeight — Type
TabulatedWeight(edges, w)Piecewise-constant spectral weight density w (per cm⁻¹) defined on ascending wavenumber bin edges edges in cm⁻¹ (length(edges) == length(w) + 1).
After conversion to element type FT, edges must contain at least two finite, nonnegative, strictly ascending points, and w must contain finite nonnegative bin densities. When band_average or subband_weights evaluates a parent band not fully covered by [first(edges), last(edges)] (or a band over which the integrated weight vanishes), evaluation falls back explicitly to FlatWeight over that band as a finite placeholder so 0/0 never occurs.
Examples
julia> tw = TabulatedWeight([10000.0, 15000.0, 20000.0], [1.2, 0.8]);
julia> length(tw.w)
2CanopyOptics.ReferenceSolar — Function
ReferenceSolar(grid, irradiance; grid_unit = :nm) -> TabulatedWeight
ReferenceSolar(path = ...) -> TabulatedWeight{Float64}Construct a TabulatedWeight (per cm⁻¹) from a clear-sky global (direct + diffuse) surface solar irradiance spectrum.
Grid and |dλ/dν| Jacobian Conventions
grid_unit = :nm(default):irradianceis spectral irradiance per nanometer ($\mathrm{W\,m^{-2}\,nm^{-1}}$).- Point samples (
length(grid) == length(irradiance) >= 2):gridholds strictly ascending wavelengths $\lambda_k$ innm. Interior wavelength bin edges sit at midpoints $\frac{1}{2}(\lambda_k + \lambda_{k+1})$ and outer edges extend by half the adjacent spacing; each bin density is converted to percm⁻¹via the exact bin-averaged Jacobian $|d\lambda / d\nu|$: $\bar{E}_{\nu,i} = E_{\lambda,k}\,\lambda_{\mathrm{lo}}\lambda_{\mathrm{hi}} / 10^7$. Whole-bin integrated flux $\bar{E}_{\nu,i}\,\Delta\nu_i = E_{\lambda,k}\,\Delta\lambda_k$ is conserved; a band boundary cutting through the interior of a bin integrates the piecewise-constant per-cm⁻¹density $\bar{E}_{\nu,i}$. - Bin edges (
length(grid) == length(irradiance) + 1):gridholds strictly ascending wavelength bin edges innm, converted with the same per-bin Jacobian.
- Point samples (
grid_unit = :cm_inv:irradianceis already percm⁻¹, on strictly ascending wavenumber point samples (length(grid) == length(irradiance) >= 2) or bin edges (length(grid) == length(irradiance) + 1).
CSV Table Format and Zero-Irradiance UV Convention
Calling ReferenceSolar() with no arguments loads data/reference_solar_global.csv if that file exists, or throws an ArgumentError when no default table is installed; pass ReferenceSolar(path) to load a CSV file from an explicit path. Expected CSV format:
- UTF-8 comma-separated values (
,), optional#comment lines, optional single column-header row with non-numeric text in both columns (e.g.wavelength_nm,irradiance_W_m2_nm), and at least two numeric rows of(wavelength_nm, global_irradiance_W_m2_nm)with strictly ascending positive wavelengths innmand finite nonnegative global irradiance in $\mathrm{W\,m^{-2}\,nm^{-1}}$. - Include an explicit zero-irradiance row below
280 nm(e.g.195.0,0.0paired with280.0,0.0) so UV bands below the stratospheric ozone cutoff are covered by the table: partially illuminated bands (such as263–345 nm) then weight strictly by their illuminated> 280 nmportion, whereas fully dark bands (such as200–263 nm) have zero physical solar flux (CanopyOptics.band_weight == 0.0, and share0.0insubband_weightsinside an illuminated parent band). - On a band whose total integrated solar weight is zero (
0/0solar-weighted mean undefined),band_averageexplicitly returns theFlatWeightwavenumber average as a finite placeholder optical property.
Examples
julia> tw = ReferenceSolar(400.0:100.0:700.0, [1.1, 1.5, 1.4, 1.2]);
julia> tw isa TabulatedWeight{Float64}
trueCanopyOptics.wavelength_to_wavenumber — Function
wavelength_to_wavenumber(wavelengths_nm) -> edges
wavelength_to_wavenumber(wavelengths_nm, values; density = false) -> (edges, bin_values)Convert point samples on a regular ascending wavelength grid wavelengths_nm in nm (such as PROSPECT's 400:1:2500) to ascending wavenumber bin edges edges in cm⁻¹ (length(edges) == length(wavelengths_nm) + 1) and reordered wavenumber bin means bin_values.
Each sample $\lambda_k$ on a regular grid with step $\Delta\lambda$ spans the wavelength bin $[\lambda_{\mathrm{lo}}, \lambda_{\mathrm{hi}}] = [\lambda_k - \Delta\lambda/2,\, \lambda_k + \Delta\lambda/2]$, mapped to $[\nu_{\mathrm{lo}}, \nu_{\mathrm{hi}}] = [10^7/\lambda_{\mathrm{hi}},\, 10^7/\lambda_{\mathrm{lo}}]$ in reverse index order (i = N + 1 - k).
Jacobian Convention (density)
density = false(default):valuesis an intensive dimensionless or per-state quantity (such as reflectance $\rho(\lambda)$ or transmittance $\tau(\lambda)$), sobin_values[i] = values[N + 1 - i]. Apply physical spectral weights on the native fine grid before coarsening, because resampling intensive bin means in wavenumber preserves the flat-in-wavenumber (FlatWeight) integral.density = true:valuesis a spectral density per nanometer (such as spectral irradiance $E_\lambda$ in $\mathrm{W\,m^{-2}\,nm^{-1}}$). Converting $E_\lambda\,|d\lambda| = E_\nu\,d\nu$ over $[\lambda_{\mathrm{lo}}, \lambda_{\mathrm{hi}}]$ applies the exact bin-averaged Jacobian $|d\lambda / d\nu|$ (10^7 / \nu^2):
\[\bar{E}_{\nu,i} = E_{\lambda,k}\,\frac{\lambda_{\mathrm{lo}}\,\lambda_{\mathrm{hi}}}{10^7},\]
conserving whole-bin flux $\bar{E}_{\nu,i}(\nu_{\mathrm{hi}} - \nu_{\mathrm{lo}}) = E_{\lambda,k}\Delta\lambda$ to floating-point precision. A band boundary that cuts through the interior of a bin integrates the constant per-cm⁻¹ density $\bar{E}_{\nu,i}$ (for example, a single uniform 400–800 nm bin at 1 W m⁻² nm⁻¹ yields 133.33 W m⁻² over 600–800 nm, versus 200 W m⁻² in the piecewise-constant per-nm representation).
Examples
julia> edges, rho_nu = wavelength_to_wavenumber(400.0:500.0:1400.0, [0.05, 0.45, 0.30]);
julia> length(edges) == 4 && rho_nu == [0.30, 0.45, 0.05]
trueSee also wavenumber_to_wavelength, ReferenceSolar.
CanopyOptics.wavenumber_to_wavelength — Function
wavenumber_to_wavelength(edges) -> wavelengths_nm
wavenumber_to_wavelength(edges, bin_values; density = false) -> (wavelengths_nm, values)Convert ascending positive wavenumber bin edges edges in cm⁻¹ (and optional bin means bin_values) back to ascending wavelength bin midpoints wavelengths_nm in nm (and reordered wavelength values values), inverting wavelength_to_wavenumber.
When density = true, per-cm⁻¹ spectral densities are converted back to per-nm densities via $E_{\lambda,k} = \bar{E}_{\nu,i}\,10^7 / (\lambda_{\mathrm{lo}}\,\lambda_{\mathrm{hi}})$.
Examples
julia> edges, e_nu = wavelength_to_wavenumber(400.0:200.0:1000.0, [1.0, 1.5, 1.2, 0.9]; density = true);
julia> λ_rt, e_rt = wavenumber_to_wavelength(edges, e_nu; density = true);
julia> λ_rt ≈ [400.0, 600.0, 800.0, 1000.0] && e_rt ≈ [1.0, 1.5, 1.2, 0.9]
trueLeaf Spectrum Models & Pigment Shares
CanopyOptics.leaf_spectrum — Function
leaf_spectrum(model, edges) -> (rho, tau)
leaf_spectrum(leaf::LeafProspectProProperties, edges; optics = nothing) -> (rho, tau)Evaluate bin-mean leaf hemispherical reflectance rho and transmittance tau on ascending wavenumber bin edges edges in cm⁻¹ (length(rho) == length(tau) == length(edges) - 1).
model must fully cover every bin of edges; otherwise an ArgumentError is thrown (never returning silent zeros). Built-in methods support:
LeafProspectProProperties: evaluatesprospect_budgeton the bundled1 nmPROSPECT-PRO optical table (399.5–2500.5 nm,3999.20–25031.29 cm⁻¹) and averages ontoedgesby exact wavenumber overlap (accepting an optionalopticskeyword to supply a custom regular-nmLeafOpticalPropertiestable).TabulatedLeaf: resamples measured(rho, tau)spectra ontoedgesby exact wavenumber overlap.ConstantLeaf: fills(rho, tau)across[ν_min, ν_max].CompositeLeaf: selects the first component model covering each bin.
For PROSPECT pigment absorption shares per bin, see leaf_pigment_shares.
Examples
julia> edges = wavelength_to_wavenumber(400.0:1.0:2500.0);
julia> rho, tau = leaf_spectrum(LeafProspectProProperties(), edges);
julia> length(rho) == 2101 && all(0 .< rho .+ tau .< 1)
trueCanopyOptics.TabulatedLeaf — Type
TabulatedLeaf(edges, rho, tau)Measured or precomputed leaf reflectance rho and transmittance tau bin means on ascending wavenumber bin edges edges in cm⁻¹ (length(edges) == length(rho) + 1 == length(tau) + 1).
All bin values must be finite, nonnegative, and satisfy rho[i] + tau[i] <= 1 (within floating-point rounding). Evaluate on any covered wavenumber grid via leaf_spectrum.
Examples
julia> leaf = TabulatedLeaf([800.0, 2500.0, 4000.0], [0.03, 0.04], [0.0, 0.0]);
julia> leaf_spectrum(leaf, [1000.0, 2000.0, 3500.0])
([0.03, 0.03666666666666667], [0.0, 0.0])CanopyOptics.ConstantLeaf — Type
ConstantLeaf(rho, tau; ν_min = ..., ν_max = ...)Wavenumber-independent leaf reflectance rho and transmittance tau over [ν_min, ν_max] in cm⁻¹ (defaulting to [0, ∞) when ν_min and ν_max are omitted).
rho and tau must be finite, nonnegative, and satisfy rho + tau <= 1. Pass to leaf_spectrum directly or as a regional/fallback component inside CompositeLeaf.
Examples
julia> cl = ConstantLeaf(0.03, 0.0);
julia> leaf_spectrum(cl, [100.0, 500.0, 1000.0])
([0.03, 0.03], [0.0, 0.0])CanopyOptics.CompositeLeaf — Type
CompositeLeaf(models...)Ordered composition of leaf spectrum models in which the first model covering each wavenumber bin wins.
Nested CompositeLeaf instances are flattened on construction. During leaf_spectrum(comp, edges), bin i ([edges[i], edges[i + 1]]) is assigned to the earliest model in models whose domain covers the entire bin [edges[i], edges[i + 1]]; if any bin of edges remains uncovered after all models have been checked, an ArgumentError naming the uncovered bin is thrown. When splicing adjacent spectral regions, bound each regional ConstantLeaf to its physical wavenumber range and include the regional domain boundaries in edges so no bin straddles a boundary (for example, extending 400 nm PROSPECT optics onto ν >= ν_pro_hi, ConstantLeaf(0.04, 0.0; ν_min = 2500.0, ν_max = ν_pro_lo) across 2.5–4.0 µm, and ConstantLeaf(0.03, 0.0; ν_min = 0.0, ν_max = 2500.0) beyond 4.0 µm, with [2500.0, ν_pro_lo, ν_pro_hi] inserted into edges).
Examples
julia> comp = CompositeLeaf(
TabulatedLeaf([10000.0, 20000.0], [0.45], [0.40]),
ConstantLeaf(0.03, 0.0),
);
julia> leaf_spectrum(comp, [2000.0, 10000.0, 20000.0, 30000.0])
([0.03, 0.45, 0.03], [0.0, 0.4, 0.0])CanopyOptics.leaf_pigment_shares — Function
leaf_pigment_shares(leaf::LeafProspectProProperties, edges; optics = nothing) -> (; chlorophyll, carotenoids)Compute per-bin chlorophyll and carotenoid shares of absorbed light on ascending wavenumber bin edges edges in cm⁻¹ for a LeafProspectProProperties leaf, returning (; chlorophyll, carotenoids) with length(edges) - 1 elements each.
edges must be fully covered by the PROSPECT-PRO domain (399.5–2500.5 nm, 3999.20–25031.29 cm⁻¹), or an ArgumentError is thrown. At each native 1 nm PROSPECT bin, directly computed material absorptance $\alpha$ from prospect_budget is partitioned across prospect_constituent_coefficients using HomogeneousAbsorption and partition_absorption, with chlorophyll, carotenoids, anthocyanins, brown material, water, bulk dry matter, protein, and carbon constituents included in the denominator $\sum_j C_j K_j(\lambda)$.
Zero-Absorption and Coarse-Band Aggregation Conventions
- Native
1 nmbins with zero total absorption coefficient (AbsorptionNoMaterial) return0.0for both pigment shares (rather thanNaN). Multi-bin intervals inedgeswith positive integrated absorptance weight native shares by $\alpha(\nu)\,d\nu$; if integrated absorptance underflows to zero while constituent coefficients remain nonzero, resampling falls back to the flat-in-wavenumber mean of $C_i K_i / \sum_j C_j K_j$. - For incident-spectrum-weighted coarse bands, obtain native-grid absorptance from
prospect_budget(leaf, LeafOpticalProperties()).absorptance(rather than1 - rho - tau, which can round to zero in weak-absorption bins) viawavelength_to_wavenumber, and divideband_average(α .* shares.chlorophyll, edges, bands, w)byband_average(α, edges, bands, w)(returning0when band-mean absorptance is zero). For photon-count shares, replacewin both calls with a photon-flux weight integrating $w(\nu) / (100\,h c\,\nu)$ across each bin.
Examples
julia> edges = wavelength_to_wavenumber(400.0:1.0:700.0);
julia> shares = leaf_pigment_shares(LeafProspectProProperties(), edges);
julia> all(0 .<= shares.chlorophyll .+ shares.carotenoids .<= 1)
trueQualified Integrals & Extension Hooks
The following symbols are not exported by using CanopyOptics; access or extend them via qualified CanopyOptics.* bindings.
CanopyOptics.band_weight — Function
CanopyOptics.band_weight(bands, weight = FlatWeight())Integrate weight (per cm⁻¹) across each band column [ν_lo, ν_hi] of the (2, nbnd) matrix bands, returning the additive physical band integrals $W_b = \int_{\nu_{\mathrm{lo},b}}^{\nu_{\mathrm{hi},b}} w(\nu)\,d\nu$ (for example $\mathrm{W\,m^{-2}}$ for PlanckWeight or solar irradiance TabulatedWeight, and $\Delta\nu$ in cm⁻¹ for FlatWeight).
For TabulatedWeight, every band in bands must be covered by [first(weight.edges), last(weight.edges)] (throwing ArgumentError otherwise), and zero-density regions integrate to 0 so W(B) = ∑ W(B_k) holds identically across contiguous sub-bands. For dimensionless sub-band flux shares w_j (∑ w_j = 1) that include band_average's FlatWeight fallback and Wien-tail scaling, use subband_weights.
This function is not exported; call CanopyOptics.band_weight (or in-place CanopyOptics.band_weight!, which runs with zero heap allocation when dest, bands, and built-in weight share a matching Float32 or Float64 element type).
Examples
julia> CanopyOptics.band_weight([1000.0 2000.0; 2000.0 3500.0], FlatWeight())
2-element Vector{Float64}:
1000.0
1500.0CanopyOptics.band_weight! — Function
CanopyOptics.band_weight!(dest, bands, weight = FlatWeight()) -> destOverwrite dest in place with the band-integrated weights of bands under weight, and return dest (zero heap allocation when dest, bands, and built-in weight share a matching Float32 or Float64 element type; dest must not alias bands or weight's storage). See CanopyOptics.band_weight.
CanopyOptics.weight_interval_integral — Function
CanopyOptics.weight_interval_integral(weight::AbstractSpectralWeight, a, b)Integrate spectral weight density weight (per cm⁻¹) over wavenumber interval [a, b] (0 <= a <= b in cm⁻¹), preserving exact additivity across contiguous sub-intervals.
For TabulatedWeight, [a, b] must be covered by [first(weight.edges), last(weight.edges)] (throwing ArgumentError if uncovered) and returns 0 when the tabulated density is zero across [a, b]. For normalized sub-band shares that share band_average's FlatWeight fallback and Wien-tail scaling, see subband_weights.
This qualified extension hook is not exported; custom AbstractSpectralWeight subtypes may specialize CanopyOptics.weight_interval_integral to plug into band_average!, CanopyOptics.band_weight!, and subband_weights!.
CanopyOptics.spectral_domain — Function
CanopyOptics.spectral_domain(model) -> (ν_min, ν_max)Return the contiguous wavenumber coverage interval [ν_min, ν_max] in cm⁻¹ of an interval-domain leaf model (LeafProspectProProperties, TabulatedLeaf, or ConstantLeaf), or nothing when coverage must be probed per bin.
This qualified extension hook is not exported. Custom leaf models with a contiguous wavenumber domain can specialize CanopyOptics.spectral_domain(model) so CompositeLeaf evaluates them in a single vectorized slice call; models with non-contiguous domains that leave spectral_domain(model) === nothing may signal an uncovered bin in leaf_spectrum(model, bin_edges) by throwing CanopyOptics.SpectralCoverageError (or returning nothing).
CanopyOptics.SpectralCoverageError — Type
CanopyOptics.SpectralCoverageError(msg)Exception thrown by custom leaf_spectrum implementations (when CanopyOptics.spectral_domain is nothing) to report that a queried bin lies outside the model's spectral coverage.
CompositeLeaf catches SpectralCoverageError (and nothing returns) during per-bin probing and delegates the uncovered bin to subsequent component models, while allowing ArgumentError and all other exceptions from invalid parameters or coefficients to propagate untouched.