Spectral LAS guide

Version 0.1.0 is available on PyPI. Pre-alpha: validate outputs against your acquisition data.

Install from PyPI

python -m pip install spectral-las
# With optional LAZ compression support:
python -m pip install "spectral-las[laz]"

Use Python 3.10–3.12. Matching wheels do not require a Rust toolchain; source builds do.

Python packages

Paint a point cloud

from spectral_las.adapters.headwall import load_flight
from spectral_las.pointcloud import paint_pointcloud

flight = load_flight(
    "flight_directory",
    crs="EPSG:32619",
    height_datum="ellipsoidal",
    gps_utc_offset_seconds=18.0,  # Example: verify for your acquisition epoch.
)
paint_pointcloud(flight, "input.las", "painted.las")

Output: LAS, a row-aligned spectra array, and a completion manifest. Coordinates and heights must match the declared flight references. Check the repository README and source configuration for acquisition-specific conventions.

Image expressions

from spectral_las.raster import calculate_bands
calculate_bands("image.tif", "index.tif", {"ndvi": "(nir-red)/(nir+red)"},
                {"red": 30, "nir": 50})

All public spectral indices are zero-based. Choose bands matching your actual wavelengths; these indices are examples, not a sensor-specific prescription.

Rasterize spectral attributes

from spectral_las.raster import rasterize_pointcloud
rasterize_pointcloud("painted.las", "mean.tif", resolution=0.2,
                     fields=("hs:10", "hs:30"), reducer="mean")

Reducers include mean, min, max and finite-observation count. Scratch disk grows with selected data. A value_transform callback acts before cell reduction; calculate a raster expression afterward for post-reduction band math.

Current limits

Source documentation

Read the root README, website/README.md and the package source in the repository. The website is a static guide; its point-cloud scene is synthetic and does not execute Spectral LAS.

Back to the project website