Example #1
0
def get_max_tp(cell, amp, x_dist_val,y): #square wave
	[t,i]=pdl.make_triphasic(mydelay,mydur,amp,mysimtime,mydt)
	sim = pdl.Simulation(cell,mydt,sim_time = mysimtime)
	sim.set_exstim([t,i],x_dist=x_dist_val,y_dist = y,rho = myrho)
	sim.go()
	_,som_rec,ax_rec = sim.get_recording()
	return som_rec,ax_rec
def get_max_tp(cell, triamp, x_dist_val):
    [t, i] = pdl.make_triphasic(mydelay, mydur, mydt, mysimtime, triamp)
    sim = pdl.Simulation(cell, mydt, sim_time=mysimtime)
    sim.set_exstim([t, i], x_dist=x_dist_val, y_dist=3, rho=myrho)
    sim.go()
    _, som_rec, _ = sim.get_recording()
    return som_rec
Example #3
0
import matplotlib.pyplot as plt
import sqlite3 as sqlite
import pyneurlib as pdl
import numpy as np

cell = pdl.RGC_Neuron('fohlmeister_geo_params_light.csv',True,True)

mydt = .01
mydur = .3
mysimtime = 500
mydelay = 100
bigv = []
reps = range(10)
for i_amp in [.2e3, .4e3, .5e3, .7e3, 1e3, 1.2e3, 1.5e3, 2e3, 2.5e3]: #microamps
	smallv = []
	for rep in reps: 
		print i_amp

		triamp = i_amp
		[t,i]=pdl.make_triphasic(mydelay,mydur,mydt,mysimtime,triamp)
		i = i + .1*(np.random.rand(len(t))-0.5)
		sim = pdl.Simulation(cell,mydt)
#sim.set_IClamp()
		myrho = 4e6
		sim.set_exstim([t,i],x_dist=10,y_dist=7,rho = myrho) #this rho isn't the best!
		sim.go()
		smallv.append(sim.get_recording()[1])
	bigv.append(smallv)
#	sim.show()

Example #4
0
	amp = 2000
	y = y_soma_tp_rand_norm
	y = 30
	x_soma = 0
	#mydt = .1
	cntlim = 30

	mydelay = 0
	mysimtime = 4
	#mysimtime = 15
	stim_params = [mydelay, dur, mysimtime, mydt, myrho]

	cell = pdl.RGC_Neuron('fohlmeister_geo_params_ultraultralight_minaxon_somaparams.csv',ex_flag = True, dendrite_flag = False)
	#cell = pdl.RGC_Neuron('fohlmeister_geo_params_ultraultralight_minaxon_somaparams.csv',ex_flag = True, dendrite_flag = True)

	[t,i] = pdl.make_triphasic(mydelay, dur, amp, mysimtime, mydt)
	sim = pdl.Simulation(cell,mydt,sim_time = mysimtime)
	sim.set_exstim([t,i],x_dist = x_soma, y_dist = y, rho = myrho)
	sim.go()
	sim.show(showAx = 0)
	#sim.show(showAx = 2)
	#plt.figure()
	#plt.plot(t,i)

	#thr = ptl.get_thresh(cell, 'tp', init_amp, init_step, x_soma, y, stim_params, cnt_lim = cntlim)
	#print thr

#Jepson Analysis Extended - soma only
##because we're doing comparison between two conditions, all parameters are specified here
elif TEST_TYPE == 21:
Example #5
0
import pyneurlib as pdl
import matplotlib.pyplot as plt

plt.figure()
t,x = pdl.make_triphasic(100, 150, 1.5, 450, .1)
plt.plot(t,x-2)
t,x = pdl.make_dppbal(100, 200, 50, 100, 1, 1.5, 500, .1)
plt.plot(t,x+2)
plt.ylabel('Amplitude (nA)')
plt.xlabel('Time (us)')
plt.title('Triphasic and Depolarizing Pre-Pulse Waveforms')
plt.show()

savefig('waveform_2.png')
savefig('waveform_2.svg')