arthur-e / unmixing

Interactive tools for spectral mixture analysis of multispectral raster data in Python

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Vectorize forward model of reflectance

arthur-e opened this issue · comments

Currently, the function to predict reflectance from abundances operates on an entire matrix.

https://github.com/arthur-e/unmixing/blob/master/unmixing/lsma.py#L523

It's pretty fast, but I think it would be more appropriate to vectorize this function. It can then be applied against only the subset of samples that are used in calculating the RMSE between actual and predicted reflectance.

https://github.com/arthur-e/unmixing/blob/master/unmixing/lsma.py#L621

This has been fixed. The predict_spectra_from_abundance() function now returns a (p x (m*n)) matrix of predicted reflectance for p abundance estimates. This matrix form is not consistent with HSI form, but consistency will have to be addressed later.