Skip to content

spectral-library

Prepared Spectral Mapping

Map between sensors. Reconstruct spectra. Keep the runtime stable.

`spectral-library` is a Python package and CLI for preparing row-aligned mapping runtimes from SIAC-style hyperspectral exports, retrieving nearest spectral neighbors, simulating target-sensor reflectance, and reconstructing VNIR, SWIR, or full `400-2500 nm` spectra.

Get Started See Official Examples Read The Theory

What This Site Covers

The public documentation is organized around one practical flow: prepare a runtime, validate it, map reflectance, and understand the retrieval model well enough to trust the outputs.

  • 1. Prepare

Build a compact prepared runtime from a SIAC-style spectral library and one or more sensor SRF definitions.

Prepared runtime workflow

  • 2. Map

Run single-sample or batch mapping to a target sensor, or reconstruct VNIR, SWIR, or the full hyperspectral spectrum.

CLI mapping examples

  • 3. Understand

Follow the exact forward model, retrieval distance, overlap blending, and benchmark definitions used by the implementation.

Mathematical foundations

Start Here

Public Documentation Map

Guides

  • Getting Started for installation, runtime preparation, validation, single-sample mapping, batch mapping, and minimal Python usage
  • Official Sensor Examples for reproducible examples and figures built from official MODIS, Sentinel-2A, Landsat 8, and Landsat 9 spectral response functions
  • Troubleshooting for common issues, confidence score interpretation, and KNN backend selection

Concepts

Reference

  • CLI Reference for the public commands, required flags, CSV layouts, and outputs
  • Python API Reference for the stable imports, result objects, and public errors
  • FAQ for answers to common questions

Project

Package Facts

Distribution`spectral-library`
Import`spectral_library`
CLI`spectral-library`
Python`3.9` to `3.14`

Repository Layout

The repository code is split into four top-level package areas:

  • spectral_library.mapping public mapping runtime, prepared-runtime build, and retrieval engine
  • spectral_library.distribution runtime download helpers
  • spectral_library.sources maintainer-oriented source manifests, fetchers, fetch batching, and catalog assembly
  • spectral_library.normalization maintainer-oriented normalization, coverage filtering, quality plots, and SIAC package export

Public vs internal material

This site includes a small internal section for maintainers. If you are using the package, you can ignore the internal build/design pages and stay within the Start Here, Concepts, and Reference sections.