-
Notifications
You must be signed in to change notification settings - Fork 370
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refractory tests and corrected hh_cond_exp_traub (fixes #473) #590
Changes from 1 commit
146164e
70b46c2
1ec4881
c2e0238
aa068bc
299b2f4
3d5a563
b76cb4a
f3b4b79
412ba61
bcdced1
4a84dc1
0b58324
964b614
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -134,14 +134,14 @@ | |
|
||
|
||
# --------------------------------------------------------------------------- # | ||
# Simulation and refractory time | ||
# Simulation and refractory time limits | ||
# ------------------------- | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you could change this to "refractory time limits" to avoid confusion as this are only the lower and upper bounds right? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done (and additional comments added) |
||
# | ||
|
||
simtime = 100 | ||
resolution = 0.1 | ||
min_steps = 1 | ||
max_steps = 200 | ||
min_steps = 1 # minimal number of refractory steps (t_ref = resolution in ms) | ||
max_steps = 200 # maximal number of steps (t_ref = 200 * resolution in ms) | ||
|
||
|
||
# --------------------------------------------------------------------------- # | ||
|
@@ -201,12 +201,13 @@ def compute_reftime(self, model, sd, vm, neuron): | |
else: | ||
Vr = nest.GetStatus(neuron, "V_reset")[0] | ||
times = nest.GetStatus(vm, "events")[0]["times"] | ||
idx_max = (np.argwhere(np.isclose(times, spike_times[1]))[0][0] | ||
if len(spike_times) > 1 else -1) | ||
# index of the 2nd spike | ||
idx_max = np.argwhere(times == spike_times[1])[0][0] | ||
name_Vm = "V_m.s" if model == "iaf_cond_alpha_mc" else "V_m" | ||
Vs = nest.GetStatus(vm, "events")[0][name_Vm] | ||
# get the index at which the spike occured | ||
idx_spike = np.argwhere(times == spike_times[0])[0][0] | ||
# find end of refractory period between 1st and 2nd spike | ||
idx_end = np.where( | ||
np.isclose(Vs[idx_spike:idx_max], Vr, 1e-6))[0][-1] | ||
t_ref_sim = idx_end * resolution | ||
|
@@ -226,7 +227,7 @@ def test_refractory_time(self, model): | |
vm_params = {"interval": resolution, "record_from": [name_Vm]} | ||
vm = nest.Create("voltmeter", params=vm_params) | ||
sd = nest.Create("spike_detector", params={'precise_times': True}) | ||
cg = nest.Create("dc_generator", params={"amplitude": 600.}) | ||
cg = nest.Create("dc_generator", params={"amplitude": 900.}) | ||
# for models that do not clamp V_m, use very large current to trigger | ||
# almost immediate spiking => t_ref almost equals interspike | ||
if model in neurons_interspike_ps: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Silmathoron, Sorry, I meant to change this to "Simulation time and refractory time limits"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
easy ;)