Closed LMSC-NTappy closed 2 years ago
In fact grab_image is requesting parameters as argument for them to be applied. This is kind of awkward. In my PR #144 I added functionalities for that reason.
This behavior is not "broken", it is as originally designed. Note that in your example code you're using private functions not intended for external use. There is currently no public interface for setting things like exposure in a persistent way.
We can consider adding persistent setting of values like this, but we'll have to be careful in thinking how this interacts with the existing behavior. For example, if we pass an exposure
to grab_image()
, does that persistently set the exposure, or only set it for that image? I'm thinking probably the latter.
cam.grab_image() # Uses default value
cam.exposure = '100 ms'
cam.grab_image() # 100 ms
cam.grab_image(exposure='20 ms') # 20 ms
cam.grab_image() # 100 ms
Ok, I get it now. I didn't think of it that way, sorry.
In any case I agree with your suggestion and example.
Many thanks for adressing this. I'll close this issue
Hello,
I have some troubles with the current behaviour of the thorlabs UC480 camera driver.
Obviously, if one applies a new exposure time to the camera and asks to grab a frame, she expects the exposure time to be applied in the acquisition and not re-set to default. This makes the _set_exposure as well as some facet parameters useless.
This is due to a faulty behaviour of the _handle_keywords function. https://github.com/mabuchilab/Instrumental/blob/fe8f3b4be7cd25976b6187fe4cfcf0dc0f2cbb63/instrumental/drivers/cameras/__init__.py#L208
If no args are passed, the parameters are re-set to the default values. Since I saw that you are currently changing this in #140 & #144 I thought I would share.