ap--/python-seabreeze

intensities value from USB4000

buihoangkhang opened this issue ยท 5 comments

spectrometer and system information

  • model: USB4000
  • operating system: Raspian GNU/Linux 9 (stretch)
    Raspberry Pi 3B+
  • python version: 3.6.1
  • python-seabreeze version: 0.6.0
  • installed-via: not sure, maybe pip

current problem

The intensity values did not respond to actual spectrum values as detected in Ocean View.
It just gives some values above 1000 like in your demo.
Link: https://python-seabreeze.readthedocs.io/en/latest/quickstart.html
Untitled22

This is from my computer.
2020-09-08-164344_1050x1680_scrot

Which is not correct (I think)

This should be

Untitled

steps to reproduce

I also encountered this problem with other combination of Raspberry Pi models ( I have RPi 4) and Python version - numpy version.
I also tried on Windows computer - anaconda build.
Could you please recommend the best system you think for me? I cannot change my USB4000 but I can change RPi 3B+ or 4, or change to Windows.

This package means a lot to me, thank you so much.

minimal code example and error (very helpful if available)

import seabreeze
import seabreeze.spectrometers as sb
devices = sb.list_devices()
print(devices)
spec = sb.Spectrometer(devices[0])
spec.integration_time_micros(200)
x = spec.wavelengths()
y = spec.intensities()
print(y)

ap-- commented

Hello @buihoangkhang,

I'm not yet sure if there is a problem.
Which seabreeze version are you running?

import seabreeze
print(seabreeze.__version__)

And please provide a plot of your measured spectrum ๐Ÿ˜Š Or the output of

import numpy as np
import seabreeze.spectrometers as sb
spec = sb.Spectrometer.from_first_available()
spec.integration_time_micros(100000)

y = spec.intensities()
print(np.min(y), np.max(y), np.mean(y))

Cheers,
Andreas

Hello, thank you for your reply,
I am using Seabreeze version 0.6.0
2020-09-11-110919_1050x1680_scrot

As you requested the output.
2020-09-11-111440_1050x1680_scrot

I also try with windows 10, anaconda with spyder.
This is the code.
1

and the result
2

I try again with plotting
3
and the result
4

This package means a lot to me.
Thank you again,
Bui Hoang Khang

ap-- commented

Hi @buihoangkhang

What kind of lightsource are you using with your spectrometer?

For testing, I would suggest running your code again, but this time use a larger integration_time:

spec.integration_time_micros(100000)

Note: the integration_time is in microseconds so, 100000 would still only be 0.1 seconds.

To me it looks as if everything is working and you are just using an intergration that is too small to show your signal.

Let me know how things go,
Cheers,
Andreas ๐Ÿ˜ƒ

Hi,
it works!
Thank you so much, sorry for my neglectance.
I will further testing it.
Bui Hoang Khang

ap-- commented

No worries ๐Ÿ˜Š
I'm happy we could solve your problem together.

I'm closing the issue, let me know if you run into other issues!

Cheers,
Andreas ๐Ÿ˜ƒ