Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pvcam camera.get_exposure_time does not return real exposure time in bulb mode #275

Open
VroniPfann opened this issue Apr 24, 2023 · 1 comment

Comments

@VroniPfann
Copy link

I realized that when using the Kinetix in bulb mode camera.get_cycle_time and camera.get_exposure_time do not return the real values, which kind of makes sense I guess since they are not set in the software. I noticed this because I thought to use those values to calculate my timings for hardware triggering on the RedPitaya. Does it make sense to return something else, like for example length of the hardware trigger in this case? Not sure if this needs to be fixed on the python-microscope level or my experiment script level. Please see the code that I am running below. Thanks!

LIGHT_TO_EXPOSURE = [
    # light-name, exposure-in-msec
    ("laser3", 500),
    ("laser6", 200),
    ("laser7", 300),
]

camera = PVCamera()
camera.set_trigger(microscope.TriggerType.HIGH,
                   microscope.TriggerMode.BULB)
camera_buffer = Queue()
camera.set_client(camera_buffer)
camera.enable()

actions = []

running_time = 0.0
for light_name, emitting_time in LIGHT_TO_EXPOSURE:
    mask = CAMERA_EXECUTOR_LINE | LIGHT_TO_EXECUTOR_LINE[light_name]
    action = (running_time, (mask, [0, 0]))
    actions.append(action)
    # Turn off the laser
    running_time += emitting_time
    action = (running_time, (0, [0, 0]))
    actions.append(action)
    # Wait until camera stops exposing
    running_time += (camera.get_cycle_time() - camera.get_exposure_time()) * 1000  #-> **returns not real value here**
    ## Prepare for next acquisition 
    actions.append((running_time, (0, [0, 0])))  # wait before start next repetition

executor.PrepareActions(actions, N_TIMEPOINTS)

@iandobbie
Copy link
Collaborator

I think we need o think carefully before overloading the existing functions. Not sure of the best solution but maybe we need a readout_time to find just the readout time and allow the proper timing calculations in this mode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants