Comments (13)
This is very weird...
Does this happen for both backends?
Please provide the printed output.
from python-seabreeze.
Please do:
import seabreeze.spectrometers as sb
spec = sb.Spectrometer.from_serial_number()
for i in range(1, 5):
print(spec.read_eeprom_slot(i))
with and without the Gtk import.
from python-seabreeze.
I also testet the pyseabreeze backend and the problem happens only with the cseabreeze backend.
The scrambled wavelength vector looks like this:
[ -6.10800000e+03 -4.42500000e+03 -3.07200000e+03 ..., 6.57228806e+09
6.59143373e+09 6.61061655e+09]
Running your code gives to following result:
AttributeError: 'Spectrometer' object has no attribute 'read_eeprom_slot'
from python-seabreeze.
Can you test if the newest commit on master fixes this problem?
from python-seabreeze.
Unfortunately the result is the same:
[ -6.10800000e+03 -4.42500000e+03 -3.07200000e+03 ..., 6.57228806e+09
6.59143373e+09 6.61061655e+09]
A workaround would be to import gtk after s = sb.Spectrometer(devices[0])
, then everything works fine
from python-seabreeze.
Can you still reproduce this issue?
I tried, and I can't anymore.
I tried going back to old libseabreeze versions, python-seabreeze versions and python interpreters.
So my guess is that it might have been a gtk3 bug, that is fixed now? Since this is the only thing I didn't test.
from python-seabreeze.
At the moment I use seabreeze under windows with qt instead of gtk which works fine.
I just tried to get the latest version running under linux to test with gtk, but unfortunately I get the following error:
`>>> import seabreeze.spectrometers as sb
Traceback (most recent call last):
File "/home/dunkelfeld/PyCharmProjects/python-seabreeze/seabreeze/backends.py", line 30, in _use_cseabreeze
import seabreeze.cseabreeze as sbb
File "/home/dunkelfeld/PyCharmProjects/python-seabreeze/seabreeze/cseabreeze/init.py", line 5, in from .wrapper import (SeaBreezeError,
ImportError: No module named 'seabreeze.cseabreeze.wrapper'
`
Now I'm a bit confused, do you know why this error occurs ?
from python-seabreeze.
Did you install the module properly?
This happens, if you install the module via python setup.py install
and try to run it from the same path. In your case: /home/dunkelfeld/PyCharmProjects/python-seabreeze
Also you closed the issue. Does this mean you also can't reproduce the bug anymore?
from python-seabreeze.
Thanks for the tip, that was actually the Problem, the new version works perfectly in a different directory.
Unfortunately the bug is still present and the wavelength vector still has the wrong values when importing gtk3 (version 3.18.7-1). Oddly enough, when importing gtk2 from gi.repository everything is fine.
Also sorry for closing the issue, I just clicked the wrong button.
from python-seabreeze.
Can you run the following code and post the output:
from gi.repository import Gtk, GObject
import seabreeze.cseabreeze as cseabreeze
import numpy
import sys
print ( sys.version )
print ( cseabreeze.__file__ )
print ( Gtk._version )
print ( GObject.pygobject_version )
device, = cseabreeze.wrapper.device_list_devices()
cseabreeze.wrapper.device_open(device)
specID, = cseabreeze.wrapper.device_get_spectrometer_feature_id(device)
speclen = cseabreeze.wrapper.spectrometer_get_formatted_spectrum_length(device, specID)
out = numpy.empty((speclen,), numpy.double)
cseabreeze.wrapper.spectrometer_get_wavelengths(device, specID, out)
print ( "First ten wavelengths:" )
print ( out[:10] )
Thanks
from python-seabreeze.
And also with the Gtk, GObject import after the sys import. :) Thanks.
from python-seabreeze.
No problem,
Gtk first:
3.5.1 (default, Dec 7 2015, 12:58:09)
[GCC 5.2.0]
/usr/lib/python3.5/site-packages/seabreeze-0.5.3-py3.5-linux-x86_64.egg/seabreeze/cseabreeze/__init__.py
3.0
(3, 18, 2)
1044
First ten wavelengths:
[ -6.10800000e+03 -4.42500000e+03 -3.07200000e+03 -2.01300000e+03
-1.21200000e+03 -6.33000000e+02 -2.40000000e+02 3.00000000e+00
1.32000000e+02 1.83000000e+02]
Gtk after sys:
3.5.1 (default, Dec 7 2015, 12:58:09)
[GCC 5.2.0]
/usr/lib/python3.5/site-packages/seabreeze-0.5.3-py3.5-linux-x86_64.egg/seabreeze/cseabreeze/__init__.py
3.0
(3, 18, 2)
1044
First ten wavelengths:
[ -6.10800000e+03 -4.42500000e+03 -3.07200000e+03 -2.01300000e+03
-1.21200000e+03 -6.33000000e+02 -2.40000000e+02 3.00000000e+00
1.32000000e+02 1.83000000e+02]
So now the wrong wavelengths are returned regardless of the position of the gtk import.
That new behavior might be related to a package upgrade of gtk3 I recently installed.
Here is the output without importing gtk and gobject:
3.5.1 (default, Dec 7 2015, 12:58:09)
[GCC 5.2.0]
/usr/lib/python3.5/site-packages/seabreeze-0.5.3-py3.5-linux-x86_64.egg/seabreeze/cseabreeze/__init__.py
1044
First ten wavelengths:
[ 184.34537107 185.15048402 185.95551917 186.76047652 187.56535608
188.37015785 189.17488183 189.97952804 190.78409646 191.58858712]```
Maybe it is something distribution specific, which distribution did you use for testing ?
from python-seabreeze.
I'm closing this one, because it never got reported again... 🤷
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.