f_medium = 5 #Hz fig1 = figure(1) ax_Z = fig1.add_subplot(1,1,1) V=-38.0 delta_f = 0.1 f = arange(.2,500,delta_f) f_from_medium = arange(f_medium,500,1) colour_graph=['r','b'] k_h_values = [1,0.1] for i_k_h,k_h in enumerate(k_h_values): HH = Drone.Vallet92(k_h=k_h) DepolarisePhotoreceptor.WithLight(HH,V) Z = HH.body.impedance(f) #All frequencies print ("When k_h=",k_h, ", Q value = ",Q_value(Z,f)) label_str = 'k_h = ' + str(k_h) ax_Z.loglog(f,abs(Z)/1000,colour_graph[i_k_h],linewidth=2,label = label_str) ax_Z.set_xlabel("Frequency (Hz)") ax_Z.set_ylabel("Impedance (MOhms)") ax_Z.legend(loc=3,prop={'size':12}) show()
__author__ = 'Francisco J. H. Heras' T = 300 #ms dt = 0.05 #ms time_array = arange(0, T + dt, dt) I = zeros_like(time_array) fig1 = plt.figure(1) ax = fig1.add_subplot(211) ax_t = fig1.add_subplot(212) fig2 = plt.figure(2) ax_curr = fig2.add_subplot(211) V_membrane = -38 #mV photoreceptor = Drone.Vallet92() DepolarisePhotoreceptor.WithLight(photoreceptor, V=V_membrane) fig1.text(0.06, 0.5, 'Membrane potential deflection (mV)', ha='center', va='center', rotation='vertical') for ii in range(5): for i, t in enumerate(time_array): if 10 <= t <= 110: I[i] = 1e-3 * (-0.02 + 0.01 * ii) # nA->uA DepolarisePhotoreceptor.WithLight(photoreceptor, V=V_membrane) V_array, g_Ch = Experiment.inject_current(photoreceptor, I, dt)
#!/usr/bin/python3 from pylab import * from numpy import * import Drone as Drone from phhotoreceptor.DepolarisePhotoreceptor import DepolarisePhotoreceptor from GBWPutils import GBWP, Is_Band_Pass HH = Drone.Vallet92() #Modified drone photoreceptor ####### BODY STARTS HERE n = 100 tau_m = linspace(.01, 3, n) #.01,3 tau_h = linspace(.01, 15, n) #.01,15 extent = (tau_m[0], tau_m[-1], tau_h[0], tau_h[-1]) Tau_m, Tau_h = meshgrid(tau_m, tau_h) fig1 = figure(1) # Plot comparing against RC ax_gbwp1 = fig1.add_subplot(111) fig2 = figure(2) ax_low_pass = fig2.add_subplot(111) V = -38 DepolarisePhotoreceptor.WithLight(HH, V) GBWP1_a = zeros_like(Tau_h) Band_pass_a = zeros_like(Tau_h) passive_gbwp = 1 / 2 / pi / HH.body.C tau_h_original = HH.body.voltage_channels[0].h_time(V) tau_m_original = HH.body.voltage_channels[0].m_time(V)