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_window will be used.

stop_timedatetime, optional

The stop time of the period to check for continuity. If not provided, the end of self.time_window will 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 ValueError with details about the interruption. - “return”: returns False if an interruption is found, True otherwise. - “print”: prints a warning message with details about the interruption and continues execution.

Returns:
bool

Returns True if the data is continuous within the specified time range. If mode is set to “return”, it returns False if an interruption is found. No return value if mode is set to “raise” or “print”.

Raises:
ValueError

If mode is set to “raise” and an interruption larger than self.allowable_interrupt is detected between the files, a ValueError is raised with details of the missing time.

Notes

The method checks the continuity of data by comparing the stop_time of each file with the start_time of the next file within the specified range. If the gap between two files exceeds self.allowable_interrupt (in seconds), it is considered an interruption.