Welcome to the PySptools Documentation¶
Tools for hyperspectral imaging
Documentation at 2016-03-26.
Hyperspectral imaging is used to visualize chemistry, the spatial relation between chemicals and the proportion of them. PySptools is a python module that implements spectral and hyperspectral algorithms. Specializations of the library are the endmembers extraction, unmixing process, supervised classification, target detection, noise reduction, convex hull removal and features extraction at spectrum level. The library is designed to be easy to use and almost all functionality has a plot function to save you time with the data analysis process. The actual sources of the algorithms are the Matlab Hyperspectral Toolbox of Isaac Gerg, the pwctools of M. A. Little, the Endmember Induction Algorithms toolbox (EIA), the HySime Matlab module of José Bioucas-Dias and José Nascimento and science articles. You can download PySptools from the PySptools Project Page hosted by Sourceforge.net or from the pypi packages repository.
What’s New : version 0.13.5 (beta)¶
It’s mainly a maintenance version with a few fixes. Following is a list of the new features.
- The project is now on gitub, and, as usual, the stable release is on pypi and sourceforge.
- The project documentation is reorganized, tanks to Sasank Chilamkurthy.
- A __str__ method is added to the abundance_maps, classification, detection and eea modules classes.
- A new parameter ‘mask’ is added to the classify method of the classification module classes. And the same to the extract method of the eea module classes. For NFINDR and ATGP the code is reorganized accordingly. The mask is a binary one. Only the selected pixels by the mask are used. The motivation is to improve performance when we work in a region of the hyperspectral cube.
- To the methods plot_components and display_components of the MNF class, a colorMap parameter is added and the interpolation is now set to ‘none’ by default.
- The cython version for the NFINDR algorithm is removed from the pysptools development path. It is now in is own project. Follow the link eealgo
- Clean up of the DATA file. The DATA fike contains the data to run the tests suite. The new version is put on the sourceforge site. Follow the link data file
See the release notes section.
Examples¶
A simple comparaison between ATGP and NFINDR.
Methanol gas synthetic images made by unmixing. The data used for the demonstration is acquired with a Telops Hyper-Cam instrument.
Quartz classification of a drill core datacube. The data used for the demonstration is acquired with a Telops Hyper-Cam instrument.
Smokestack effluents analysis. The data used for the demonstration is acquired with a Telops Hyper-Cam instrument.
Some examples of convex hull removal and features extraction.
Regarding Numerical Stability¶
After running many tests we can observe that most of the algorithms in this library are numerically stable. But not all! Problems are with FCLS and SVC. I didn’t investigate in deep but here I present some observations and how to work around the problem.
These problems are not critical and with a good Python configuration, thanks to Anaconda, we can pass over. With a MKL based Python distribution, if we run the Pine Creek example 2 many times, we observe a cyclic output from FCLS. And from one cycle to another (it exist 2 cycles for example 2), the rendering of the abundances maps is not the same. If we run the same example with a openBLAS based Python distribution the cycling disappear and the abundances maps stay the same at each run. I observed something similar with SVC but it’s more complex to analyses.
The solution is to avoid MKL and use openBLAS when running FCLS or SVC. This can be done easily with the new Anaconda version 2.5 (older public Anaconda versions are openBLAS only). To setup your environment to openBLAS see the article of Dr. Ilan Schnell on the Anaconda developer blog: anaconda-25-release-now-mkl-optimizations
Except for these two algorithms, MKL can be used without any problem.
Documentation¶
- Introduction
- Installing PySptools
- Examples
- Abundance maps
- Classification
- Detection
- Distance functions
- Endmembers Extraction Algorithms (EEA)
- Material Count
- Denoising
- Signal processing
- Spectro Function and Classes
- Utility Functions and Classes
- Glossary
- Release notes
- Version 0.13.5 (beta)
- Version 0.13.3 (beta) and version 0.13.4 (beta)
- Version 0.13.2 (beta)
- Version 0.13.1 (beta)
- Version 0.13.0 (beta)
- version 0.12.2 (beta)
- version 0.12.1 (beta)
- version 0.12.0 (beta)
- version 0.11.0 (beta)
- version 0.10.1 (beta)
- version 0.10 (beta)
- version 0.09 (alpha)
- version 0.08 (alpha)
- version 0.07 (alpha)
- version 0.06 (alpha)
- version 0.05 (alpha)
- version 0.04 (alpha)
- version 0.03 (alpha)
- version 0.02 (alpha)
- version 0.01 (alpha)
- Bug fixes (old)
- Links