Ramp interface functions
Class |
|
Protocol signature for ramp functions |
Function | ramp |
Create an on-ramp centered at `gamma_t` using `t` as the time-vector. The output will match the shape of `t`. The function to create the ramp is passed with ramp_function. The function must be defined as:... |
Function | ramp |
Takes two time points (gamma_t) and generates an onset+offset-ramp, by generating two ramps over the time-vector (see ramp) and combining by multiplying (ramp1(t) * ramp2(t)) or addition, when invert=True (ramp1(t)+ramp2(t))... |
Function | ramp |
Combines two instances of ramp_onoff to create a "gate" for some signal with onset and offset- and a gap in between. |
Variable |
|
Type specification for gamma_t pair, used in functions with onset and offset |
Create an on-ramp centered at `gamma_t` using `t` as the time-vector. The output will match the shape of `t`. The function to create the ramp is passed with ramp_function. The function must be defined as:
def <ramp_function>( t [numpy array, (cut from `t`)], gamma_t [float, (temporal center of the ramp)] width [float, (width of the ramp)]) -> [numpy array of same size as input]
The numpy array parsed to the function fits the dimension from the cutout:
(t < (gamma_t + width / 2)) & (t >= (gamma_t - width / 2))
Invert is performed by flipping the ramp part within the above-mentioned range. Rest of the signal is inverted by y = (1 - x)
Parameters | |
t:np.ndarray | time vector |
gammafloat | center position of the ramp (in the same unit as the time vector) |
width:float | width of the ramp (in same unit as the time vector) |
rampRampFunction | the function to create the ramp |
invert:bool | whether to invert the output (ramp on or ramp off) |
dtype:np.dtype | data type of output vector, defaults to the datatype of t |
Returns | |
np.ndarray | vector of the same shape as t |
Takes two time points (gamma_t) and generates an onset+offset-ramp, by generating two ramps over the time-vector (see ramp) and combining by multiplying (ramp1(t) * ramp2(t)) or addition, when invert=True (ramp1(t)+ramp2(t))
Parameters | |
t:np.ndarray | time vector |
gammaGammaTPair | center positions of the onset/offset-ramps (in the same unit as the time vector) |
width:float | width of the ramp (in same unit as the time vector) |
rampRampFunction | the function to create the ramp |
invert:bool | whether to invert the output |
dtype:np.dtype | data type of output vector, defaults to the datatype of t |
Returns | |
np.ndarray | vector of the same shape as t |
Combines two instances of ramp_onoff to create a "gate" for some signal with onset and offset- and a gap in between.
Parameters | |
t | time vector |
stimGammaTPair|None | center positions of the onset/offset-ramps of the signal (in the same unit as the time vector) |
gapGammaTPair|None | center positions of the onset/offset-ramps of the gap (in the same unit as the time vector) |
width:float | width of the ramp (in same unit as the time vector) |
rampRampFunction | the function to create the ramp |
dtype:np.dtype | data type of output vector, defaults to the datatype of t |
Returns | |