Skip to main content

Python interface module for Ocean Optics spectrometers. This software is not associated with Ocean Optics. Use it at your own risk.

Project description

Python module for Ocean Optics spectrometers

Conda (channel only) PyPI test build deploy Github All Releases PyPI - Downloads MIT license GitHub issues DOI Github Sponsors

Python-seabreeze is the easy way to access your Ocean Optics spectrometers from python. It wraps the SeaBreeze library provided by Ocean Optics to communicate with the spectrometer. It also provides a pyUSB based reimplementation of SeaBreeze for easy extension. This software is not associated with Ocean Optics. Use it at your own risk.

DOCUMENTATION ON RTD

You'll find the documentation and more detailed information here https://python-seabreeze.readthedocs.io/en/latest/

Changes

The changelog can be found here CHANGELOG.md

Install

# via pypi
pip install seabreeze
seabreeze_os_setup

or

# via conda
conda install -c conda-forge seabreeze
seabreeze_os_setup

Using the backend pyseabreeze in Windows

The backend pyseabreeze requires the libraries pyusb and libusb

# via pypi
pip install seabreeze[pyseabreeze]  # this ensures installation of pyusb

Additionally, you might need to manually install libusb1. Go here https://libusb.info/, Downloads -> Latest Windows Binaries. In the zip file, enter either the folder MinGW64/dll or MinGW32/dll (depending on your OS). Copy the file libusb-1.0.dll into C:\Windows\System32.

Usage

The following example shows how simple it is to acquire a spectrum with python-seabreeze through the model independent Spectrometer class. For a more detailed description read the documentation:

>>> from seabreeze.spectrometers import Spectrometer
>>> spec = Spectrometer.from_first_available()
>>> spec.integration_time_micros(20000)
>>> spec.wavelengths()
array([  340.32581   ,   340.70321186,   341.08058305, ...,  1024.84940994,
        1025.1300678 ,  1025.4106617 ])
>>> spec.intensities()
array([  1.58187931e+01,   2.66704852e+04,   6.80208103e+02, ...,
         6.53090172e+02,   6.35011552e+02,   6.71168793e+02])

To use the pyseabreeze backend (requires pyusb) simply run this before importing seabreeze.spectrometers.

>>> import seabreeze
>>> seabreeze.use('pyseabreeze')
>>> import seabreeze.spectrometers as sb

Supported Devices

Spectrometer cseabreeze pyseabreeze (usb) pyseabreeze (ethernet)
HR2000 x x
HR2000PLUS x x
HR4000 x x
JAZ x x
MAYA2000 x x
MAYA2000PRO x x
MAYALSL x x
NIRQUEST256 x x
NIRQUEST512 x x
QE65000 x x
QE-PRO x x
STS x x
TORUS x x
USB2000 x x
USB2000PLUS x x
USB4000 x x
USB650 Issue #47
SPARK x x
ADC1000 x
HDX Issue #133 x
HR2 x
HR4 x
HR6 x
SR2 x
SR4 x
SR6 x
ST-VIS x

Reading spectra via ethernet

This functionality is currently implemented for the HDX with the pyseabreeze backend. The following example shows how to read a spectrum via ethernet:

>>> import seabreeze
... from seabreeze.spectrometers import Spectrometer
...
... seabreeze.use("pyseabreeze", network_adapter="192.168.254.200")
>>>
>>> spec = Spectrometer.from_serial_number("HDX12345")
>>> spec.intensities()
array([1967.07287765, 1325.69702018, 1418.40732539, ..., 1398.4680335 ,
       1406.44364585, 1397.47109175])

Known Issues

  • USB2000 spectrometers cause Data transfer error due to old firmware Issue #48
  • USB650 not supported Issue #47
  • No conda packages for armv6 (RPI version 1) Issue #46

Contributing Guidelines

If you run into any problems, file an issue and be sure to include the following in your report:

  • Operating system (Linux distribution, Windows version, OSX version) and archictecture (32bit, 64bit, arm)
  • Python version and arch (i.e. Python 2.7.10 64bit)
  • python-seabreeze version

If you want a feature implemented, please file an issue, or create a pull request when you implement it yourself. And if you would like to support me via paypal, click on the paypal donate button on top of this README.

License

