Skip to content

Tutorial: Add a Mineral Reference

VIS-only mineral matching is hypothesis ranking. Good references matter more than clever scoring.

Reference Entry Shape

{
  "name": "Local hematite sample A",
  "group": "mineral",
  "kind": "reflectance",
  "wavelengths_nm": [400, 450, 500, 550],
  "values": [0.08, 0.10, 0.13, 0.18],
  "metadata": {
    "source": "local measurement",
    "geometry": "45/0 handheld reflectance",
    "calibration": "white tile 2026-05-31"
  }
}

Match Against a Custom Library

from lux.library import load_json_library
from lux.modules.minerals import identify_mineral

library = load_json_library("my_minerals.json")
result = identify_mineral(reflectance_spectrum, library=library, metric="continuum_correlation")

Metadata to Preserve

  • source and license
  • instrument and module
  • illumination geometry
  • wavelength resolution
  • preprocessing
  • reference tile or blank
  • sample preparation