Skip to content

Add spectral transforms (PCA, MNF, Tasseled Cap, pan-sharpening) #1139

@brendancol

Description

@brendancol

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.linalg for 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions