コード例 #1
0
 def parse_observable(self):
     if 'file' in self.observable:
         f = fn.FileNodeHelper(self.observable['file'], self.omt_root)
         inform('Activation variable from file',
                self.observable['file'],
                indent=1,
                verbosity=1)
         return f.get_timeseries()
コード例 #2
0
 def before_running(self):
     if 'file' in self.observable:
         self.f = fn.FileNodeHelper(self.observable['file'], self.omt_root)
         if self.f.tstamp:
             inform('Attention! Preexistent datafile: ',
                    self.f.filename,
                    indent=2,
                    verbosity=1)
コード例 #3
0
 def parse_expected(self):
     to_parse = self.expected
     if isinstance(to_parse, list):
         ts = to_parse
     elif 'file' in to_parse:
         f = fn.FileNodeHelper(to_parse['file'], self.mep_root)
         ts = f.get_timeseries()
         inform('Reading timeseries from: ', f, indent=1, verbosity=1)
     return ts
コード例 #4
0
 def parse_spikes(self, to_parse):
     if isinstance(to_parse, list):
         spikes = to_parse
     elif 'file' in to_parse:
         f = fn.FileNodeHelper(to_parse['file'])
         tv = f.get_timeseries()
         inform('Reading timeseries from:', f, indent=1)
         if 'spike detection' in to_parse:
             sd = to_parse['spike detection']
             method = sd.get('method', 'threshold')
             threshold = float(sd.get('threshold', 0))
             inform('Detecting spikes with method:', method, indent=2)
             spikes = ts.spikes_from_timeseries(tv, method=method, threshold=threshold)
     return spikes
コード例 #5
0
    def parseOMT(self, to_parse):
        f = fn.FileNodeHelper(to_parse['file_Vm'], self.omt_root)
        f_i = fn.FileNodeHelper(to_parse['file_VC_i'], self.omt_root)
        inform('Calculating input resistance from files:',
               (f.filename, f_i.filename),
               indent=1,
               verbosity=1)
        h_voltage = to_parse.get('holding voltage', -70.)
        cmd_voltage = to_parse.get('command voltage', -80.)
        h_window = to_parse.get('holding window', [0., 0.])
        cmd_window = to_parse.get('command window', [0., 0.])

        # h_window = [float(t) for t in to_parse.get('holding window', [0., 0.])[0].split()]
        # cmd_window = [float(t) for t in to_parse.get('command window', [0., 0.])[0].split()]
        inform('Time wondow used for detection of current injections:',
               (h_window, cmd_window),
               indent=2,
               verbosity=1)
        input_resistance = ts.input_resistance(f.get_timeseries(),
                                               f_i.get_timeseries(), h_window,
                                               cmd_window,
                                               (h_voltage, cmd_voltage))
        return input_resistance
コード例 #6
0
 def parse_resting(self, to_parse):
     if isinstance(to_parse, (int, float)):
         resting = to_parse
         inform('Explicit resting potential specified:', to_parse, indent=1)
     elif 'file' in to_parse:
         f = fn.FileNodeHelper(to_parse['file'])
         inform('Calculating resting potential from file:',
                f.filename,
                indent=1)
         window = to_parse.get('average last', 1)
         if window > 1:
             inform('Number of final points taken for averaging:',
                    window,
                    indent=2)
         resting = ts.average_resting(f.get_timeseries(), window)
     return resting