arthur-e / unmixing

Interactive tools for spectral mixture analysis of multispectral raster data in Python
MIT License
105 stars 24 forks source link

Vectorize forward model of reflectance #5

Closed arthur-e closed 7 years ago

arthur-e commented 7 years ago

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

arthur-e commented 7 years ago

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.