ap-- / python-oceanoptics

*discontinued* Python module for oceanoptics spectrometers
MIT License
21 stars 11 forks source link

How to extract the saturation value? #23

Closed yakir12 closed 8 years ago

yakir12 commented 8 years ago

How can I extract the maximal value the spectrometer is saturated at? This depends on the type of the stored integers (UInt10, UInt12, UInt16 etc)...

ap-- commented 8 years ago

Please have a look at python-seabreeze which is the successor of python-oceanoptics. It's all implemented in the pyseabreeze backend.

The different spectrometer models have different ADC resolutions (10bit, 12bit, 16bit), which define the maximum value. In addition some models store a saturation value (smaller than the biggest possible return value) to indicate if the sensor saturates at lower ADC values.

yakir12 commented 8 years ago

Fantastic. I'm assuming the variable I want is _MAX_PIXEL_VALUE. I'm a total noob with Python, and I'm doing all of this from Julia with PyCall. Everything works great, but how do I actually access _MAX_PIXEL_VALUE?

>>> spec._MAX_PIXEL_VALUE()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'Spectrometer' object has no attribute '_MAX_PIXEL_VALUE'

Excuse the noobness...

ap-- commented 8 years ago

Continues in ap--/python-seabreeze#17.