braintools.input.ConstantValue#
- class braintools.input.ConstantValue(value, duration)#
A constant value input.
- Parameters:
Examples
>>> # Usually created implicitly >>> sine = Sinusoidal(1.0, 10 * u.Hz, 100 * u.ms) >>> with_offset = sine + 0.5 # Creates ConstantValue(0.5, 100*u.ms) >>> >>> # Direct construction >>> baseline = ConstantValue(0.1, 500 * u.ms)
- __init__(value, duration)[source]#
Initialize the Input base class.
- Parameters:
duration (
float|Quantity) – The total duration of the input.
Methods
__init__(value, duration)Initialize the Input base class.
apply(func)Apply a custom function to the input.
clip([min_val, max_val])Clip the input values to a range.
generate()Generate constant array.
repeat(n_times)Repeat the input pattern n times.
scale(factor)Scale the input by a factor.
shift(time_shift)Shift the input in time.
smooth(tau)Apply exponential smoothing to the input.
Attributes
dtGet the time step from global environment.
n_stepsGet the number of time steps.
shapeGet the shape of the input array.