AllenInstitute / MIES

Multichannel Igor Electrophysiology Suite
https://alleninstitute.github.io/MIES/user.html
Other
21 stars 6 forks source link

Rework how sweep numbers are handled #2114

Open t-b opened 1 month ago

t-b commented 1 month ago

We have a couple of issues (#1754, #1235, #1193) which are there because we write into the labnotebook before we have acquired data. Recently we fixed reading these labnotebooks, https://github.com/AllenInstitute/MIES/pull/2097.

But we still create these problematic labnotebooks.

To summarize the issue: If we abort an analysis function in pre set/daq event and have already written a labnotebook entry for a future sweep number, and then acquire TP, the sweep numbers in the labnotebook are not ascending.

This problem stems from the fact that we only increase the sweep numbers, when we save sweep data after the sweep was acquired.

To solve this issue we (I've chatted with @MichaelHuth about this already) propose:

We probably introduce a per device currentSweep global variable. A RO variable getter will then replace most calls to DAG_GetNumericalValue(device, "SetVar_Sweep")/AFH_GetLastSweepAcquired.

t-b commented 1 month ago

Chatted with TJ about this and we think the approach of having "holes" instead of zero sized sweep waves should be preferred. This is more what the hardware did and also avoids issues with running analysis on empty sweeps.