Comments (6)
All spectrometer methods should be blocking.
What's your specific use case for an isready
method?
from python-seabreeze.
I want to fetch intensities when the spec is ready and not before by using
asynchronous coroutines. All of this is done in Julia (not Python) with
channels, tasks, and @async.
What do you mean with "All spectrometer methods should be blocking"? Maybe
I can work around it?
On 18:57, Mon, 12/10/2015 Andreas Poehlmann [email protected]
wrote:
All spectrometer methods should be blocking.
What's your specific use case for an isready method?
—
Reply to this email directly or view it on GitHub
https://github.com/ap--/python-seabreeze/issues/18#issuecomment-147334894
.
from python-seabreeze.
If you call spec.intensities() pyseabreeze sends a request command to the spectrometer and starts reading the spectrum information from the spectrometer.
By default most oceanoptics spectrometers are in a free running trigger mode. This means, that once you set the integration time, the spectrometer is constantly acquiring spectra. When a spectrum is requested via usb the spectrometer is sending the next valid acquired spectrum. This means in free running trigger mode, dependent on when the spectrum is requested, it can take from [insert really short time] up to [insert the integration time you set] until the spec.intensities() call returns.
if you call spec.intensities() in a loop, the loop delay will be the integration time you set (plus some overhead).
from python-seabreeze.
I'm trying to avoid changing the integration time and fetching the
intensities at the same time. I think it should be possible to do that in
my specific setup but thought it would be great if there was a isready()
function that could tell me when the spec is ready for any kind of
communication.
On 12/10/2015 8:30 PM, "Andreas Poehlmann" [email protected] wrote:
If you call spec.intensities() pyseabreeze sends a request command to the
spectrometer and starts reading the spectrum information from the
spectrometer.By default most oceanoptics spectrometers are in a free running trigger
mode. This means, that once you set the integration time, the spectrometer
is constantly acquiring spectra. When a spectrum is requested via usb the
spectrometer is sending the next valid acquired spectrum. This means in
free running trigger mode, dependent on when the spectrum is requested, it
can take from [insert really short time] up to [insert the integration
time you set] until the spec.intensities() call returns.if you call spec.intensities() in a loop, the loop delay will be the
integration time you set (plus some overhead).—
Reply to this email directly or view it on GitHub
https://github.com/ap--/python-seabreeze/issues/18#issuecomment-147360309
.
from python-seabreeze.
I should check if pyseabreeze is threadsafe. In the meantime, if you want to change the integration time and read spectra from two different threads, you may need to implement the thread locking yourself.
I would recommend to use a single thread to communicate with the spectrometer and implement all asynchronous calls on this thread. In the main loop of this thread you can check if other threads want to change the integration time and do the change on demand.
from python-seabreeze.
Awesome advice. I'll keep tinkering. Thanks for all the work and sorry for
opening all these "issues".
On 12/10/2015 9:41 PM, "Andreas Poehlmann" [email protected] wrote:
I should check if pyseabreeze is threadsafe. In the meantime, if you want
to change the integration time and read spectra from two different threads,
you may need to implement the thread locking yourself.I would recommend to use a single thread to communicate with the
spectrometer and implement all asynchronous calls on this thread. In the
main loop of this thread you can check if other threads want to change the
integration time and do the change on demand.—
Reply to this email directly or view it on GitHub
https://github.com/ap--/python-seabreeze/issues/18#issuecomment-147371751
.
from python-seabreeze.
Related Issues (20)
- Problem with set_integration_time, the spectrometer doesn't wait for spectrum acquisition. HOT 3
- Seabreeze and SR4 Spectrometers HOT 20
- Extract cseabreeze into its own module HOT 1
- Rewrite Transport to use bMaxPacketSize
- ADC1000 error with external interrupt HOT 10
- USB2000 Issue reading intensities HOT 1
- Edge Trigger Issue Continues HOT 3
- QEPro lower intensities compared with OceanView - "hidden" settings? HOT 1
- Flame-S in version 2.4.0 pyseabreeze and trigger mode HOT 2
- Overflow, still alive and well HOT 1
- Getting CPython errors when building from source HOT 1
- Install on raspberry pi HOT 5
- Basic SR2 support HOT 2
- Drivers Dont have valid signatures HOT 8
- Support for SR6 / HR6 HOT 5
- USB2000 and some Flame S error at initialization due to fpga firmware version register check HOT 4
- HDX spectrometer connected via USB errors after manually interrupting connection HOT 2
- Ethernet Support for HDX HOT 6
- OceanHR4 connection issue HOT 2
- USB650: USBError Overflow HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-seabreeze.