.. image:: https://zenodo.org/badge/DOI/10.5281/zenodo.3585979.svg :target: https://doi.org/10.5281/zenodo.3585979
This is a library of interactive tools and functions for performing linear spectral mixture analysis (LSMA) and spatially adaptive spectral mixture analysis (SASMA).
It supports parallel fully constrained least-squares (FCLS) mixture analysis over multiple processes, allowing for very efficient mapping of endmember abundances, both in the spatially adaptive approach and in regular LSMA.
In detail, the unmixing
module includes tools and functions to support:
For an overview and tutorial on how to use this library, check out the iPython Notebook(s) in the docs/
folder:
Because this is a scientific library, there are complex dependencies that may be difficult to install.
For GNU/Linux systems, particularly Ubuntu, look at install.sh
for a guide on installing the system dependencies required for the Python dependencies.
At this time, installation is intended for development purposes only.
As such, unmixing
should be installed in "editable" mode using pip
; see https://packaging.python.org/distributing/#working-in-development-mode.
From the unmixing
directory, where setup.py
is found::
$ pip install -e .
numpy
scipy
matplotlib
pysptools
GDAL
pykml
scikit-learn
(For SASMA)Many of the core packages, particularly NumPy and SciPy, have wide adoption and use. They also take a lot of time and clock cycles to compile into a virtual environment. Consequently, it is recommended that these libraries be installed globally (system-wide).
Other packages should be installed only in the virtual environment.
To use both system-wide and local packages within a virtual environment, the virtual environment must be set up with the --system-site-packages
option::
sudo apt-get install python3-numpy python3-scipy python3-matplotlib python3-zmq
virtualenv -p /usr/bin/python3.5 --system-site-packages <virtualenv_path>
The local packages can be installed within the virtual environment via pip
::
source /my/virtualenv/bin/activate
pip install -r REQUIREMENTS
Some resources on the dependencies can be found:
matplotlib
http://matplotlib.org/contents.htmlDocumentation on related (but not required) third-party tools can be found:
Many of the tools in this library are designed to work with HSI cubes.
While the raster arrays read in from GDAL are p x m x n
arrays, HSI cubes are n x m x p
arrays, where m
is the row index, n
is the column index, and p
is the spectral band number.
It is important to note that the row index n
corresponds to the latitude while the column index m
corresponds to the longitude.
Thus, the coordinates (n, m)
can be converted directly to a longitude-latitude pair.