When applying hooks to read or modify events on the fly, the type passed to the function depends on time_interval_s. For any value other than zero, an event is a dict, whereas for time_interval_s=0 the entire list of events is passed to the function.
The code below
from pycromanager import Acquisition, multi_d_acquisition_events
def hook_fn(event):
print(event)
return event
with Acquisition(directory='./', post_hardware_hook_fn=hook_fn) as acq:
events = multi_d_acquisition_events(
num_time_points=5,
time_interval_s=1,
)
acq.acquire(events)
When applying hooks to read or modify events on the fly, the type passed to the function depends on
time_interval_s
. For any value other than zero, an event is a dict, whereas fortime_interval_s=0
the entire list of events is passed to the function.The code below
produces
which is what I would expect. However, changing to
time_interval_s=0
results inThis leads to unexpected errors.
EDIT: I noticed now that it also happens for anything lower than
time_interval_s=0.001
.