python-microscope / microscope

Python library for control of microscope devices, supporting hardware triggers and distribution of devices over the network for performance and flexibility.
https://www.python-microscope.org
GNU General Public License v3.0
73 stars 42 forks source link

Unsupported temperature sensor in xiB-64 #239

Closed jacopoabramo closed 2 years ago

jacopoabramo commented 2 years ago

Greetings,

I just experimented with the free-running acquisition using python-microscope to control my Ximea xiB-64 camera (the snippet code is presented in image.sc here. This works, but I had to apply a small fix in my local microscope installation because whenever I created a new camera object the initialization failed due to the fact that my camera returned error 26 ("Not implemented") when adding the setting related to the temperature sensor. I wanted to mention this as the fix I did was pretty straight forward:

try:
    get_temp_method()
except xiapi.Xi_error as err:
    if err.status != _XI_NOT_SUPPORTED and err.status != _XI_NOT_IMPLEMENTED:
        raise

With _XI_NOT_IMPLEMENTED = 26.

carandraug commented 2 years ago

What version of xiAPI are you using?

Some time ago I reported to them that when missing, some sensors raised XI_NOT_SUPPORTED while others returned XI_UNKNOWN_PARAM. Then on version 4.21.19, to fix this they made them all raise XI_UNKNOWN_PARAM and commented that their choice was not very intuitive and that they might review it later. I guess they did it now and decided on XI_NOT_IMPLEMENTED. See original issue on python-microscope/vendor-issues#6

carandraug commented 2 years ago

Thank you for the fix. I have pushed a slightly modified version of your patch. Closing as fixed.

jacopoabramo commented 2 years ago

Hi @carandraug , I checked the Python wrapper version and it's 4.22.00 (which I assume it's the same version of the installed xiAPI as I installed both together at the time).