# You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. # # Author: # Mateusz Kruszyński <*****@*****.**> import sys, os.path, settings from data_storage import csv_manager from openbci.offline_analysis.obci_signal_processing import read_manager from openbci.offline_analysis.obci_signal_processing.tags import tag_utils from openbci.offline_analysis.obci_signal_processing.tags import tags_file_writer import trigger from offline_analysis import offline_analysis_logging as logger LOGGER = logger.get_logger("trigger_experiment") class ExperimentTag(object): def __init__(self, keys, values): for i, key in enumerate(keys): setattr(self, key, values[i]) def get_name(self): return None def get_desc(self): return self.__dict__ class KamilExpTag(ExperimentTag): def get_name(self):
# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. # # Author: # Mateusz Kruszyński <*****@*****.**> import sys from offline_analysis import offline_analysis_logging as logger LOGGER = logger.get_logger("trigger") def fix_trigger(trig_values, trig_change_tss, trig_change_lens, min_trig_samples_len=0): """ For given trigger parameters (described in output description of get_trigger) try to remove very short triggers (of samples length - min_trig_samples_len) as this is considered as an unexpected fluctuation, not planned trigger. >>> fix_trigger([1,0,1,0,1,0], [1,2,3,4,5,6], [20, 5, 30, 6, 5, 4], 6) ([1, 0], [1, 4], [55, 15]) >>> fix_trigger([1], [100], [20000], 6)
# You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. # # Author: # Mateusz Kruszyński <*****@*****.**> import sys, os.path, settings from data_storage import csv_manager from openbci.offline_analysis.obci_signal_processing import read_manager from openbci.offline_analysis.obci_signal_processing.tags import tag_utils from openbci.offline_analysis.obci_signal_processing.tags import tags_file_writer import trigger from offline_analysis import offline_analysis_logging as logger LOGGER = logger.get_logger("trigger_experiment") class ExperimentTag(object): def __init__(self, keys, values): for i, key in enumerate(keys): setattr(self, key, values[i]) def get_name(self): return None def get_desc(self): return self.__dict__ class KamilExpTag(ExperimentTag):
# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. # # Author: # Mateusz Kruszyński <*****@*****.**> import sys from offline_analysis import offline_analysis_logging as logger LOGGER = logger.get_logger("trigger") def fix_trigger(trig_values, trig_change_tss, trig_change_lens, min_trig_samples_len=0): """ For given trigger parameters (described in output description of get_trigger) try to remove very short triggers (of samples length - min_trig_samples_len) as this is considered as an unexpected fluctuation, not planned trigger. >>> fix_trigger([1,0,1,0,1,0], [1,2,3,4,5,6], [20, 5, 30, 6, 5, 4], 6) ([1, 0], [1, 4], [55, 15]) >>> fix_trigger([1], [100], [20000], 6) ([1], [100], [20000]) >>> fix_trigger([1], [100], [20000], 20001) ([], [], [])