1.3.72
 
Loading...
Searching...
No Matches
FluspectB.cpp File Reference
#include "FluspectB.h"
#include "Context.h"
#include "global.h"
#include <algorithm>
#include <cmath>
#include <limits>

Go to the source code of this file.

Functions

void helios::loadFluspectOptipar (const std::string &xml_path, FluspectOptipar &optipar)
 Load Fluspect-B Optipar coefficients from a Helios spectral-library XML asset.
 
FluspectKernel helios::computeFluspectKernel (const FluspectBiochemistry &biochem, const FluspectOptipar &optipar, float excitation_step_nm=5.f)
 Compute Fluspect-B leaf optics + fluorescence matrices for a single leaf biochemistry.
 

Detailed Description

Implementation of Fluspect-B leaf fluorescence model.

Definition in file FluspectB.cpp.

Function Documentation

◆ computeFluspectKernel()

FluspectKernel helios::computeFluspectKernel ( const FluspectBiochemistry biochem,
const FluspectOptipar optipar,
float  excitation_step_nm = 5.f 
)

Compute Fluspect-B leaf optics + fluorescence matrices for a single leaf biochemistry.

Implements the doubling-method algorithm from fluspect_B_CX.m (SCOPE v2.0). The excitation grid is 400-750 nm at excitation_step_nm spacing (default 5 nm to match SCOPE's int=5 internal resolution). The emission grid is 640-848 nm at 4 nm spacing (Fluspect native; corresponds to wlf = 640:4:850 with MATLAB's inclusive/exclusive endpoint convention yielding 848 as the last sample).

Numerical agreement with MATLAB fluspect_B_CX is to within ~1e-6 per Mf/Mb element given identical Optipar coefficients.

Parameters
[in]biochemLeaf biochemistry inputs.
[in]optiparOptipar coefficients loaded via loadFluspectOptipar.
[in]excitation_step_nmExcitation wavelength grid spacing in nm. Must be > 0. The grid is 400 nm to 750 nm inclusive.
Returns
Filled FluspectKernel. If biochem.fqe <= 0, Mf/Mb are left empty (caller should treat as no fluorescence). Callers that want a quantum-yield-agnostic kernel can pass fqe = 1 and multiply by their own Phi_F externally — this is how RadiationModel uses the kernel so that leaves sharing biochemistry but differing in J/Jmax can share a cached kernel.

Definition at line 209 of file FluspectB.cpp.

◆ loadFluspectOptipar()

void helios::loadFluspectOptipar ( const std::string &  xml_path,
FluspectOptipar optipar 
)

Load Fluspect-B Optipar coefficients from a Helios spectral-library XML asset.

Reads globaldata_vec2 entries named fluspect_optipar_<field> (nr, Kab, Kca, KcaV, KcaZ, Kdm, Kw, Ks, Kant, Kp, Kcbc, phi) from Context global data. If any entries are missing from Context global data but present in the named XML file on disk, loads them first via Context::loadXML.

Parameters
[in]xml_pathAbsolute path to fluspect_B_optipar.xml (resolved by caller).
[out]optiparDestination coefficient set.
Exceptions
helios_runtime_erroron any missing coefficient or grid-mismatch.

Definition at line 189 of file FluspectB.cpp.