Periodic Saving #870
-
Hello, I'm still relatively new to Bonsai and I'm not sure if this is even possible: I'm attempting long duration recordings (6-14 days) and I would like to be able to save the current data (effectively stop and start bonsai programmatically) in order to save the data as I go along. My data streams are video (saved with videowriter), extracted information from videos (motion, ROIs, etc--all saved with csvwriter), and photometry data (collected with neurophotometrics and saved with photometrywriter). There was a conversation in the google group called "periodic video saving using ffmpeg" that made it seem possible, but there were no workflows attached and the conversation was not very informative. Has anyone been able to figure this out? Thanks, Julian |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
Hi, The general solution is probably to instantiate your data pipeline and simply record whenever you want to. You can achieve this using Hope it helps, |
Beta Was this translation helpful? Give feedback.
Hi,
The general solution is probably to instantiate your data pipeline and simply record whenever you want to. You can achieve this using
Observables
. In the attached workflow, I am recording 2min chunks every 5min. TheTimer
at the highest level of the workflow will tick every 5min and start an observable that will subscribe to theData
stream. Inside, in each "saving iteration" (i.e.CreateObservable
) the data is sinked into acsv
andVideoWriter
. Once a secondTimer
(which starts at the same time as the subcription toData
) emits a value, the observable and the corresponding data chunks will close.Hope it helps,
B
PeriodicRecording.zip