Skip to main content

🛰️ reflspeckit

⚙️ A modern toolkit for working with any and all flavors of spectral data with a focus on applications for reflectance/emittance imaging spectroscopy


PyPI - Python Version PyPI - License PyPI - Version


🧠 What is reflspeckit?

reflspeckit is a lightweight, modular Python package designed to make analysis of spectral data cubes simple, flexible, and fun. Whether you're exploring planetary hyperspectral data, performing band analysis, or building your own spectral pipelines — this toolkit’s got you covered.


⚙️ Package Structure

reflspeckit provides two primary classes for the analysis of spectral data plus a third class specialized for large datasets:

  • 📄Spec1D - handles 1-dimensional, single spectrum data
  • 📒Spec3D - handles 3-dimensional spectral image cubes
  • 🗄️StreamingSpec3D - handles large image cubes using a streaming approach

Each class has equivalent methods, which are listed below:


🧰 Available Methods

Method Description
🚩outlier_removal Removes anomalous data in the spectral domain
🔊noise_reduction Provides filtering methods to smooth data in the spectral domain
🚫continuum_removal Estimates and removes a spectral contrinuum from the data
🖼️make_m3_rgb (3D only) Creates a standard mafic mineral RGB color-composite image
📈fit_absorption Performs a least squares polynomial fit over a spectral region

💡 Spectral Utilities

Various spectral utilities are available through the reflspeckit.utils subpackge.

Module Description
get_nonzero If you have an empty 3D image array with the first two dimensions being pixels and the third dimension of size N, and each pixel is filled in to a certain depth, M <= N, this function returns a 2D image array that picks out all the pixel values at position M.
rgb_composite Turns any three 2D arrays into a normalized rgb color composite image. The values of each band will be stretched from 0-255, with values above the 95th percentile being cut off to preserve the color stretch integrity.
wvl_search Given an estimated wavelength values and a list of real wavelength vales, this module will return the real wavelength values that is closest to the estimate and the index at which this wavelength value is located within the actual wavelength array.

More utilities coming soon! As a work through my Ph.D., I will add all the various utility functions I write for spectral data processing here!


🚀 Quick Start

pip install reflspeckit
import reflspeckit as rsk
import matplotlib.pyplot as plt

# Loading in a single spectrum
my_spectrum = rsk.Spec1d(spectrum_array, wavelength_array, unit="nm")
my_spectrum.remove_outliers()
myspectrum.noise_reduction(method="box_filter", filter_width=5)
myspectrum.continuum_removal(method="double_line")
print(myspectrum.filtered)  # Contains filtered spectrum

absorption_feature = myspectrum.fit_absorption(800, 1200, unit="nm")
print(absorption_feature.calculate_ibd())  # Returns integrated band depth.

# Loading in a spectral image cube
my_cube = rsk.Spec1d(cube_array, wavelength_array)
my_cube.remove_outliers()
my_cube.noise_reduction(method="box_filter", filter_width=5)
my_cube.continuum_removal(method="double_line")
print(myspectrum.cube)  # Sequentially replaces myspectrum.cube to save memory.

rgb = my_cube.make_m3_rgb()
plt.imshow(rgb)  # Shows RGB color-composite image.

Metadata

Release files for reflspeckit 0.2.5

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

Source distribution (sdist)

Source distribution for reflspeckit 0.2.5
File Size Uploaded Provenance Actions
reflspeckit-0.2.5.tar.gz 15.0 kB Without provenance Details for reflspeckit-0.2.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for reflspeckit 0.2.5
File Interpreter ABI Platform Actions
reflspeckit-0.2.5-py3-none-any.whl Python 3 none any Details for reflspeckit-0.2.5-py3-none-any.whl

Total release size: 40.6 kB

Release files / reflspeckit-0.2.5.tar.gz

Download URL reflspeckit-0.2.5.tar.gz
Size 15.0 kB
Tags Source
SHA-256 checksum
How to use checksums
6e99535436f391ecdec1b3321ee18de862b35b474e4656f7357ee8e26ddf33d7
BLAKE2b-256 checksum
How to use checksums
e80f19307db0237807cb6311eac580709c5ac72800d8162320e82b79d9a1f2e8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.13

Release files / reflspeckit-0.2.5-py3-none-any.whl

Download URL reflspeckit-0.2.5-py3-none-any.whl
Size 25.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a7c0cfab251b838bbf28716f32735b9217e21eb5b87545cddf1452401460adad
BLAKE2b-256 checksum
How to use checksums
7c47f26b5b27092950ae5af2312dc5fb45312ec78c636779c662a657be23ec4d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.13

Security for reflspeckit 0.2.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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