def setUp(self): self.values=[] nb_cells = 10 frequencies = np.arange(0,100,10) for idx in xrange(nb_cells): sig = np.sin(2*3.14*frequencies[idx]*np.arange(1000)) for val in sig: self.values.append((idx, val)) self.analog = analogs.VmList(self.values, range(10), 0.1) try: os.mkdir("Plots") except Exception: pass
def read_analogs(self, type, params): p = self.__check_params(params) data = self.get_data() data, p = self._fix_id_list(data, p) from NeuroTools.signals import analogs if type == "vm": return analogs.VmList(data, p['id_list'], p['dt'], p['t_start'], p['t_stop'], p['dims']) elif type == "current": return analogs.CurrentList(data, p['id_list'], p['dt'], p['t_start'], p['t_stop'], p['dims']) elif type == "conductance": if len(data[0,:]) > 2: g_exc = analogs.ConductanceList(data[:,[0,1]] , p['id_list'], p['dt'], p['t_start'], p['t_stop'], p['dims']) g_inh = analogs.ConductanceList(data[:,[0,2]] , p['id_list'], p['dt'], p['t_start'], p['t_stop'], p['dims']) return [g_exc, g_inh] else: return analogs.ConductanceList(data, p['id_list'], p['dt'], p['t_start'], p['t_stop'], p['dims'])