crowsetta.formats.seq.notmat.load_notmat

Contents

crowsetta.formats.seq.notmat.load_notmat#

crowsetta.formats.seq.notmat.load_notmat(filename: str | bytes | PathLike | Path) dict[source]#

loads .not.mat files created by evsonganaly (Matlab GUI for labeling song)

Parameters:

filename (str) – name of .not.mat file, can include path

Returns:

notmat_dict – variables from .not.mat files

Return type:

dict

Examples

>>> a_notmat = 'gy6or6_baseline_230312_0808.138.cbin.not.mat'
>>> notmat_dict = load_notmat(a_notmat)
>>> notmat_dict.keys()
dict_keys(['__header__', '__version__', '__globals__', 'Fs', 'fname', 'labels',
'onsets', 'offsets', 'min_int', 'min_dur', 'threshold', 'sm_win'])

Notes

Basically a wrapper around scipy.io.loadmat. Calls loadmat with squeeze_me=True to remove extra dimensions from arrays that loadmat parser sometimes adds.

Also note that onsets and offsets from .not.mat files are in milliseconds. The GUI evsonganaly saves onsets and offsets in these units, and we avoid converting them here for consistency and interoperability with Matlab code.