Avenir module

This module provides the high-level object-oriented interface to control and stream data from Avenir ARIS compact spectrometers. It handles the low-level USB polling, handles exposure adjustment, and parses raw metadata.

Examples

Below is a minimum working example showing how to initialize the spectrometer, set up automatic exposure and capture a single spectrum:

import matplotlib.pyplot as plt
from Devices.Avenir import ARIS

# Initialize the device (automatically searches for the USB interface)
spec = ARIS()

if spec.device is not None:
    # Set automatic exposure. This will set the exposure time and averaging automatically
    # such that the total integration time is 20 ms.
    spec.setAutoExposure(exposure_us=200000)

    # Capture the data
    data = spec.capture()

    if data:
        print(f"Captured spectrum at {data['temperature_c']}°C")
        plt.plot(data['wavelengths'], data['spectrum']")
class Avenir.ARIS(**kwargs)[source]

Bases: object

Driver class for Avenir ARIS compact spectrometers.

Manages USB connection, device configuration, and spectrum capture.

Parameters:

**kwargs (dict) – Keyword arguments passed to _find_address() to manually select a USB device. Valid keywords are “idVendor” and “idProduct”, corresponding to the vendor and product ID of the manually defined USB device.

capture()[source]

Captures a single spectrum and retrieves associated metadata.

Returns:

result – A dictionary containing the wavelength array, spectrum intensities, exposure settings, device temperature, and other capture metadata. Returns None if the received data stream is invalid.

Return type:

dict or None

setAutoExposure(target_us=200000)[source]

Enables automatic exposure and specifies target integration time.

Parameters:

exposure_us (int, default: 200000) – Target integration time in microseconds.

setExposure(exposure_us=1000, average=1)[source]

Sets the exposure time and number of averages for spectral capture.

Parameters:
  • exposure_us (int, default: 1000) – Exposure time in microseconds.

  • average (int, default: 1) – Number of spectra to average.