Presentation
============

PySptools is the Python Spectral Tools project. It is hosted on
http://sourceforge.net/projects/pysptools/

You can go to the online documentation at http://pysptools.sourceforge.net/. The online documentation is updated regularly.

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. Speed improvement is a medium term goal.

Dependencies
============

    * Python 2.7 or 3.3
    * Numpy, required
    * Scipy, required
    * scikit-learn, required
    * SPy, required (for Python 2.7)
    * Matplotlib, required
    * CVXOPT, optional, to run FCLS
    * IPython, optional, if you want to use the display feature

For Python 2.7:

The library is developed on the Windows platform, with: Python 2.7.5, 64 bits, numpy 1.8.2,
scipy 0.12.0, SPy 0.11, Matplotlib 1.3.1, scikit-learn 0.13.1, CVXOPT 1.1.6 and IPython 2.2.0.

For Python 3.3:

The library is developed on the Windows platform, with: Python 3.3.5, 64 bits, numpy 1.8.1,
scipy 0.13.3, Matplotlib 1.3.1, scikit-learn 0.15, CVXOPT 1.1.7 and IPython 2.2.0.

Installation
============

From version 0.12.1, PySptools can run under Python 2.7 and 3.3. It has been tested for these versions but can probably run under others Python versions.

Note: The porting under Python 3.3 is not integral. Because the SPy library run on Python <= 2.7 and as the spectro module use SPy, the spectro module is not part of the porting.

Note: The HSI cubes are, in general, large and the 64 bits version of Python is recommended.

The latest release is available at these download sites:

* pypi https://pypi.python.org/pypi/pysptools
* sourceforge http://sourceforge.net/projects/pysptools/ 
* softpedia http://www.softpedia.com/get/Science-CAD/PySptools.shtml

Manual installation
-------------------

To install download the sources, expand it in a directory and add the path of
the pysptools-0.xx.x directory to the PYTHONPATH system variable.

Distutils installation
----------------------

You can use Distutils (new for version 0.08 and above). Expand the sources in a directory,
go to the pysptools-0.xx.x directory and at the command prompt type 'python setup.py install'.
To uninstall the library, you have to do it manually. Go to your python installation. In the
Lib/site-packages folder simply removes the associated pysptools folder and files.

Using the faster version of NFINDR
----------------------------------

The algorithm NFINDR have a cython version. This cython version run two times faster than the pure Python version. It is compiled for Windows 7 (maybe it work for vista and 8),
64 bits and the official Python 2.7 64 bits release. If it is your case, download
NFINDR_win_amd64-py2.7.zip, unzip and copy the nfindr.pyd file
to your installation in the endmembers extraction algorithms folder, something like lib\\site-packages\\pysptools\\eea
You can find this file on the sourceforge download site. To have more information on nfindr.pyd read the eea module documentation.


Algorithms sources
==================

Matlab Hyperspectral Toolbox by Isaac Gerg, visit:
http://sourceforge.net/projects/matlabhyperspec/

The piecewise constant toolbox (PWCTools) by Max A. Little, visit:
http://www.maxlittle.net/software/

The Endmember Induction Algorithms toolbox (EIA), visit:
http://www.ehu.es/ccwintco/index.php/Endmember_Induction_Algorithms (broken?)

HySime by Bioucas-Dias and Nascimento, visit:
http://www.lx.it.pt/~bioucas/code.htm 

and others.


To run the test cases, download data1 and expand it in the pysptools directory.

In hope that this program is usefull.

Christian Therien
ctherien@users.sourceforge.net


Release notes
=============

version 0.12.2 (beta)
=====================

This is a maintenance version: code review, bugs fix, classes refactoring and many small improvements that have not a direct impact on the functionality.

New
---

* Full Python 3.3 compatibility. However, there is a drawback, as the SPy software ENVI file reader is not ported to Python 3.3, instead, pysptools use a JSON version for the USGS spectral library. See the spectro module documentation.

* The scikit-learn KMeans class is wrapped to make it user-friendly when applied to a HS cube. This new class live in the classification module.

* A new Pine Creek example.

For issues and previous releases see the documentation.