uwacan.recordings.MultichannelAudioInterfaceRecording.check_file_continuity#
- MultichannelAudioInterfaceRecording.check_file_continuity(start_time=None, stop_time=None, allowable_interrupt=None, mode='raise')#
Check the continuity of recorded data.
- Parameters:
- start_timedatetime, optional
The start time of the period to check for continuity. If not provided, the start of
self.time_windowwill be used.- stop_timedatetime, optional
The stop time of the period to check for continuity. If not provided, the end of
self.time_windowwill be used.- allowable_interruptfloat, optional
How much of a gap to allow between files. Will by default use the class attribute.
- mode{“raise”, “return”, “print”}, optional
The action to take when an interruption is found. - “raise” (default): raises a
ValueErrorwith details about the interruption. - “return”: returnsFalseif an interruption is found,Trueotherwise. - “print”: prints a warning message with details about the interruption and continues execution.
- Returns:
- bool
Returns
Trueif the data is continuous within the specified time range. If mode is set to “return”, it returnsFalseif an interruption is found. No return value if mode is set to “raise” or “print”.
- Raises:
- ValueError
If
modeis set to “raise” and an interruption larger thanself.allowable_interruptis detected between the files, aValueErroris raised with details of the missing time.
Notes
The method checks the continuity of data by comparing the
stop_timeof each file with thestart_timeof the next file within the specified range. If the gap between two files exceedsself.allowable_interrupt(in seconds), it is considered an interruption.