Stimulus¶
Schema for stimulation protocols / source terms¶
- class pigreads.schema.stimulus.SignalStep(**data)¶
Bases:
BaseModelWithin a time interval, increase the value of variables by a given amounts.
The start and duration of the signal are given in time units of the simulation. The variables are given as a dictionary with the variable names as keys and the amount to increase the variable by as values:
start: 100 # ms duration: 10 # ms variables: u: 1 v: 2
The interval is defined mathematically as \(t \in [\text{start}, \text{start} + \text{duration})\).
- Parameters:
data (
Any)
- __call__(signal, times, varidx)¶
Modify the signal array.
The signal array is modified in place to increase the values of the variables by the given amounts within the time interval.
- Parameters:
- Return type:
- Returns:
Modified signal array.
- model_config: ClassVar[ConfigDict]¶
Configuration for
pydantic.BaseModel.
- class pigreads.schema.stimulus.Stimulus(**data)¶
Bases:
BaseModelA stimulus is a combination of a shape and a signal.
The shape is defined by a list of
pigreads.schema.setter.Setterobjects and defines where the stimulus is applied. The signal is defined by a list ofSignalStepobjects and defines how the stimulus changes over time.- Parameters:
data (
Any)
- model_config: ClassVar[ConfigDict]¶
Configuration for
pydantic.BaseModel.
- classmethod normalise_shape(shape)¶
Normalise the setters in the shape.
See
pigreads.schema.setter.normalise_list_of_setters()for details.
- shape: list[SetterFile | SetterSlices | SetterSpherical]¶
Shape of the stimulus.
- signal: list[SignalStep]¶
Signal of the stimulus.