-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathconfig.py
77 lines (61 loc) · 2.32 KB
/
config.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
"""
===========
Config file
===========
Configuration parameters for the study.
"""
import os
import getpass
from socket import getfqdn
from fnames import FileNames
###############################################################################
# Determine which user is running the scripts on which machine and set the path
# where the data is stored and how many CPU cores to use.
user = getpass.getuser() # Username of the user running the scripts
host = getfqdn() # Hostname of the machine running the scripts
# You want to add your machine to this list
if user == 'vanvliet':
# My laptop
raw_data_dir = './data'
n_jobs = 4 # My laptop has 4 cores
elif host == 'nbe-024.org.aalto.fi' and user == 'vanvlm1':
# My workstation
raw_data_dir = './data'
n_jobs = 8 # My workstation has 8 cores
else:
# Defaults
raw_data_dir = './data'
n_jobs = 1
# For BLAS to use the right amount of cores
os.environ['OMP_NUM_THREADS'] = str(n_jobs)
###############################################################################
# These are all the relevant parameters for the analysis.
sample_rate = 1000 # Hz
fmin = 1.0 # Hz
fmax = 20.0 # Hz
# All subjects
subjects = ['sub01', 'sub02']
###############################################################################
# Templates for filenames
#
# This part of the config file uses the FileNames class. It provides a small
# wrapper around string.format() to keep track of a list of filenames.
# See fnames.py for details on how this class works.
fname = FileNames()
# Some directories
fname.add('raw_data_dir', raw_data_dir)
fname.add('processed_data_dir', './processed')
fname.add('figures_dir', './figures')
# The data files that are used and produced by the analysis steps
fname.add('input', '{raw_data_dir}/input-{subject}.txt')
fname.add('output', '{processed_data_dir}/output-{subject}.txt')
fname.add('grand_average', '{processed_data_dir}/grand_average.txt')
# The figures
fname.add('figure1', '{figures_dir}/figure1.pdf')
fname.add('figure_grand_average', '{figures_dir}/figure_grand_average.pdf')
# Filenames for MNE reports
fname.add('reports_dir', './reports/')
fname.add('report', '{reports_dir}/{subject}-report.h5')
fname.add('report_html', '{reports_dir}/{subject}-report.html')
# File produced by check_system.py
fname.add('system_check', './system_check.txt')