<commit_before>import mne
import sys

from mne import compute_covariance

import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt

from my_settings import *

reject = dict(
    grad=4000e-13,  # T / m (gradiometers)
    mag=4e-12,  # T (magnetometers)
    eeg=180e-6  #
)

subject = sys.argv[1]

epochs = mne.read_epochs(epochs_folder + "%s_trial_start-epo.fif" % subject)
epochs.drop_bad_epochs(reject_params)

# fig = epochs.plot_drop_log(subject=subject, show=False)
# fig.savefig(epochs_folder + "pics/%s_drop_log.png" % subject)

# Make noise cov
cov = mne.compute_covariance(
    epochs,
    method=['empirical', 'shrunk'],
    tmin=-0.8,
    tmax=0.0,
    return_estimators=True,
    verbose=True)

evoked = epochs.average()
fig = evoked.plot_white(cov, show=False)
fig.subtitle("subject: %s" % subject)
fig.savefig(mne_folder + "sub_%.png" % subject)<commit_msg>Fixed path error<commit_after>import mne
import sys

from mne import compute_covariance

import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt

from my_settings import *

reject = dict(
    grad=4000e-13,  # T / m (gradiometers)
    mag=4e-12,  # T (magnetometers)
    eeg=180e-6  #
)

subject = sys.argv[1]

epochs = mne.read_epochs(epochs_folder + "%s_trial_start-epo.fif" % subject)
epochs.drop_bad_epochs(reject_params)

# fig = epochs.plot_drop_log(subject=subject, show=False)
# fig.savefig(epochs_folder + "pics/%s_drop_log.png" % subject)

# Make noise cov
cov = mne.compute_covariance(
    epochs,
    method=['empirical', 'shrunk'],
    tmin=-0.8,
    tmax=0.0,
    return_estimators=True,
    verbose=True)

evoked = epochs.average()
fig = evoked.plot_white(cov, show=False)
fig.subtitle("subject: %s" % subject)
fig.savefig(mne_folder + "cov_plots/sub_%.png" % subject)
{'fraction_non_alphanumeric': 0.13277310924369748, 'fraction_numerical': 0.020168067226890758, 'mean_word_length': 4.58125, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6679090', 'n_tokens_mistral': 732, 'n_tokens_neox': 711, 'n_words': 129}