Skip to content
New issue

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

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

Already on GitHub? # to your account

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

Open
VroniPfann opened this issue Apr 28, 2023 · 0 comments
Open

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

VroniPfann opened this issue Apr 28, 2023 · 0 comments

Comments

@VroniPfann
Copy link

VroniPfann commented Apr 28, 2023

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)`

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

No branches or pull requests

1 participant