ulrikpedersen / tomoscan

Demonstration of a tomography scan using EPICS BlueSky with a pulsed laser source
https://ulrikpedersen.github.io/tomoscan/
Apache License 2.0
1 stars 1 forks source link

Switch from polling to event monitoring in scan #7

Open ulrikpedersen opened 1 year ago

ulrikpedersen commented 1 year ago

The performance of the scan is currently tightly coupled to the polling loop that waits for the laser to pulse in the pulse_sync() function, when using the wait_for_value() function.

Performance could be improved by implementing an event-based solution using CA monitors. This is most likely what is implemented for Ophyd2, so this issue could be resolved in a couple of ways:

Either: investigate the current development state of Ophyd2 and evaluate if it is mature enough to be adopted for this experiment. Or: re-implement wait_for_value() as an asynchronous function using a CA monitor.

8ryn commented 1 year ago

Did some investigation into ophyd 2 and worked with a basic device. Asked for suggestions on Nikea slack. Tom Cobb said that within ophyd 2 wait_for_value could be implemented within the trigger or read method of an ophyd 2 device. He queried whether there may be a way of keeping the wait_for_value within the plan rather than the device (which would likely be more straightforward for our purpose) and so we are awaiting feedback on that front.