def __init__(self, subject, pre_fix): self.logger = Logger(subject, pre_fix) self.trialsDesired = 50 startVal = 0.5 nReversals = 10 stepSizes = [0.03, 0.01, 0.01, 0.005, 0.005, 0.002, 0.001] nTrials = 50 nUp = 1 nDown = 3 stepType = "lin" minVal = 0 maxVal = 0.5 self.staircase_obj = StaircaseObject(startVal, nReversals, stepSizes, nTrials, nUp, nDown, stepType, minVal, maxVal) self.logger.write("Staircase for Stereo Threshold measurement") self.logger.write("Staircase object is initiated with " "startVal:%.2f " "nReversals:%.2f " "stepSizes:%s " "nTrials:%.2f " "nUp:%.2f " "nDown:%.2f " "minVal:%.2f " "maxVal:%.2f " % (startVal, nReversals, stepSizes, nTrials, nUp, nDown, minVal, maxVal)) self.logger.write("Staircase trials is set to %d" % nTrials)
def __init__(self, logfile): self.logfile = logfile params_line = self.get_init_params() startVal = eval( re.compile(r'startVal:([0-9.]+) ').findall(params_line)[0]) nReversals = eval( re.compile(r'nReversals:([0-9.]+) ').findall(params_line)[0]) stepSizes = eval( re.compile(r'stepSizes:(\[.+\]) ').findall(params_line)[0]) nTrials = eval( re.compile(r'nTrials:([0-9.]+) ').findall(params_line)[0]) nUp = eval(re.compile(r'nUp:([0-9.]+) ').findall(params_line)[0]) nDown = eval(re.compile(r'nDown:([0-9.]+) ').findall(params_line)[0]) stepType = "lin" minVal = eval(re.compile(r'minVal:([0-9.]+) ').findall(params_line)[0]) maxVal = eval(re.compile(r'maxVal:([0-9.]+)').findall(params_line)[0]) self.logger = ModLogger(self.logfile, 'recomp') self.staircase_obj = StaircaseObject(startVal, nReversals, stepSizes, nTrials, nUp, nDown, stepType, minVal, maxVal) self.logger.write("Staircase for Stereo Threshold measurement") self.logger.write("Staircase object is initiated with " "startVal:%.2f " "nReversals:%.2f " "stepSizes:%s " "nTrials:%.2f " "nUp:%.2f " "nDown:%.2f " "minVal:%.2f " "maxVal:%.2f " % (startVal, nReversals, stepSizes, nTrials, nUp, nDown, minVal, maxVal)) self.logger.write("Staircase trials is set to %d" % nTrials)