-
Hi all, I am finding that python-seabreeze is a wonderful tool for connecting my Flame spectrometer to my Raspberry Pi 4 (thanks ap--)! This might be a basic question, but is there a way to collect spectra continuously at a set time interval? Ideally, I'd like to take a spectral measurement every five minutes and store the date/time/spectral msmt in a .csv or .txt format. I'm sure it is pretty straight-forward process to do so with a couple lines of code, but I am incapable of doing so with my limited experience. Any help would be greatly appreciated!! Thanks - DPM |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
Hi @dpmchugh Do you mean collect spectra with 5 minute integration time? Or collect a short integration time spectrum every 5 minutes? the first is possible if your spectrometer supports it. check The second depends a lot on your time accuracy requirements. You could also write a small script that opens the spectrometer and appends the measurement to your csv, and call that script via a cron job on the pi. Then it'll also auto start on boot, which might be good if you run the pi headless. Let me know if you have more questions or if anything is unclear, |
Beta Was this translation helpful? Give feedback.
-
Hi DPM,
we have a multispectral system based on raspberry pis and ocean optics
instruments that does this sort of thing. Have a look at
https://blogs.ed.ac.uk/teampiccolo/
all the code is on github
https://github.com/TeamPiccolo
Regards
magnus
…On Thu, 2021-06-17 at 13:43 -0700, dpmchugh wrote:
Hi all,
I am finding that python-seabreeze is a wonderful tool for connecting
my Flame spectrometer to my Raspberry Pi 4 (thanks ap--)! This might
be a basic question, but is there a way to collect spectra
continuously at a set time interval? Ideally, I'd like to take a
spectral measurement every five minutes and store the
date/time/spectral msmt in a .csv or .txt format. I'm sure it is
pretty straight-forward process to do so with a couple lines of code,
but I am incapable of doing so with my limited experience. Any help
would be greatly appreciated!!
Thanks - DPM
|
Beta Was this translation helpful? Give feedback.
Hi @dpmchugh
Do you mean collect spectra with 5 minute integration time? Or collect a short integration time spectrum every 5 minutes?
the first is possible if your spectrometer supports it. check
spec.integration_time_micros_limits
to get the supported range in microseconds.The second depends a lot on your time accuracy requirements.
A simple
time.sleep(300 - integration_time)
between measurements can do the trick if you dont mind that you accumulate relative time interval error.Otherwise write a small function that reads the spectrum and use Python's
threading.Timer
to call it every 5 minutes.You could also write a small script that opens the spectrometer and appends the measurement …