import sys,os sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)),"../../dataAcq/buffer/python")) sys.path.append("../signalProc") import preproc import bufhelp #import linear import pickle bufhelp.connect() trlen_ms = 600 run = True print ("Waiting for startPhase.cmd event.") while run: e = bufhelp.waitforevent("startPhase.cmd",1000, True) print("Got startPhase event: %s"%e) if e is not None: if e.value == "calibration": print("Calibration phase") data, events, stopevents = bufhelp.gatherdata("stimulus.tgtFlash",trlen_ms,("stimulus.training","end"), milliseconds=True) pickle.dump({"events":events,"data":data}, open("subject_data", "w")) elif e.value == "train": print("Training classifier") data = preproc.detrend(data) data, badch = preproc.badchannelremoval(data) data = preproc.spatialfilter(data) data = preproc.spectralfilter(data, (0, .1, 10, 12), bufhelp.fSample) data, events, badtrials = preproc.badtrailremoval(data, events)
import sys sys.path.append("../../dataAcq/buffer/python") sys.path.append("../signalProc") import preproc import bufhelp #import linear import pickle bufhelp.connect() trlen_ms = 600 run = True print "Waiting for startPhase.cmd event." while run: e = bufhelp.waitforevent("startPhase.cmd",1000, False) if e is not None: if e.value == "calibration": print "Calibration phase" data, events, stopevents = bufhelp.gatherdata("stimulus.tgtFlash",trlen_ms,("stimulus.training","end"), milliseconds=True) pickle.dump({"events":events,"data":data}, open("subject_data", "w")) elif e.value == "train": print "Training classifier" data = preproc.detrend(data) data, badch = preproc.badchannelremoval(data) data = preproc.spatialfilter(data) data = preproc.spectralfilter(data, (0, .1, 10, 12), bufhelp.fSample) data, events, badtrials = preproc.badtrailremoval(data, events)
os.path.join(os.path.dirname(os.path.abspath(__file__)), "../../dataAcq/buffer/python")) sys.path.append("../signalProc") import preproc import bufhelp #import linear import pickle bufhelp.connect() trlen_ms = 600 run = True print("Waiting for startPhase.cmd event.") while run: e = bufhelp.waitforevent("startPhase.cmd", 1000, True) print("Got startPhase event: %s" % e) if e is not None: if e.value == "calibration": print("Calibration phase") data, events, stopevents = bufhelp.gatherdata( "stimulus.tgtFlash", trlen_ms, ("stimulus.training", "end"), milliseconds=True) pickle.dump({ "events": events, "data": data }, open("subject_data", "w")) elif e.value == "train":
import sys sys.path.append("../../dataAcq/buffer/python") sys.path.append("../signalProc") import preproc import bufhelp #import linear import pickle bufhelp.connect() trlen_ms = 600 run = True print "Waiting for startPhase.cmd event." while run: e = bufhelp.waitforevent("startPhase.cmd", 1000, False) if e is not None: if e.value == "calibration": print "Calibration phase" data, events, stopevents = bufhelp.gatherdata( "stimulus.tgtFlash", trlen_ms, ("stimulus.training", "end"), milliseconds=True) pickle.dump({ "events": events, "data": data }, open("subject_data", "w")) elif e.value == "train":