<commit_before># -*- coding: utf-8 -*-
"""
Created on Fri Apr 22 16:55:00 2016

@author: mje
"""

import mne
import numpy as np
from my_settings import (epochs_folder, tf_folder)
from mne.time_frequency import tfr_morlet, write_tfrs
import sys

subject = sys.argv[1]

freqs = np.arange(8, 13, 1)  # define frequencies of interest
n_cycles = 4.  # freqs / 2.  # different number of cycle per frequency

sides = ["left", "right"]
conditions = ["ctl", "ent"]

epochs = mne.read_epochs(
    epochs_folder + "%s_trial_start-epo.fif" % subject, preload=True)
epochs.resample(250)

for cond in conditions:
    for side in sides:
        tfrs = tfr_morlet(
            epochs[cond + "/" + side][:10],
            freqs=freqs,
            n_cycles=n_cycles,
            use_fft=True,
            average=False,
            return_itc=False,
            n_jobs=1)
        tfrs.nave = 1
        write_tfrs(
            tf_folder + "%s_%s_%s-4-tfr.hd5" % (subject, cond, side),
            tfrs,
            overwrite=True)
<commit_msg>updated to naming std<commit_after># -*- coding: utf-8 -*-
"""
Created on Fri Apr 22 16:55:00 2016

@author: mje
"""

import mne
import numpy as np
from my_settings import (epochs_folder, tf_folder)
from mne.time_frequency import tfr_morlet, write_tfrs
import sys

subject = sys.argv[1]

freqs = np.arange(8, 13, 1)  # define frequencies of interest
n_cycles = 4.  # freqs / 2.  # different number of cycle per frequency

sides = ["left", "right"]
conditions = ["ctl", "ent"]

epochs = mne.read_epochs(
    epochs_folder + "%s_trial_start-epo.fif" % subject, preload=True)
epochs.resample(250)

for cond in conditions:
    for side in sides:
        tfrs = tfr_morlet(
            epochs[cond + "/" + side][:10],
            freqs=freqs,
            n_cycles=n_cycles,
            use_fft=True,
            average=False,
            return_itc=False,
            n_jobs=1)
        tfrs.nave = 1
        write_tfrs(
            tf_folder + "%s_%s_%s-4-tfr.h5" % (subject, cond, side),
            tfrs,
            overwrite=True)

{'fraction_non_alphanumeric': 0.12068126520681265, 'fraction_numerical': 0.028223844282238442, 'mean_word_length': 2.4496644295302015, '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': '5770052', 'n_tokens_mistral': 789, 'n_tokens_neox': 745, 'n_words': 185}