python-seabreeze icon indicating copy to clipboard operation
python-seabreeze copied to clipboard

QEPro lower intensities compared with OceanView - "hidden" settings?

Open kkakosim opened this issue 2 years ago • 1 comments

spectrometer and system information

  • model: QEPro
  • operating system: Windows 10Pro x64
  • python version: 3.11.3
  • python-seabreeze version: 1.3.0
  • installed-via: pip

current problem

the spectrum intensities through seabreeze are lower than with OceanView e.g. shifted by an amount, although the settings appear to the same (i.e., integration time). I wonder if there are more settings that I am not configuring through seabreeze but are automatically there with OceanView.

I am using it through a dash platform but to make it clearer, I removed all the layout information

minimal code example and error (attached the full file)

import pandas as pd
import numpy as np
import seabreeze
from seabreeze.spectrometers import Spectrometer

# Global variables
bg_spectrum = []
curr_spectrum = []

# Utility functions
def collect_spec():
    # Replace with your actual function
    try:
        spec = Spectrometer.from_first_available()
        spec.open()
    except:
        spec.close()
        spec = Spectrometer.from_first_available()
        spec.open()
    averaging = 5
    spec.model
    spec.integration_time_micros(532000)
    #spec.trigger_mode(0)
    spec.features['strobe_lamp'][0].enable_lamp(True)
    time.sleep(1)
    intensities = spec.intensities(correct_dark_counts=True) / averaging
    for i in range(averaging-1):
        time.sleep(1) 
        intensities += spec.intensities() / averaging   
    wavelengths = spec.wavelengths()
    spec.features['strobe_lamp'][0].enable_lamp(False)
    spec.close()

def update_graph():
    global bg_spectrum, curr_spectrum
    bg_spectrum = collect_spec()
    
    time.sleep(10)

    curr_spectrum = collect_spec()
    curr_spectrum[1] = [-np.log10(a / b) for a, b in zip(curr_spectrum[1], bg_spectrum[1])]

update_graph()

kkakosim avatar Jun 19 '23 16:06 kkakosim

Hi @kkakosim

Could you attach a plot comparing the two spectra? What do you mean with "shifted"? A constant offset?

Cheers, Andreas :smiley:

ap-- avatar Jul 16 '23 20:07 ap--