Cost function for fitting Fluspect leaf parameters to measured reflectance/transmittance
get.COST_4Fluspect.for.SCOPE.Rdget.COST_4Fluspect.for.SCOPE builds the residual vector between
simulated and measured leaf reflectance/transmittance for a given
parameter vector, intended for use inside a non-linear least-squares
optimizer when calibrating leaf biochemistry/structure parameters against
measured spectra. Note: this function calls an unqualified
fluspect_B_CX_PSI_PSII_combined(), which is neither defined in this
package nor exported by ToolsRTM - it will fail with "could not find
function" until that dependency is resolved. Not exported; needs review
before use.
Arguments
- params
numeric vector of length 8, in order: Cab, Cdm, Cw, Cs, Cca, Cant, Cx, N - candidate leaf biochemistry/structure parameters.
- measurement
list. Measured spectra, with elements
refl,tran(measured reflectance/transmittance) andstd(measurement uncertainty), all as a function of wavelength.- input
list of length 6:
leafbio(baseline leaf parameters),optipar(Fluspect optical parameters),spectral(spectral configuration, includingwlPmodel wavelengths andwlMmeasurement wavelengths),include(list of 0/1 flags selecting which parameters inparamsare actually varied),target(character,"0"for combined reflectance+transmittance residuals,"1"for reflectance only, otherwise transmittance only), andrange(list withwlmin/wlmaxdefining the wavelength range used to compute residuals).