Abundance Maps

Following algorithms are available to generate and plot abundance maps. Each of these algorithms come in two flavors, as functions or as classes.

See also

See the file test_eea.py for an example.

Unconstrained Least Squares (UCLS)

Function

pysptools.abundance_maps.amaps.UCLS(M, U)[source]

Performs unconstrained least squares abundance estimation.

Parameters:
  • Mnumpy array 2D data matrix (N x p).
  • Unumpy array 2D matrix of endmembers (q x p).
Returns: numpy array
An abundance maps (N x q).

Class

class pysptools.abundance_maps.UCLS[source]

Performs unconstrained least squares abundance estimation.

display(mask=None, interpolation='none', colorMap='jet', columns=None, suffix=None)

Display the abundance maps to a IPython Notebook.

Parameters:
  • masknumpy array [default None] A binary mask, when True the selected pixel is displayed.
  • interpolationstring [default none] A matplotlib interpolation method.
  • colorMapstring [default jet] A matplotlib color map.
  • columnsint [default None] Display all the images in one figure organized by columns.
  • suffixstring [default None] Suffix to add to the title.
map(M, U, normalize=False, mask=None)

Performs unconstrained least squares abundance estimation on the HSI cube M using the spectral library U.

Parameters: M: numpy array

A HSI cube (m x n x p).
U: numpy array
A spectral library of endmembers (q x p).
normalize: boolean [default False]
If True, M and U are normalized before doing the spectra mapping.
mask: numpy array [default None]
A binary mask, when True the selected pixel is unmixed.
Returns: numpy array
An abundance maps (m x n x q).
plot(path, mask=None, interpolation='none', colorMap='jet', columns=None, suffix=None)

Plot the abundance maps.

Parameters:
  • pathstring The path where to put the plot.
  • masknumpy array [default None] A binary mask, when True the selected pixel is displayed.
  • interpolationstring [default none] A matplotlib interpolation method.
  • colorMapstring [default jet] A matplotlib color map.
  • columnsint [default None] Display all the images in one figure organized by columns.
  • suffixstring [default None] Suffix to add to the file name.

Non-negative Constrained Least Squares (NNLS)

Function

pysptools.abundance_maps.amaps.NNLS(M, U)[source]

NNLS performs non-negative constrained least squares of each pixel in M using the endmember signatures of U. Non-negative constrained least squares with the abundance nonnegative constraint (ANC). Utilizes the method of Bro.

Parameters:
  • Mnumpy array 2D data matrix (N x p).
  • Unumpy array 2D matrix of endmembers (q x p).
Returns: numpy array
An abundance maps (N x q).

References

Bro R., de Jong S., Journal of Chemometrics, 1997, 11, 393-401.


Class

class pysptools.abundance_maps.NNLS[source]

NNLS performs non-negative constrained least squares with the abundance nonnegative constraint (ANC). Utilizes the method of Bro.

display(mask=None, interpolation='none', colorMap='jet', columns=None, suffix=None)

Display the abundance maps to a IPython Notebook.

Parameters:
  • masknumpy array [default None] A binary mask, when True the selected pixel is displayed.
  • interpolationstring [default none] A matplotlib interpolation method.
  • colorMapstring [default jet] A matplotlib color map.
  • columnsint [default None] Display all the images in one figure organized by columns.
  • suffixstring [default None] Suffix to add to the title.
map(M, U, normalize=False, mask=None)

NNLS performs non-negative constrained least squares of each pixel in M using the endmember signatures of U.

Parameters: M: numpy array

A HSI cube (m x n x p).
U: numpy array
A spectral library of endmembers (q x p).
normalize: boolean [default False]
If True, M and U are normalized before doing the spectra mapping.
mask: numpy array [default None]
A binary mask, when True the selected pixel is unmixed.
Returns: numpy array
An abundance maps (m x n x q).
plot(path, mask=None, interpolation='none', colorMap='jet', columns=None, suffix=None)

Plot the abundance maps.

Parameters:
  • pathstring The path where to put the plot.
  • masknumpy array [default None] A binary mask, when True the selected pixel is displayed.
  • interpolationstring [default none] A matplotlib interpolation method.
  • colorMapstring [default jet] A matplotlib color map.
  • columnsint [default None] Display all the images in one figure organized by columns.
  • suffixstring [default None] Suffix to add to the file name.

Fully Constrained Least Squares (FCLS)

Function

pysptools.abundance_maps.amaps.FCLS(M, U)[source]

Performs fully constrained least squares of each pixel in M using the endmember signatures of U. Fully constrained least squares is least squares with the abundance sum-to-one constraint (ASC) and the abundance nonnegative constraint (ANC).

Parameters:
  • Mnumpy array 2D data matrix (N x p).
  • Unumpy array 2D matrix of endmembers (q x p).
Returns: numpy array
An abundance maps (N x q).

References

Daniel Heinz, Chein-I Chang, and Mark L.G. Fully Constrained Least-Squares Based Linear Unmixing. Althouse. IEEE. 1999.

Notes

Three sources have been useful to build the algorithm:

Class

class pysptools.abundance_maps.FCLS[source]

Performs fully constrained least squares. Fully constrained least squares is least squares with the abundance sum-to-one constraint (ASC) and the abundance nonnegative constraint (ANC).

display(mask=None, interpolation='none', colorMap='jet', columns=None, suffix=None)

Display the abundance maps to a IPython Notebook.

Parameters:
  • masknumpy array [default None] A binary mask, when True the selected pixel is displayed.
  • interpolationstring [default none] A matplotlib interpolation method.
  • colorMapstring [default jet] A matplotlib color map.
  • columnsint [default None] Display all the images in one figure organized by columns.
  • suffixstring [default None] Suffix to add to the title.
map(M, U, normalize=False, mask=None)

Performs fully constrained least squares of each pixel in M using the endmember signatures of U.

Parameters: M: numpy array

A HSI cube (m x n x p).
U: numpy array
A spectral library of endmembers (q x p).
normalize: boolean [default False]
If True, M and U are normalized before doing the spectra mapping.
mask: numpy array [default None]
A binary mask, when True the selected pixel is unmixed.
Returns: numpy array
An abundance maps (m x n x q).
plot(path, mask=None, interpolation='none', colorMap='jet', columns=None, suffix=None)

Plot the abundance maps.

Parameters:
  • pathstring The path where to put the plot.
  • masknumpy array [default None] A binary mask, when True the selected pixel is displayed.
  • interpolationstring [default none] A matplotlib interpolation method.
  • colorMapstring [default jet] A matplotlib color map.
  • columnsint [default None] Display all the images in one figure organized by columns.
  • suffixstring [default None] Suffix to add to the file name.