def logmeta(self): """Logs everything important to C:\ExperimentData\ """ dir = "C:\\ExperimentData\\" + self.static.expid + "\\" file = "sweep.log" path = os.path.join(dir, file) log = ailogger(path) log.add(script = self.script) log.add(logpath = log.fullPath) log.comment(' --------------------Header-------------------------- ') log.add(header = str(self.header.text)) log.comment(' --------------------Timestamps---------------------- ') log.add(startdatetime = self.startdatetime) log.add(stoptdateime = self.stopdatetime) log.add(starttime = self.starttime) log.add(stoptime = self.stoptime) log.add(durationexpected = isotime(self.sec, 6)) log.add(durationactual = isotime(self.stoptime-self.starttime,6)) log.comment(' --------------------Parameters---------------------- ') log.add(staticparams = self.static) log.add(dynamicparams = self.dynamic) #log.add(variables = self.variables) #needs _repr_ methon in Core.Variables class log.add(sweeporder = self.sweeptable.i.tolist()) log.add(sweeptable = npdict2listdict(self.sweeptable.data)) log.add(sweeptableformatted = self.sweeptable._pprint()) log.comment( ' -------------------Dimstim Performance Data-------- ') log.add(vsynctable = self.vsynctimer.pprint()) log.add(vsyncsdisplayed = self.nvsyncsdisplayed) log.add(sweepscompleted = self.ii) log.add(droppedframes = self.vsynctimer.drops) log.close()
def logmeta(self): """Logs everything important to C:\MouseData\ """ dir = "C:\\ExperimentData\\" + self.static.mouseid + "\\" file = "sweep.log" #also appends timestamp to path = os.path.join(dir, file) log = ailogger(path) log.add(script = self.script) log.add(starttime = self.startdatetime) log.add(stoptime = self.stopdatetime) log.comment(' Parameters ') log.add(staticparams = self.static) log.add(dynamicparams = self.dynamic) #log.add(variables = self.variables) #needs _repr_ methon in Core.Variables class log.add(sweeporder = self.sweeptable.i.tolist()) log.add(sweeptable = npdict2listdict(self.sweeptable.data)) log.add(sweeptableformatted = self.sweeptable._pprint()) log.comment( ' Mouse Performance Data ') log.add(laps = self.laps) log.add(rewards = self.rewards) log.add(posx = self.posx) log.add(dx = self.dx) log.add(terrain = self.terrain.__dict__) log.add(terrainlog = self.terrainlog) log.comment( ' Dimstim Performance Data ') log.add(vsynctable = self.vsynctimer.pprint()) log.add(vsyncsdisplayed = self.nvsyncsdisplayed) log.add(sweepscompleted = self.ii) log.add(droppedframes = self.vsynctimer.drops) log.close()
def logmeta(self): """Logs everything important to C:\ExperimentData\ """ dir = "C:\\ExperimentData\\" + self.mouseid + "\\" file = "manual.log" path = os.path.join(dir, file) log = ailogger(path) log.add(script = self.script) log.add(starttime = self.startdatetime) log.add(stoptime = self.stopdatetime) log.comment(' Parameters ') log.add(staticparams = self.params) log.comment( ' Mouse Performance Data ') log.add(laps = self.laps) log.add(rewards = self.rewards) log.add(posx = self.posx) log.add(dx = self.dx) log.add(terrain = self.terrain.__dict__) log.add(terrainlog = self.terrainlog) log.close()
def logMeta(self): """ Writes all important information to log. """ ##TODO: Think of a better way to do this, or move it out of this class somehow. dir = self.logdir file = self.mouseid + ".log" #logger automatically appends timestamp path = os.path.join(dir,file) log = ailogger(path) log.add(script = self.script) log.add(scripttext = open(self.script,'r').read()) log.add(mouseid = self.mouseid) log.add(userid = self.userid) log.add(task = self.task) log.add(stage = self.stage) log.add(protocol = self.protocol) log.add(logdir = self.logdir) log.add(backupdir = self.backupdir) log.add(monitor = getMonitorInfo(self.monitor)) log.add(startdatetime = str(self.startdatetime)) log.add(stopdatetime = str(self.stopdatetime)) log.add(starttime = self.starttime) log.add(stoptime = self.stoptime) log.add(vsynccount = self.vsynccount) log.add(sweeps = self.sweepsdisplayed) log.add(genericparams = self.params) log.add(runs = self.runs) log.add(blanksweeps = self.blanksweeps) log.add(bgsweep = npdict2listdict(self.bgSweep)) log.add(fgsweep = self.fgSweep) log.add(bgframe = self.bgFrame) log.add(fgframe = self.fgFrame) log.add(bgsweeptable = removenparrays(self.bgsweeptable)) log.add(bgsweeporder = self.bgsweeporder) log.add(bgdimnames = self.bgdimnames) log.add(fgsweeptable = self.fgsweeptable) log.add(fgsweeporder = self.fgsweeporder) log.add(fgdimnames = self.fgdimnames) log.add(bgsweepframes = getSweepFrames(self.bgsweeporder,self.sweeplength,self.preexpsec,self.postexpsec,self.postsweepsec)) log.add(vsyncintervals = map(prettyfloat,self.intervalsms.tolist())) log.add(droppedframes = self.droppedframes) log.close()