Skip to content

Commit

Permalink
Merge pull request #161 from AurelienJaquier/BPE-amp2
Browse files Browse the repository at this point in the history
ecodes with amp2 output fix
  • Loading branch information
AurelienJaquier authored Dec 5, 2023
2 parents 3eca13e + 0051d44 commit 4103eeb
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 2 deletions.
6 changes: 5 additions & 1 deletion bluepyefe/ecode/DeHyperPol.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ class DeHyperPol(Recording):

"""DeHyperpol current stimulus
The hyperpolarizing step is usually fixed at 150% of rheobase, and the hyperpolarizing step
can usually vary from -40% to -160% of rheobase.
hypamp hypamp+amp hypamp+amp2 hypamp
: : : :
: _________________ : :
Expand Down Expand Up @@ -89,9 +92,10 @@ def get_stimulus_parameters(self):
ecode_params = {
"delay": self.ton,
"tmid": self.tmid,
"toff": self.toff,
"amp": self.amp,
"amp2": self.amp2,
"thresh_perc": self.amp_rel,
"thresh_perc": self.amp2_rel,
"duration": self.toff - self.ton,
"totduration": self.tend,
}
Expand Down
5 changes: 4 additions & 1 deletion bluepyefe/ecode/HyperDePol.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ class HyperDePol(Recording):

"""HyperDepol current stimulus
The hyperpolarizing step is usually fixed at 100% of rheobase, and the hyperpolarizing step
can usually vary from -40% to -160% of rheobase.
hypamp hypamp+amp hypamp+amp2 hypamp
: : : :
Expand Down Expand Up @@ -95,7 +98,7 @@ def get_stimulus_parameters(self):
"toff": self.toff,
"amp": self.amp,
"amp2": self.amp2,
"thresh_perc": self.amp2_rel,
"thresh_perc": self.amp_rel,
"duration": self.toff - self.ton,
"totduration": self.tend,
}
Expand Down
5 changes: 5 additions & 0 deletions bluepyefe/ecode/negCheops.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@ def get_stimulus_parameters(self):
"""Returns the eCode parameters"""
ecode_params = {
"delay": self.ton,
"t1": self.t1,
"t2": self.t2,
"t3": self.t3,
"t4": self.t4,
"toff": self.toff,
"amp": self.amp,
"thresh_perc": self.amp_rel,
"duration": self.toff - self.ton,
Expand Down
3 changes: 3 additions & 0 deletions bluepyefe/ecode/sAHP.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ class SAHP(Recording):

"""sAHP current stimulus
The long step (here amp) is usually fixed at 40% of rheobase, and the short step (here amp2)
can usually vary from 150% to 300% of rheobase.
hypamp hypamp+amp hypamp+amp2 hypamp+amp hypamp
: : : : :
Expand Down
3 changes: 3 additions & 0 deletions bluepyefe/protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,9 @@ def reduce_ecode(self, ecode, operator):
if key == "amp" and self.global_rheobase:
amp_rel = operator([c["amp_rel"] for c in params])
mean_param = float(amp_rel) * self.global_rheobase / 100.
elif key == "amp2" and self.global_rheobase:
amp_rel2 = operator([c["amp_rel2"] for c in params])
mean_param = float(amp_rel2) * self.global_rheobase / 100.
else:
mean_param = operator([numpy.nan if c[key] is None else c[key] for c in params])

Expand Down

0 comments on commit 4103eeb

Please sign in to comment.