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
spectral_las.pointcloud: LAS chunks, transforms, statistics, RGB and spectral painting.spectral_las.raster: image windows, band operations, rasterization and mosaics.spectral_las.adapters: vendor files translated into explicit flight configuration.
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
- Native fusion reads little-endian float32 ENVI cubes with zero header offset.
- The geometry is the supplied pushbroom model, not an arbitrary-camera engine.
- Point-sampled visibility is not continuous-surface occlusion.
- The global painting depth map remains in RAM. Orthomosaics use a capped but in-memory surface.
- Original interpolation and tile-edge splatting require acquisition-level validation.
- PyPI availability and packaging checks do not establish processing accuracy, broad sensor coverage or benchmark performance.
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.