Hello
I am using pulsedistrib.zip, to deliver a set of 10 pulses of 1ms approx per pulse.
I am having difficulty controlling the Ipulse2 parameters either from my python script or directly from within the mod file.
For example, the following syntax doesn't work:
iclamp = h.Ipulse2(bs.soma(0.5)) #where bs is my basket cell
iclamp.dur = 0.01
iclamp.num=10
iclamp.per=0.1
Questions:
1. what is the right syntax to control Ipulse2 params?
2. how can I record the delivered pulses (i.e the iclamp._ref_i or something analogous)
3. why are there two values for params such as dur and per in the Ipulse2 mod file? I was expecting to see single values, not sure what i.e the interval <0, 1e9> represents.
thank you,
Alexandra
recording delivered pulses using pulsedistrib.zip
Moderator: hines
-
- Posts: 69
- Joined: Wed Jun 17, 2015 5:31 pm
-
- Site Admin
- Posts: 6384
- Joined: Wed May 18, 2005 4:50 pm
- Location: Yale University School of Medicine
- Contact:
Re: recording delivered pulses using pulsedistrib.zip
Good questions. Before addressing them, I should mention that
1. you're asking about mechanisms that deliver a series of one or more current pulses at regular intervals
2. the source code for these mechanisms is in https://www.neuron.yale.edu/ftp/ted/neu ... istrib.zip
3. these mechanisms differ in terms of how one specifies the parameters that govern the pulses. Ipulse1 needs ton (duration of current pulse) and toff (interpulse interval), while Ipulse2 needs dur (same as Ipulse1's ton) and per (the period of the stimlus train, which is the same as Ipulse1's ton+toff). Ipulse3 is triggered by an event from a NetCon, and delivers single current pulse of user-specified amplitude and duration; events that arrive during an ongoing pulse are ignored.
4. the parameter "del" will automatically be known to Python as "delay" (because del is a reserved word in Python). Example:
pulser = h.Ipulse2(soma(0.5))
pulser.delay = 5 # first pulse will start at h.t = 5 ms
Now for your questions.
And what is the value of h.dt? Hint: for fixed step methods, duration must be at least as long as h.dt. That probably takes care of your problem.
1. you're asking about mechanisms that deliver a series of one or more current pulses at regular intervals
2. the source code for these mechanisms is in https://www.neuron.yale.edu/ftp/ted/neu ... istrib.zip
3. these mechanisms differ in terms of how one specifies the parameters that govern the pulses. Ipulse1 needs ton (duration of current pulse) and toff (interpulse interval), while Ipulse2 needs dur (same as Ipulse1's ton) and per (the period of the stimlus train, which is the same as Ipulse1's ton+toff). Ipulse3 is triggered by an event from a NetCon, and delivers single current pulse of user-specified amplitude and duration; events that arrive during an ongoing pulse are ignored.
4. the parameter "del" will automatically be known to Python as "delay" (because del is a reserved word in Python). Example:
pulser = h.Ipulse2(soma(0.5))
pulser.delay = 5 # first pulse will start at h.t = 5 ms
Now for your questions.
Code: Select all
iclamp.dur = 0.01
Sounds reasonable. Does it work?how can I record the delivered pulses (i.e the iclamp._ref_i or something analogous)
That's a hint to NEURON's GUI. It prevents users from using a GUI tool (such as the PointProcessManager) to set a value that lies outside the range 0..1e9<0, 1e9>
-
- Posts: 69
- Joined: Wed Jun 17, 2015 5:31 pm
Re: recording delivered pulses using pulsedistrib.zip
thank you Ted,
First I would like to say that the syntax: "h.ipulse2(bs.soma(0.5))" gives error "hoc object doesn't have attribute ipulse2" which tells me that I am using the wrong syntax. Should I use "insert" or a different syntax to deliver the pulses to the basket cell?
your comment about how the parameter "del" will automatically be known to Python as "delay" made me realize that the other params won't be known by hoc and therefore I tried the following syntax:
Even though dur, num, and amp are parameters of the Ipulse2.mod file, this syntax fails also!
I suppose my question is a more general one which is, how do I access parameters of mod files?
thank you again,
Alexandra
First I would like to say that the syntax: "h.ipulse2(bs.soma(0.5))" gives error "hoc object doesn't have attribute ipulse2" which tells me that I am using the wrong syntax. Should I use "insert" or a different syntax to deliver the pulses to the basket cell?
your comment about how the parameter "del" will automatically be known to Python as "delay" made me realize that the other params won't be known by hoc and therefore I tried the following syntax:
Code: Select all
from neuron import h
iclamp =h.Ipulse2(bs.soma(0.5))
dur_clamp=5
num_clamp=3
amp_clamp=20
h('dur=' +str(dur_clamp))
h('num=' +str(num_clamp))
h('amp=' +str(amp_clamp))
I suppose my question is a more general one which is, how do I access parameters of mod files?
thank you again,
Alexandra
-
- Site Admin
- Posts: 6384
- Joined: Wed May 18, 2005 4:50 pm
- Location: Yale University School of Medicine
- Contact:
Re: recording delivered pulses using pulsedistrib.zip
This works:First I would like to say that the syntax
Code: Select all
from neuron import h
soma = h.Section(name='soma')
pstim = h.Ipulse2(soma(0.5))
True. The class name is Ipulse2, not ipulse2."h.ipulse2(bs.soma(0.5))" gives error "hoc object doesn't have attribute ipulse2" which tells me that I am using the wrong syntax.
That inference is incorrect. The PARAMETERs of an instance of any NMODL-defined class are automatically accessible by hoc and Python. No fancy syntax is required. For example, in hoc, if foo is the objref that points to an instance of Ipulse2, foo's parameters are foo.del, foo.dur, foo.per, foo.num, and foo.amp. In Python, if foo is the name of a Python object that points to an instance of h.Ipulse2, the parameters will have the same names with one exception, and that exception is the delay paramter, whose Python name is foo.delay.your comment about how the parameter "del" will automatically be known to Python as "delay" made me realize that the other params won't be known by hoc
These statements
Code: Select all
dur_clamp=5
num_clamp=3
amp_clamp=20
So are these
Code: Select all
h('dur=' +str(dur_clamp))
h('num=' +str(num_clamp))
h('amp=' +str(amp_clamp))
IMO the Programmer's Reference documentation of the IClamp and SEClamp class should include examples of how to access the parameters of these classes.