Skip to main content

Hyperspectral data analysis and machine learning

Project description

hypers

Build Status Documentation Status Python Version 3.5 Python Version 3.6 PyPI version

hypers provides a data structure in python for hyperspectral data. The data structure includes:

  • Tools for processing and exploratory analysis of hyperspectral data
  • Interactive hyperspectral viewer (using PyQt) that can be accessed as a method from the object
  • Allows for unsupervised machine learning directly on the object

The data structure is built on top of the numpy ndarray, and this package simply adds additional functionality that allows for quick analysis of hyperspectral data. Importantly, this means that the object can still be used as a normal numpy array.

Please note that this package is currently in pre-release. It can still be used, however there is likely to be significant changes to the API. The first public release will be v0.1.0.

Contents

  1. Installation
  2. Features
  3. Examples
  4. Documentation
  5. License
  6. References

Installation

To install using pip:

pip install hypers

The following packages will also be installed:

  • numpy
  • matplotlib
  • scipy
  • scikit-learn
  • PyQt5
  • pyqtgraph

Features

Features implemented in hypers include:

  • Clustering
  • Decomposition (e.g. PCA, ICA, NMF)
  • Hyperspectral viewer
  • Vertex component analysis
  • Gaussian mixture models

A full list of features can be found here.

Examples

Hyperspectral dimensionality reduction and clustering

Below is a quick example of using some of the features of the package on a randomized hyperspectral array. For an example using the IndianPines dataset, see the Jupyter notebook in the examples directory.

import numpy as np
import hypers as hp

# Generating a random 4-d dataset and creating a Dataset instance
# The test dataset here has spatial dimensions (x=200, y=200, z=10) and spectral dimension (s=1024)
test_data = np.random.rand(200, 200, 10, 1024)
X = hp.array(test_data)

# Using Principal Components Analysis to reduce to first 5 components
# The variables ims, spcs are arrays of the first 5 principal components for the images, spectra respectively
ims, spcs = X.decompose.pca.calculate(n_components=5)

# Clustering using K-means (with and without applying PCA first)
# The cluster method will return the labeled image array and the spectrum for each cluster
lbls_nodecompose, spcs_nodecompose = X.cluster.kmeans.calculate(
    n_clusters=3,
    decomposed=False
)

# Clustering on only the first 5 principal components
lbls_decomposed, spcs_decomposed = X.cluster.kmeans.calculate(
    n_clusters=3,
    decomposed=True,
    pca_comps=5
)

Interactive viewer

The interactive viewer can be particularly helpful for exploring a completely new dataset for the first time to get a feel for the type of data you are working with. An example from a coherent anti-Stokes Raman (CARS) dataset is shown below:

Documentation

The docs are hosted here.

License

hypers is licensed under the OSI approved BSD 3-Clause License.

References

  1. VCA algorithm
    J. M. P. Nascimento and J. M. B. Dias, "Vertex component analysis: a fast algorithm to unmix hyperspectral data," in IEEE Transactions on Geoscience and Remote Sensing, 2005
    Adapted from repo.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hypers-0.0.12.1.tar.gz (14.7 kB view details)

Uploaded Source

Built Distribution

hypers-0.0.12.1-py3-none-any.whl (34.2 kB view details)

Uploaded Python 3

File details

Details for the file hypers-0.0.12.1.tar.gz.

File metadata

  • Download URL: hypers-0.0.12.1.tar.gz
  • Upload date:
  • Size: 14.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/39.1.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.4

File hashes

Hashes for hypers-0.0.12.1.tar.gz
Algorithm Hash digest
SHA256 0732cdd7ba795d6e6ccad5c59c06007a36bd48f3d9e7a53ad30ec21138a90725
MD5 e5a557da24fb76d8fbc01b8a34e41567
BLAKE2b-256 fe1b6940ef95b3d273f4f36a58ca601dc0c16be9f8c84c56347cbc58a6e814f4

See more details on using hashes here.

File details

Details for the file hypers-0.0.12.1-py3-none-any.whl.

File metadata

  • Download URL: hypers-0.0.12.1-py3-none-any.whl
  • Upload date:
  • Size: 34.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/39.1.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.4

File hashes

Hashes for hypers-0.0.12.1-py3-none-any.whl
Algorithm Hash digest
SHA256 214ad1be70d3d495e2c6eceab8376929c5ce48272e8354ee9e63a4d2cc204220
MD5 3e8fba5016482adf928f762e8d4de32d
BLAKE2b-256 7fcd4e392e479f5d1a13b7ca57b1d875fec03c4a6596962edde50650ef0e8b42

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page