Commit 35d8253
authored
Add NDSI, NDBI, BAI, MSAVI2, and OSAVI spectral indices (#1044)
* Add NDSI, NDBI, BAI, MSAVI2, and OSAVI spectral indices (#1037)
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.
* Add tests for NDSI, NDBI, BAI, MSAVI2, and OSAVI (#1037)
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 docs and README entries for new spectral indices (#1037)
Add BAI, MSAVI2, NDBI, NDSI, OSAVI to multispectral.rst reference
docs and README feature matrix (18 indices total, up from 13).
* Add user guide notebook for NDSI, NDBI, BAI, MSAVI2, OSAVI (#1037)
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.1 parent 40fa429 commit 35d8253
File tree
7 files changed
+1432
-2
lines changed- docs/source/reference
- examples/user_guide
- images
- xrspatial
- tests
7 files changed
+1432
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
299 | 299 | | |
300 | 300 | | |
301 | 301 | | |
| 302 | + | |
302 | 303 | | |
303 | 304 | | |
304 | 305 | | |
| 306 | + | |
305 | 307 | | |
306 | 308 | | |
| 309 | + | |
307 | 310 | | |
| 311 | + | |
308 | 312 | | |
309 | 313 | | |
310 | 314 | | |
| 315 | + | |
311 | 316 | | |
312 | 317 | | |
313 | 318 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
14 | 21 | | |
15 | 22 | | |
16 | 23 | | |
| |||
32 | 39 | | |
33 | 40 | | |
34 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
35 | 49 | | |
36 | 50 | | |
37 | 51 | | |
| |||
46 | 60 | | |
47 | 61 | | |
48 | 62 | | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
49 | 70 | | |
50 | 71 | | |
51 | 72 | | |
52 | 73 | | |
53 | 74 | | |
54 | 75 | | |
55 | 76 | | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
56 | 84 | | |
57 | 85 | | |
58 | 86 | | |
| |||
74 | 102 | | |
75 | 103 | | |
76 | 104 | | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
77 | 112 | | |
78 | 113 | | |
79 | 114 | | |
| |||
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| 69 | + | |
69 | 70 | | |
70 | 71 | | |
| 72 | + | |
71 | 73 | | |
| 74 | + | |
| 75 | + | |
72 | 76 | | |
73 | 77 | | |
| 78 | + | |
74 | 79 | | |
75 | 80 | | |
76 | 81 | | |
| |||
0 commit comments