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.1 (beta)
=====================

New
---

* This version adds compatibility to the IPython Notebook. A *display* method is introduced for many classes. This one use matplotlib and have the same role than the *plot* method. Calling *display* show figures embedded in the Notebook.

* The source is ported to Pyhton 3.3. This porting is not integral. Because the SPy library run on Python <= 2.7, the spectro module is not part of the porting.

New examples
------------

This version adds compatibility to the IPython Notebook. Five examples present this feature.

* Methanol gas
* Hematite drill core
* Convex hull
* Pine Creek 1
* Pine Creek 2

Fix
---

* Function distance.SID: the division at the line "p = (s1 / np.sum(s1)) and (s2 / np.sum(s2))" is now always real with the inclusion of a "__future__ division" declaration. That was not the case before, but this is a minor problem as cubes are always made of real.

* Function denoise.whiten: the line "S_1_2 = S**-1/2" is changed to "S_1_2 = S**(-0.5)". This is a bug and have a direct impact on the classes Whiten and MNF.

For issues and previous releases see the documentation.