Skip to content

Question: executor.PrepareActions does not return any signal #276

Open
@VroniPfann

Description

@VroniPfann

Hi all,

I have a quick question regarding an issue I encountered while running our long-term experiments with the RedPitaya. When I increase the number of timepoints to e.g. 25000, the executor.PrepareActions function generating the action table takes a few seconds to finish. However, since there is no signal to read back, the code continues running, and I get an error that there are no images yet. While I could add some sleeping time and increase my timeout, I am wondering if there is a way to receive a signal once PrepareActions is finished.

I have included the code I am running below. Any help or comments would be much appreciated!

Also, I have a practical question: how do I stop the RedPitaya execution during an acquisition?

Thank you in advance!

`N_TIMEPOINTS = 20000
EXECUTOR_URI = 'PYRO:redPitaya@192.168.0.20:8005'
executor = Pyro4.Proxy(EXECUTOR_URI)

actions = []
running_time = 0.0

for light_name, emitting_time in LIGHT_TO_EXPOSURE:
filtermask = FILTER_TO_EXECUTOR_LINE[light_name] | FILTERSTEP_EXECUTOR_LINE
action = (running_time, (filtermask, [0, 0]))
actions.append(action)
running_time += 70
lasermask = LIGHT_TO_EXECUTOR_LINE[light_name] | CAMERA_EXECUTOR_LINE
action = (running_time, (lasermask, [0, 0]))
actions.append(action)
running_time += emitting_time
action = (running_time, (0, [0, 0]))
actions.append(action)
running_time += camera.get_cycle_time() * 1000 #camera read out time
action = (running_time, (0, [0, 0]))
actions.append(action)# wait before start next repetition

executor.PrepareActions(actions, N_TIMEPOINTS)

time.sleep(15)

thread = threading.Thread(target=executor.RunActions)
thread.start()

n_acquired = 0
expected_images = len(LIGHT_TO_EXPOSURE) * N_TIMEPOINTS
timeout = (max_emission_time / 1000.0)+15
t_acc = 0

while n_acquired < expected_images:
im = camera_buffer.get(timeout = timeout)
path = TIFF_PATH + 'im%s'%n_acquired +'.tif'
tifffile.imwrite(path, im)
n_acquired = n_acquired + 1

thread.join()

time.sleep(5)`

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @VroniPfann

        Issue actions

          Question: executor.PrepareActions does not return any signal · Issue #276 · python-microscope/microscope