Skip to main content

A collection of tools used for working with hyperspectral data

Project description

# csiro-spectral-tools

A very small collection of tools for working with spectral data. Documentation for the various modules can be found in the docs folder. I used to have a class for parsing TSG data but after Ben Chi (https://github.com/FractalGeoAnalytics/pytsg) wrote a much nicer and cleaner version I have adopted his instead. Nice work Ben.

I used to have spectral unmixing routines in here as well but have removed them as they were really a bit (read a LOT) adhoc. They may come back in the future.

There is some documentation that I created with Sphinx but alas I am not that adept at Sphinx. Regardless it can be found in the docs folder

## Pre Installation Requirements (only if you need to build the extension file for doing convex hulls)

  1. setuptools >= 18.0

  2. Cython

    In regard to cython you will probably need to ensure you have a compatible C compiler for your OS. Probably best to take a look at the [Cython documentation](https://cython.readthedocs.io/en/latest/index.html) to see what is required there. Who knows you may already have one installed.

## Installation (assumimg you are not building the Cython extension and are simply using the prebuilt .c and .pyx files)

$ python setup.py install

## What is this?

This package is a small collection of tools that I have developed or had a need for over the years. The primary focus is to work with spectral reflectance data. I have recently gone through it and cleaned it up and dropped a bunch of half finished stuff.

It does have a precompiled cython file in the csiro_spectral_tools/ext folder for performing upper convex hull corections. If you need to compile it yourself then you will need Cython installed and a C compiler. The compiled version is for python 3.10 and a 64 bit system.

I have tried various python only implementations of hull correction routines but haven’t found them to be fast enough. I probably need to look closer at qhull. With that said their is python only hulls routine in the package.

Additionally, if you want to run the feature extraction method then you need to run your routine in a main guard. If you don’t then it will not allow you to use the multiprocessor component. This initself is not a bad thing and for small datasets (<20000 spectra I guess) it probably isn’t needed anyway. If you are extracting features from spectral imagery however then not using the main guard and the main_guard=True keyword in csiro_spectral_tools.extraction.extraction.extract_spectral_features will run noticeably slower due to the large number of samples.

## Whats in the csiro_spectral_tools package?

It is comprised of a number of sub-packages.

  1. ext (package): A Cython implementation for convex hulls.

    The main file is the chulls.pyx file from which the chulls.c and chulls*.pyd is generated. A setup file to regenerate the c and pyd files is also in there. You can directly call the chulls.get_absorption method but its better to use the csiro_spectral_tools.hulls.convexhulls.uc_hulls method instead. This is a wrapper for the chulls one and as such has type hinting etc.

  2. extraction (package): A module for extracting spectral feature information from spectra

    from csiro_spectral_tools.extraction.extraction import extract_spectral_features

  3. io (package): An module with a bunch of convenience spectral data parsers. The parse_numpy one is probably a bit dumb but whatever.

    from csiro_spectral_tools.io import parse_tsg, parse_envi, parse_csv, parse_numpy

  4. python_hulls (package): A pure python implementation of convex hulls (phulls) and a warpper for the cython extension when you really need speed.

    from csiro_spectral_tools.hulls.phull import get_absorption

    or,

    from csiro_spectral_tools.hulls.convexhulls import get_absorption

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

csiro-spectral-tools-0.2.1.tar.gz (129.5 kB view details)

Uploaded Source

Built Distributions

csiro_spectral_tools-0.2.1-cp311-cp311-win_amd64.whl (193.4 kB view details)

Uploaded CPython 3.11 Windows x86-64

csiro_spectral_tools-0.2.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (535.9 kB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

csiro_spectral_tools-0.2.1-cp310-cp310-win_amd64.whl (194.0 kB view details)

Uploaded CPython 3.10 Windows x86-64

csiro_spectral_tools-0.2.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl (520.6 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.28+ x86-64

csiro_spectral_tools-0.2.1-cp39-cp39-win_amd64.whl (204.1 kB view details)

Uploaded CPython 3.9 Windows x86-64

csiro_spectral_tools-0.2.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl (524.4 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.28+ x86-64

csiro_spectral_tools-0.2.1-cp38-cp38-win_amd64.whl (204.1 kB view details)

Uploaded CPython 3.8 Windows x86-64

csiro_spectral_tools-0.2.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl (528.0 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.28+ x86-64

File details

Details for the file csiro-spectral-tools-0.2.1.tar.gz.

File metadata

  • Download URL: csiro-spectral-tools-0.2.1.tar.gz
  • Upload date:
  • Size: 129.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.2

File hashes

Hashes for csiro-spectral-tools-0.2.1.tar.gz
Algorithm Hash digest
SHA256 3d6054147d466f489b2c9dacbb5e1bbe01d4da56b8d60cb3d73fe53ecb89c4d4
MD5 d4cf7bbb445871dc34c2af3d6e1ee305
BLAKE2b-256 84ba60ccd4d5c4fc073429a0012fe01539e025a7e1d793e77c7f5f35d235a8fa

See more details on using hashes here.

File details

Details for the file csiro_spectral_tools-0.2.1-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for csiro_spectral_tools-0.2.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 69d5310e345e3f1cb425427aa462e8d5a5b8467d88db25511a20552f329ef90c
MD5 1cc76988dd7033c26454ab72a92dd6a7
BLAKE2b-256 2e90d6afe101e11cf79288948b37f5ef56db10269028a0b27f2c272dcd0adf84

See more details on using hashes here.

File details

Details for the file csiro_spectral_tools-0.2.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for csiro_spectral_tools-0.2.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ce0df2652a3c74661a452cc215d7156683bdb7aaebbeb76d6dd8bc79eae1f2cd
MD5 482a7a7f55ae5a03ac26fc2c6f540964
BLAKE2b-256 b8f83d17a17b9dc3eacce31666534938c43c17e3af9be70c03bdc0799fb75f5b

See more details on using hashes here.

File details

Details for the file csiro_spectral_tools-0.2.1-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for csiro_spectral_tools-0.2.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 09d8ddd0d3ca28212b38c469a758c5082ac86f7e5de3177699067637533d08d9
MD5 07e7498bf4153764409f106d40644838
BLAKE2b-256 02b6e9c99f90c7a768bea75b2fbdb4c7d29b657fe7a20d913185f5c316c1c6b6

See more details on using hashes here.

File details

Details for the file csiro_spectral_tools-0.2.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for csiro_spectral_tools-0.2.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 4d8b75ed5eb5eb66869bd13c84385f6596fd137a81c3e29ee591d43998ea14a4
MD5 c5ab06b7e59c010f804b1034f7371de2
BLAKE2b-256 902fe82dd1dcab543b213494760c33df373b58cdc0dc1945a3083fdfbd86cea9

See more details on using hashes here.

File details

Details for the file csiro_spectral_tools-0.2.1-cp39-cp39-win_amd64.whl.

File metadata

File hashes

Hashes for csiro_spectral_tools-0.2.1-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 376fd8de3c0ef60b1b86187f424ad6d12206aa15930a123ad2655b2182f959d8
MD5 90c0c4160d197d9741ed7a32de322373
BLAKE2b-256 273038a4da312e86c3c4195b9c091657471960c026be49e4344f2b8d5e88abea

See more details on using hashes here.

File details

Details for the file csiro_spectral_tools-0.2.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for csiro_spectral_tools-0.2.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 634fa8f8df7fb129ba1662246309e70750ec70e96fc6668b12144ee62c62a895
MD5 005b0c558939a0f4712fd53f0a8e3e58
BLAKE2b-256 99e766ce152f5ade7445bd892b0fe8c0ed1f6219c4a2612879d659663b67b375

See more details on using hashes here.

File details

Details for the file csiro_spectral_tools-0.2.1-cp38-cp38-win_amd64.whl.

File metadata

File hashes

Hashes for csiro_spectral_tools-0.2.1-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 6189f9957904c99d95a14ebcccf4b35111ff18ec89490002e20a6697e00ae794
MD5 b18c09459adf7f78ceeff846a6a4b0ae
BLAKE2b-256 d49b19c07f13fbc1f0d8a3a0f5e7e3c0f1f7b45bb6b52bccce5c9ba48dad3638

See more details on using hashes here.

File details

Details for the file csiro_spectral_tools-0.2.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for csiro_spectral_tools-0.2.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a37e981033282e2d633b283a7467ec910024b60863faf4a0033527ced8f8bb0f
MD5 4be4d157df9677f2a40747cd59127f33
BLAKE2b-256 da7b0011714791be3969cbbeee952e03a71f9eb1e10923188ea86dbc19ea4a4b

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