earth-chris / earthlib-legacy

Spectral endmembers and unmixing tools for satellite land cover mapping.
https://earth-chris.github.io/earthlib
MIT License
24 stars 3 forks source link

Add shade normalization #26

Closed earth-chris closed 3 years ago

earth-chris commented 3 years ago

This PR re-factored the unmixing code to create a dedicated fractionalCover() function, which includes a keyword argument for shade_normalize=True.

The re-factoring was important because the helper functions (e.g. earthlib.Unmix.SVN()) were all using 'ravioli' code that would have to be edited or updated across each function every time a change was made. Re-factoring now allows for easily implementing new features like keyword arguments.

The shade normalization function adds an array of 0 values as a new spectral endmember to account for brightness differences between shaded and unshaded pixels. Dividing by the estimated shade fraction rescales all the remaining values to sum to one.

Closes #25

earth-chris commented 3 years ago

PR #25 includes a mention of implementing brightness normalization as well. This can be punted to later.