Skip to main content

# 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

Release files for csiro-spectral-tools 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for csiro-spectral-tools 0.2.1
File Size Uploaded
csiro-spectral-tools-0.2.1.tar.gz 129.5 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for csiro-spectral-tools 0.2.1
File
csiro_spectral_tools-0.2.1-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details
csiro_spectral_tools-0.2.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.17+ x86-64 Details
csiro_spectral_tools-0.2.1-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details
csiro_spectral_tools-0.2.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.17+ x86-64, Linux glibc 2.28+ x86-64 Details
csiro_spectral_tools-0.2.1-cp39-cp39-win_amd64.whl CPython 3.9 CPython 3.9 Windows x86-64 Details
csiro_spectral_tools-0.2.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.17+ x86-64, Linux glibc 2.28+ x86-64 Details
csiro_spectral_tools-0.2.1-cp38-cp38-win_amd64.whl CPython 3.8 CPython 3.8 Windows x86-64 Details
csiro_spectral_tools-0.2.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl CPython 3.8 CPython 3.8 Linux glibc 2.17+ x86-64, Linux glibc 2.28+ x86-64 Details

Total release size: 3.0 MB

Release files / csiro-spectral-tools-0.2.1.tar.gz

Download URL csiro-spectral-tools-0.2.1.tar.gz
Size 129.5 kB
Tags Source
SHA-256 checksum
How to use checksums
3d6054147d466f489b2c9dacbb5e1bbe01d4da56b8d60cb3d73fe53ecb89c4d4
BLAKE2b-256 checksum
How to use checksums
84ba60ccd4d5c4fc073429a0012fe01539e025a7e1d793e77c7f5f35d235a8fa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.2

Release files / csiro_spectral_tools-0.2.1-cp311-cp311-win_amd64.whl

Download URL csiro_spectral_tools-0.2.1-cp311-cp311-win_amd64.whl
Size 193.4 kB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
69d5310e345e3f1cb425427aa462e8d5a5b8467d88db25511a20552f329ef90c
BLAKE2b-256 checksum
How to use checksums
2e90d6afe101e11cf79288948b37f5ef56db10269028a0b27f2c272dcd0adf84
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.2

Release files / csiro_spectral_tools-0.2.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL csiro_spectral_tools-0.2.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 535.9 kB
Tags CPython 3.11 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
ce0df2652a3c74661a452cc215d7156683bdb7aaebbeb76d6dd8bc79eae1f2cd
BLAKE2b-256 checksum
How to use checksums
b8f83d17a17b9dc3eacce31666534938c43c17e3af9be70c03bdc0799fb75f5b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.2

Release files / csiro_spectral_tools-0.2.1-cp310-cp310-win_amd64.whl

Download URL csiro_spectral_tools-0.2.1-cp310-cp310-win_amd64.whl
Size 194.0 kB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
09d8ddd0d3ca28212b38c469a758c5082ac86f7e5de3177699067637533d08d9
BLAKE2b-256 checksum
How to use checksums
02b6e9c99f90c7a768bea75b2fbdb4c7d29b657fe7a20d913185f5c316c1c6b6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.2

Release files / csiro_spectral_tools-0.2.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl

Download URL csiro_spectral_tools-0.2.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl
Size 520.6 kB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
4d8b75ed5eb5eb66869bd13c84385f6596fd137a81c3e29ee591d43998ea14a4
BLAKE2b-256 checksum
How to use checksums
902fe82dd1dcab543b213494760c33df373b58cdc0dc1945a3083fdfbd86cea9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.2

Release files / csiro_spectral_tools-0.2.1-cp39-cp39-win_amd64.whl

Download URL csiro_spectral_tools-0.2.1-cp39-cp39-win_amd64.whl
Size 204.1 kB
Tags CPython 3.9 Windows x86-64
SHA-256 checksum
How to use checksums
376fd8de3c0ef60b1b86187f424ad6d12206aa15930a123ad2655b2182f959d8
BLAKE2b-256 checksum
How to use checksums
273038a4da312e86c3c4195b9c091657471960c026be49e4344f2b8d5e88abea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.2

Release files / csiro_spectral_tools-0.2.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl

Download URL csiro_spectral_tools-0.2.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl
Size 524.4 kB
Tags CPython 3.9 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
634fa8f8df7fb129ba1662246309e70750ec70e96fc6668b12144ee62c62a895
BLAKE2b-256 checksum
How to use checksums
99e766ce152f5ade7445bd892b0fe8c0ed1f6219c4a2612879d659663b67b375
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.2

Release files / csiro_spectral_tools-0.2.1-cp38-cp38-win_amd64.whl

Download URL csiro_spectral_tools-0.2.1-cp38-cp38-win_amd64.whl
Size 204.1 kB
Tags CPython 3.8 Windows x86-64
SHA-256 checksum
How to use checksums
6189f9957904c99d95a14ebcccf4b35111ff18ec89490002e20a6697e00ae794
BLAKE2b-256 checksum
How to use checksums
d49b19c07f13fbc1f0d8a3a0f5e7e3c0f1f7b45bb6b52bccce5c9ba48dad3638
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.2

Release files / csiro_spectral_tools-0.2.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl

Download URL csiro_spectral_tools-0.2.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl
Size 528.0 kB
Tags CPython 3.8 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
a37e981033282e2d633b283a7467ec910024b60863faf4a0033527ced8f8bb0f
BLAKE2b-256 checksum
How to use checksums
da7b0011714791be3969cbbeee952e03a71f9eb1e10923188ea86dbc19ea4a4b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.2

Release history Release notifications | RSS feed

This release

0.2.1 This release

9 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page