This vignette demonstrates the package’s ENVI and calibration interfaces using synthetic data. Device support tests use fixtures and SDK mocks; real camera sessions remain an external validation requirement. Read wavelength, FWHM, processing mode and acquisition settings from each recording. Do not infer them from a model name or this demonstration’s defaults.
After exporting from CUVIS Export to ENVI format:
# Read the ENVI header + binary pair
cube <- hs_read_envi("path/to/measurement.hdr")
# Or use the auto-detect reader
cube <- hs_read_cube("path/to/measurement.hdr")For this vignette we use synthetic data:
cube <- hs_simulate_cube(rows = 30, cols = 30, seed = 42)
print(cube)
#>
#> ── hsi_cube ────────────────────────────────────────────────────────────────────
#> Dimensions: 30 rows x 30 cols x 61 bands
#> Wavelengths: 430-910 nm (61 bands)
#> FWHM: 25 nm (mean)
#> Mask: 900/900 valid pixels (100%)
#> Data range: [0.0198, 0.7306]
#> Metadata: camera, spectral_model, interpretation, processing_mode,
#> acquisition_time, region_map, sto2_ground_truth, seedApply dark current subtraction and white reference normalization:
# Simulate dark and white references
dark_data <- array(0.02, dim(cube$data))
white_data <- array(0.95, dim(cube$data))
dark <- hsi_cube(dark_data, cube$wavelengths)
white <- hsi_cube(white_data, cube$wavelengths)
# Demonstrate the calibration arithmetic (these references are synthetic)
calibrated <- hs_calibrate(cube, dark, white)
range(calibrated$data)
#> [1] 0.000000 0.764044