Applies dark current subtraction and white reference normalization:
R(x,y,lambda) = (raw - dark) / (white - dark). Values are clamped to
[0, 1] unless clamp = FALSE. Nonfinite input or intermediate values
remain missing and are recorded as invalid; clamping never repairs them.
Arguments
- cube
An hsi_cube object with raw data.
- dark
An hsi_cube object or 3D array representing the dark reference (lens cap measurement).
- white
An hsi_cube object or 3D array representing the white reference (Spectralon panel measurement).
- clamp
Logical. Clamp output to
[0, 1]. DefaultTRUE.- saturation
Optional finite saturation threshold in raw data units. Defaults to
metadata$saturation_valuewhen present; otherwise saturation remains an unresolved QC check.
Value
An hsi_cube object with reflectance values.