def save(self, fname):
        check_fname(fname, 'covariance', ('-cov.fif', '-cov.fif.gz'))

        fid = start_file(fname)

        try:
            _write_cov(fid, self)
        except Exception as inst:
            fid.close()
            os.remove(fname)
            raise inst

        end_file(fid)
Save covariance matrix in a FIF file.
dataset/ETHPy150Open mne-tools/mne-python/mne/cov.py/Covariance.save