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

Setting too large an exposure on Ximea camera. #172

Open iandobbie opened 4 years ago

iandobbie commented 4 years ago

The Ximea xiQ has a maximum exposure time of 1s. If I use cockpit to try and set the exposure time to 2s it fails, and leaves the exposure time as previously set.

Microscope logs the following error

xiAPI: XIA(f800):xiSetParam exposure out of range
2020-10-30 16:22:32,017:XimeaCamera (microscope.cameras.ximea):DEBUG:PID 1339: set_exposure_time exception: ERROR 11: Invalid arguments supplied
carandraug commented 4 years ago

What xiapi version are you running? I have a XiC camera here and if I set an exposure time higher than the maximum value, then xiapi clips it (as expected).

$ python3 -c 'import ximea; print(ximea.__version__);'
4.21.18

It might be a ximea version problem of maybe different cameras have behaviour.

iandobbie commented 4 years ago

Sorry I have left the lab. I will try to ssh in later tonight.

Ian

Sent from my iPhone

On 30 Oct 2020, at 16:34, Carnë Draug notifications@github.com wrote:



What xiapi version are you running? I have a XiC camera here and if I set an exposure time higher than the maximum value, then xiapi clips it (as expected).

$ python3 -c 'import ximea; print(ximea.version);' 4.21.18

It might be a ximea version problem of maybe different cameras have behaviour.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/MicronOxford/microscope/issues/172#issuecomment-719658724, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABJTBBJQQJPIXBI6HTSZP4LSNLTGNANCNFSM4TFFSDTQ.

carandraug commented 4 years ago

I got the two cameras the two cameras and confirm that the issue that the different cameras have different behaviours. the xiQ will error when setting the exposure time too high, while the xiC will clip the value (kinda, it will accept the above max value and return that value, but once the camera is enabled, it will clip). I have now reported this to ximea (ticket number 56174 on their internal private ticket system).

carandraug commented 4 years ago

In theory we could just query the range, but ximea's latest update earlier update, broke it for the xiC. With version "4.21.18", the maximum exposure is "30000000.0", but with version "4.21.19", the maximum exposure is "7.411626765319505e-38".

iandobbie commented 4 years ago

Sounds like an unsigned int recast as a signed float.