Files in this repository are released under the MIT license.

Related Repositories

If you want me to add your project here, let me know. Happy to add it.

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

seabreeze-2.10.0.tar.gz (7.7 MB view hashes)

Uploaded Source

Built Distributions

seabreeze-2.10.0-cp313-cp313-win_amd64.whl (500.8 kB view hashes)

Uploaded CPython 3.13 Windows x86-64

seabreeze-2.10.0-cp313-cp313-win32.whl (427.7 kB view hashes)

Uploaded CPython 3.13 Windows x86

seabreeze-2.10.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.5 MB view hashes)

Uploaded CPython 3.13 manylinux: glibc 2.17+ x86-64

seabreeze-2.10.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.4 MB view hashes)

Uploaded CPython 3.13 manylinux: glibc 2.17+ ARM64

seabreeze-2.10.0-cp313-cp313-macosx_11_0_arm64.whl (840.0 kB view hashes)

Uploaded CPython 3.13 macOS 11.0+ ARM64

seabreeze-2.10.0-cp313-cp313-macosx_10_13_x86_64.whl (879.9 kB view hashes)

Uploaded CPython 3.13 macOS 10.13+ x86-64

seabreeze-2.10.0-cp312-cp312-win_amd64.whl (500.7 kB view hashes)

Uploaded CPython 3.12 Windows x86-64

seabreeze-2.10.0-cp312-cp312-win32.whl (425.7 kB view hashes)

Uploaded CPython 3.12 Windows x86

seabreeze-2.10.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.5 MB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

seabreeze-2.10.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.4 MB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ ARM64

seabreeze-2.10.0-cp312-cp312-macosx_11_0_arm64.whl (841.8 kB view hashes)

Uploaded CPython 3.12 macOS 11.0+ ARM64

seabreeze-2.10.0-cp312-cp312-macosx_10_13_x86_64.whl (881.3 kB view hashes)

Uploaded CPython 3.12 macOS 10.13+ x86-64

seabreeze-2.10.0-cp311-cp311-win_amd64.whl (508.4 kB view hashes)

Uploaded CPython 3.11 Windows x86-64

seabreeze-2.10.0-cp311-cp311-win32.whl (432.2 kB view hashes)

Uploaded CPython 3.11 Windows x86

seabreeze-2.10.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.5 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

seabreeze-2.10.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.5 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ ARM64

seabreeze-2.10.0-cp311-cp311-macosx_11_0_arm64.whl (845.2 kB view hashes)

Uploaded CPython 3.11 macOS 11.0+ ARM64

seabreeze-2.10.0-cp311-cp311-macosx_10_9_x86_64.whl (887.9 kB view hashes)

Uploaded CPython 3.11 macOS 10.9+ x86-64

seabreeze-2.10.0-cp310-cp310-win_amd64.whl (506.8 kB view hashes)

Uploaded CPython 3.10 Windows x86-64

seabreeze-2.10.0-cp310-cp310-win32.whl (431.7 kB view hashes)

Uploaded CPython 3.10 Windows x86

seabreeze-2.10.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.5 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

seabreeze-2.10.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.5 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ ARM64

seabreeze-2.10.0-cp310-cp310-macosx_11_0_arm64.whl (844.4 kB view hashes)

Uploaded CPython 3.10 macOS 11.0+ ARM64

seabreeze-2.10.0-cp310-cp310-macosx_10_9_x86_64.whl (887.0 kB view hashes)

Uploaded CPython 3.10 macOS 10.9+ x86-64

seabreeze-2.10.0-cp39-cp39-win_amd64.whl (506.8 kB view hashes)

Uploaded CPython 3.9 Windows x86-64

seabreeze-2.10.0-cp39-cp39-win32.whl (431.8 kB view hashes)

Uploaded CPython 3.9 Windows x86

seabreeze-2.10.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.5 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

seabreeze-2.10.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.5 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ ARM64

seabreeze-2.10.0-cp39-cp39-macosx_11_0_arm64.whl (844.6 kB view hashes)

Uploaded CPython 3.9 macOS 11.0+ ARM64

seabreeze-2.10.0-cp39-cp39-macosx_10_9_x86_64.whl (887.3 kB view hashes)

Uploaded CPython 3.9 macOS 10.9+ x86-64

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