Comments (11)
Need more info:
- which spectrometer model?
- which backend are you using?
from python-seabreeze.
Sorry, of course:
- USB2000
- Since I got some errors when trying to install the cseabreeze backend, I think I'm using the pyseabreeze...
When running it (say from Python) I use:
>>> import seabreeze
>>> seabreeze.use('pyseabreeze')
>>> import seabreeze.spectrometers as sb
from python-seabreeze.
Okay.
In python-oceanoptics, the only keyword parameter that does anything is: only_valid_pixels
So if you want to compare the two, please do (I assume, that spec is an instance of the class for your spectrometer):
- python-oceanoptics
spec.intensities(only_valid_pixels=False) / 4095.
- python-seabreeze
spec.intensities(correct_dark_counts=False, correct_nonlinearity=False)
Let me know how it goes.
from python-seabreeze.
I'll report back (Australia) tomorrow, the spec is at work :|
from python-seabreeze.
It seems like I'm getting values larger than one with python-seabreeze
.
- python-oceanoptics:
>>> import oceanoptics
>>> spec = oceanoptics.get_a_random_spectrometer()
>>> y = spec.intensities(only_valid_pixels=False) / 4095
>>> y
array([ 0. , 0.04151404, 0.04126984, ..., 0.04249084,
0.04249084, 0.04224664])
>>> sum(y > 1)
0
- pyseabreeze backend in python-seabreeze:
>>> import seabreeze
>>> seabreeze.use('pyseabreeze')
>>> import seabreeze.spectrometers as sb
>>> devices = sb.list_devices()
>>> spec = sb.Spectrometer(devices[0])
>>> y = spec.intensities(correct_dark_counts=False, correct_nonlinearity=False)
>>> y
array([ 3072., 3240., 3493., ..., 0., 0., 0.])
>>> sum(y > 1)
1024
from python-seabreeze.
Hey, it seems i am wrong about pyseabreeze returning normalized spectra. (It's been a while since I worked on this and I have to double check why i made that decision).
And these two lines are wrong: https://github.com/ap--/python-seabreeze/blob/master/seabreeze/pyseabreeze/interfaces/spectrometer.py#L133L134 which is why your spectra don't make sense.
I'll push a patch soon.
from python-seabreeze.
Hmm... I'm getting this error now:
>>> import seabreeze
>>> seabreeze.use('pyseabreeze')
>>> import seabreeze.spectrometers as sb
>>> devices = sb.list_devices()
>>> spec = sb.Spectrometer(devices[0])
>>> y = spec.intensities(correct_dark_counts=False, correct_nonlinearity=False)
Traceback (most recent call last):
File "seabreeze/pyseabreeze/interfaces/common.py", line 14, in decorated_func
return func(*args, **kwargs)
File "seabreeze/pyseabreeze/interfaces/spectrometer.py", line 134, in get_formatted_spectrum
tsorted = tmp[idx] & np.array((0xFF, 0x0F)*(N/2)) # high nibble not guaranteed to be pulled low
IndexError: index 4097 is out of bounds for size 4097
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "seabreeze/spectrometers.py", line 148, in intensities
out[transfered_N:])
File "seabreeze/pyseabreeze/wrapper.py", line 123, in spectrometer_get_formatted_spectrum
return device.interface.get_formatted_spectrum(out)
File "seabreeze/pyseabreeze/interfaces/common.py", line 23, in decorated_func
raise SeaBreezeError(msg)
seabreeze.pyseabreeze.interfaces.common.SeaBreezeError: Error while reading raw spectrum
or this:
>>> y = spec.intensities()
Traceback (most recent call last):
File "seabreeze/pyseabreeze/interfaces/common.py", line 14, in decorated_func
return func(*args, **kwargs)
File "seabreeze/pyseabreeze/interfaces/spectrometer.py", line 134, in get_formatted_spectrum
tsorted = tmp[idx] & np.array((0xFF, 0x0F)*(N/2)) # high nibble not guaranteed to be pulled low
IndexError: index 4097 is out of bounds for size 4097
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "seabreeze/spectrometers.py", line 148, in intensities
out[transfered_N:])
File "seabreeze/pyseabreeze/wrapper.py", line 123, in spectrometer_get_formatted_spectrum
return device.interface.get_formatted_spectrum(out)
File "seabreeze/pyseabreeze/interfaces/common.py", line 23, in decorated_func
raise SeaBreezeError(msg)
seabreeze.pyseabreeze.interfaces.common.SeaBreezeError: Error while reading raw spectrum
from python-seabreeze.
Let me know if it's fixed now.
from python-seabreeze.
I pulled, and went through the installation for the pyseabreeze backend
and got this error:
sudo ./misc/install_udev_rules.sh
# SEABREEZE: copying 10-oceanoptics.rules to /etc/udev/rules.d/
cp: cannot stat ‘10-oceanoptics.rules’: No such file or directory
# SEABREEZE: reloading udev rules
went on with the rest of it, and got similar errors when trying to fetch the intensities:
Traceback (most recent call last):
File "seabreeze/pyseabreeze/interfaces/common.py", line 14, in decorated_func
return func(*args, **kwargs)
File "seabreeze/pyseabreeze/interfaces/spectrometer.py", line 135, in get_formatted_spectrum
ret = numpy.array(struct.unpack("<" + "H"*self._PIXELS, tsorted), dtype=numpy.double)
error: unpack requires a string argument of length 4096
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "seabreeze/spectrometers.py", line 148, in intensities
out[transfered_N:])
File "seabreeze/pyseabreeze/wrapper.py", line 123, in spectrometer_get_formatted_spectrum
return device.interface.get_formatted_spectrum(out)
File "seabreeze/pyseabreeze/interfaces/common.py", line 23, in decorated_func
raise SeaBreezeError(msg)
seabreeze.pyseabreeze.interfaces.common.SeaBreezeError: Error while reading raw spectrum
Maybe I'm doing something wrong somewhere else? Want me to run some other tests to make sure the problem isn't somewhere else? Let me know.
from python-seabreeze.
I missed a cast to int64. fixed now.
Maybe I'm doing something wrong somewhere else? Want me to run some other tests to make sure the problem isn't somewhere else? Let me know.
I hope it works now.
from python-seabreeze.
Yap, that looks good. I think you can close this issue (I'll continue my rant at #17). Thanks!
from python-seabreeze.
Related Issues (20)
- C seabreeze doesn't report firmware version HOT 1
- 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
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.