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
66 stars 38 forks source link

Exposure time and frame rate in picamera module. #286

Closed iandobbie closed 8 months ago

iandobbie commented 9 months ago

The exposure time can only be set up to the exposure defined by the framerate on the picamera. According to https://picamera.readthedocs.io/en/release-1.13/fov.html#hardware-limits

The maximum exposure time is currently 6 seconds on the V1 camera module.

There doesn't appear to be a well defined max framerate parameter. If you set it too fast it fails but I am not sure exactly what the response is, I need to test it further.

iandobbie commented 9 months ago

Empirical testing shows my setup (pi4 and picamera v1.3) fails abiove 90 frames/s so set top limit to 90 fps. The documentation says lower limit is 1/6 fps so set this also but not tested it.

iandobbie commented 9 months ago

Done a bit more work on this, max exposure time is 6s, so bounded exposure at this. Max framerate is 90 fps so for exposures between 6s and 1/90 s the frame rate is set along with the exposure time. Exposure times below 1/90 s get the framerate set to 90 and then the exposure time set lower. This appears to work now.