Add spectral transforms (PCA, MNF, Tasseled Cap, pan-sharpening)
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 30/100
Research direction
No files, tests, or entry points are named. Start by reviewing the existing xarray-spatial raster APIs and the dask and numba patterns relevant to stacked DataArrays. Done requires defining and implementing the requested transforms, including built-in Tasseled Cap coefficients, while preserving the stated input and output format.
Written by the indexing model from the issue text.
Description
Multi-band and hyperspectral analysis needs dimensionality reduction and spectral transforms. xarray-spatial doesn't have any of these right now.
Scope
PCA on multi-band rasters. Standard principal component analysis across the band dimension. Useful for reducing dimensionality, identifying variance structure, and creating decorrelated bands for visualization or classification.
Minimum Noise Fraction (MNF) transform. Two-step PCA that first whitens the noise, then extracts signal components. The go-to for hyperspectral noise reduction and data exploration.
Tasseled Cap transformation. Fixed linear combinations that produce Brightness, Greenness, and Wetness bands. Should ship with built-in coefficients for at least Landsat 8/9 and Sentinel-2. Users should also be able to supply custom coefficient matrices.
Linear spectral unmixing. Given user-supplied endmember spectra, solve for per-pixel fractional abundances. Returns one fraction image per endmember.
Pan-sharpening. Fuse a high-resolution panchromatic band with lower-resolution multispectral bands. At minimum the Brovey transform (simple, fast). Gram-Schmidt would be a good addition for better spectral fidelity.
Design considerations
- All functions should accept stacked DataArrays with a band dimension and return stacked DataArrays in the same format.
- PCA and MNF are the hardest to distribute via dask because they need global covariance matrices. Two options: use dask's own
da.linalgfor the covariance/eigen decomposition, or use a sample-based approximation that avoids a full pass over the data. - Tasseled Cap and Brovey are per-pixel linear operations, so they parallelize trivially with
map_blocks. - Spectral unmixing is per-pixel too (constrained least-squares per pixel), but the solve step is heavier. GPU acceleration with cupy would help.
- Dominant language
- Python
- Stars
- 972
- Forks
- 92
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 7
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from xarray-contrib/xarray-spatial
-
Difficulty 1/5 Under an hour Newbie friendliness 68/100
xarray-contrib/xarray-spatial#3726 ·
-
api area:surface bug severity:medium sweep-api-consistency
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
xarray-contrib/xarray-spatial#3712 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
xarray-contrib/xarray-spatial#3710 ·
-
bug
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
xarray-contrib/xarray-spatial#3707 ·
-
area:surface documentation user-guide-example
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
xarray-contrib/xarray-spatial#3464 ·
All issues in xarray-contrib/xarray-spatial
Similar issues
-
link-check link-check:sphinx-theme
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
qgis/QGIS-Documentation#11275 ·
-
bug priority:normal ready-for-dev
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
OpenHands/extensions#626 · 1 comment ·
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
CSCfi/sd-search-api#39 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100