Skip to main content

Sample Console Views

Overview

Wasatch.PY is a Python application-level driver for Wasatch Photonics spectrometers. It has been tested on Windows, MacOS and Linux platforms (including Raspberry Pi Zero), and is directly used by Wasatch's own ENLIGHTEN™ spectroscopy desktop GUI.

If you'd like simpler, smaller examples of how to perform individual operations against Wasatch spectrometers from Python, please also see our Python Example Scripts repository.

History

This project started as a successor to the earlier WasatchUSB. The main difference is that while WasatchUSB was a one-time copy-pasta of legacy ENLIGHTEN classes, Wasatch.PY is an actively maintained and supported HAL (hardware abstraction layer) dependency of the current ENLIGHTEN GUI. As a result, when we add or update ENLIGHTEN features, Wasatch.PY is typically updated by necessity, making the same foundational interface available to all our users.

This shared library exemplifies two of our core values: transparency and dogfooding.

Finally, the project name reflects the fact that this is specifically a Python binding and implementation; for other USB-capable interfaces, see Wasatch.NET, Wasatch.VCPP and other software drivers.

API

A significant portion of Wasatch.PY's command interface is exposed through key-value settings, originally provided to simplify multi-process applications and summarized in docs/README_SETTINGS.md.

PyPi

Looking for Wasatch.PY from pip (PyPi)? Look no further! The latest released version of Wasatch.PY can be loaded into your environment with a simple pip command:

$ pip install wasatch

Package info:

For more information about PyPi package management, see README_PYPI.

Dependencies

$ pip install .

Running the Demo

Following are the general usage instructions for the included command-line demo scripts. After find specific Anaconda setup instructions for Windows, Linux, MacOS and other tested platforms.

$ python -m venv venv
$ . venv/*/activate
$ pip install .
$ python -u scripts/demo.py --help

usage: demo.py [-h] [--log-level LOG_LEVEL]
			   [--integration-time-ms INTEGRATION_TIME_MS]
			   [--scans-to-average SCANS_TO_AVERAGE]
			   [--boxcar-half-width BOXCAR_HALF_WIDTH] [--delay-ms DELAY_MS]
			   [--outfile OUTFILE] [--max MAX] [--non-blocking] [--ascii-art]

Simple demo to acquire spectra from command-line interface

optional arguments:
  -h, --help            show this help message and exit
  --log-level LOG_LEVEL
						logging level [DEBUG,INFO,WARNING,ERROR,CRITICAL]
  --integration-time-ms INTEGRATION_TIME_MS
						integration time (ms, default 10)
  --scans-to-average SCANS_TO_AVERAGE
						scans to average (default 1)
  --boxcar-half-width BOXCAR_HALF_WIDTH
						boxcar half-width (default 0)
  --delay-ms DELAY_MS   delay between integrations (ms, default 1000)
  --outfile OUTFILE     output filename (e.g. path/to/spectra.csv)
  --max MAX             max spectra to acquire (default 0, unlimited)
  --non-blocking        non-blocking USB interface (WasatchDeviceWrapper
						instead of WasatchDevice)
  --ascii-art           graph spectra in ASCII

Raspberry Pi

A standalone Raspberry Pi "Quick Start" tutorial is available here:

Linux

IMPORTANT: For Linux, you must copy the file udev/10-wasatch.rules from the Wasatch.PY distribution to /etc/udev/rules.d, then HUP udev or reboot. This will require root (sudo) privs, and is required to give userland applications access to USB devices matching Wasatch VID/PID.

Common Errors

LIBUSB error: No backend available (MacOS)

Using Homebrew:

$ brew install libusb

Version History

See Changelog

Metadata

Release files for wasatch 2.5.2

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

Source distribution (sdist)

Source distribution for wasatch 2.5.2
File Size Uploaded Provenance
wasatch-2.5.2.tar.gz 715.8 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 964.9 kB

Release files / wasatch-2.5.2.tar.gz

Download URL wasatch-2.5.2.tar.gz
Size 715.8 kB
Tags Source
SHA-256 checksum
How to use checksums
2ddac57eaf53d4f23946dcde37d0df809a4ac3600a7dca22dd33e0620e61ef35
BLAKE2b-256 checksum
How to use checksums
c67c244b49b266b25ab67906398dd5d233f3280e8940a3907a9df86bac5044dd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Release files / wasatch-2.5.2-py3-none-any.whl

Download URL wasatch-2.5.2-py3-none-any.whl
Size 249.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ec83ba4ea1039f3002d94a8f84727d42ee3be452f06a0bacdd538e32beb9176a
BLAKE2b-256 checksum
How to use checksums
9097c7a8163bd942cf75f1bf93bd6e1a99fa705e8383319b79692396284f12f5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Security for wasatch 2.5.2

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.

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