forked from ferchaure/bci
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfiguration.py
78 lines (63 loc) · 2.67 KB
/
configuration.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
78
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""Load onfiguration
Create structures that will be loaded by other modules
@author: Fernando J. Chaure
"""
from Graphics.bci_config_editor import config_editor
confi_tuple = config_editor()
if confi_tuple == None:
GENERAL_CONFIG = None
else:
CONFIG, save_file, CONFIG_PARSER = confi_tuple
GENERAL_CONFIG = {
'ONLINE_MODE' : CONFIG.getboolean('GENERAL', 'online_mode'),
'#CHANNELS' : CONFIG.getint('GENERAL', 'channels'),
'FS' : CONFIG.getfloat('GENERAL', 'fs'),
'PAQ_USB' : CONFIG.getint('GENERAL', 'data_package'),
'ADC_SCALE' : CONFIG.getfloat('GENERAL', 'adc_scale'),
'FORMAT' : CONFIG.get('GENERAL', 'format'),
'FILTERED' : CONFIG.getboolean('GENERAL', 'filtered'),
'PROBES_CONFIG' : CONFIG.get('GENERAL', 'probes_config')
}
FILE_CONFIG = {
'MAX_SIZE_FILE' : CONFIG.getint('FILE', 'max_size_file'),
'GENERIC_FILE' : save_file,
'FORMAT_FILE' : CONFIG.get('FILE', 'format_file'),
}
LIBGRAPH_CONFIG = {
'BEEP_FREQ' : CONFIG.get('GRAPHICS', 'beep_freq'),
'FFT_RESOLUTION' : CONFIG.getint('GRAPHICS', 'fft_resolution'),
'FFT_N' : CONFIG.getint('GRAPHICS', 'fft_n'),
'FFT_L_PAQ' : CONFIG.getint('GRAPHICS', 'fft_l_paq'),
'COL_DISPLAY' : CONFIG.getint('GRAPHICS', 'col_display'),
'TIME_SPIKE_COUNT' : CONFIG.getint('GRAPHICS', 'time_spike_count'),
'DISPLAY_LIMY' : CONFIG.getint('GRAPHICS', 'display_limy'),
'MAX_PAQ_DISPLAY' : CONFIG.getint('GRAPHICS', 'max_paq_display'),
'TWO_WINDOWS' : CONFIG.getboolean('GRAPHICS', 'two_windows')
}
SIGNAL_PROCESSING_CONFIG = {
'LENGTH_FILTER' : CONFIG.getint('SIGNAL_PROCESSING', 'length_filter'),
'FMIN' : CONFIG.getfloat('SIGNAL_PROCESSING', 'fmin'),
'FMAX' : CONFIG.getfloat('SIGNAL_PROCESSING', 'fmax'),
'BAND_PASS' : CONFIG.getboolean('SIGNAL_PROCESSING', 'band_pass'),
'WINDOW_TYPE' : CONFIG.get('SIGNAL_PROCESSING', 'window_type')
}
BIO_CONFIG = {
'SPIKE_DURATION' : CONFIG.getfloat('BIO', 'spike_duration')
}
if GENERAL_CONFIG['PROBES_CONFIG'] == 'Tetrode':
ELEC_GROUP = 4
PROBE_CONF_L = 'TeT'
GROUP_LABEL = 'Tetrode'
elif GENERAL_CONFIG['PROBES_CONFIG'] == 'Stereotrode':
ELEC_GROUP = 2
PROBE_CONF_L = 'SteT'
GROUP_LABEL = 'Stereotrode'
else:
ELEC_GROUP = 1
PROBE_CONF_L = ''
GROUP_LABEL = 'Electrode'
GENERAL_CONFIG['ELEC_GROUP'] = ELEC_GROUP
LIBGRAPH_CONFIG['PROBE_CONF_L'] = PROBE_CONF_L
LIBGRAPH_CONFIG['GROUP_LABEL'] = GROUP_LABEL