Add NDSI, NDBI, BAI, MSAVI2, and OSAVI spectral indices#1044
Merged
brendancol merged 5 commits intomasterfrom Mar 21, 2026
Merged
Add NDSI, NDBI, BAI, MSAVI2, and OSAVI spectral indices#1044brendancol merged 5 commits intomasterfrom
brendancol merged 5 commits intomasterfrom
Conversation
Five new indices in xrspatial/multispectral.py with all four backends (numpy, cupy, dask+numpy, dask+cupy): - NDSI: normalized difference snow index (green vs SWIR1) - NDBI: normalized difference built-up index (SWIR1 vs NIR) - BAI: burn area index (spectral distance to charcoal point) - MSAVI2: modified SAVI with self-adjusting soil line - OSAVI: optimized SAVI with fixed L=0.16 NDSI and NDBI reuse existing _normalized_ratio kernels. BAI, MSAVI2, and OSAVI have dedicated kernels.
Tests cover CPU (numpy), Dask+numpy, CuPy, and Dask+CuPy backends for all five indices. Includes uint dtype tests and cross-index consistency checks (NDBI = -NDMI, OSAVI ≈ NDVI for large DN values).
Add BAI, MSAVI2, NDBI, NDSI, OSAVI to multispectral.rst reference docs and README feature matrix (18 indices total, up from 13).
Notebook 35_Spectral_Indices.ipynb with synthetic 5-class scene (snow, urban, burned, vegetation, bare soil) demonstrating all five new spectral indices. Self-contained, no external data.
Keep write-performance benchmark table from master, add 5 new spectral index rows to the Multispectral feature matrix.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Five new spectral indices in the multispectral module (13 → 18). All four backends.
Also adds 32 tests (CPU, Dask, GPU backends plus uint dtype and cross-index consistency checks), API reference docs, README feature matrix entries,
__init__.pyexports, and a user guide notebook with synthetic data.Closes #1037
Test plan