module documentation

Selection of ramping functions. These functions are not meant to be interfaced with by the user, for generating ramps, one should use the function ramp(...) located in ramp.py

Note: a ramp_func-function must have comply with following:

  • the signature must be Callable[t:np.ndarray, gamma_t:float, width:float]->np.ndarray
  • the function name ends with _ramp_func
Function cosine_squared_ramp_func Creates a cosine squared ramp centered in gamma_t with defined width, relative to the time-vector t:
Function gaussian_ramp_func Ramp function based on the gaussian gate used by Schneider and Hamstra, 1999
Function hamming_ramp_func Ramp based on the Hamming window function
Function hann_ramp_func Ramp based on the Hann window function
Function linear_ramp_func Creates a linear ramp from 0.0 to 1.0 for the full duration of t
Function _cosine_sum Private helper used for cosine-sum ramps, i.e. Hann and Hamming
def cosine_squared_ramp_func(t, gamma_t, width): (source)

Creates a cosine squared ramp centered in gamma_t with defined width, relative to the time-vector t:

ramp = (cos(π*(t − (gammat − width ⁄ 2) + width) ⁄ (2*width))2

Parameters
t:np.ndarraytime vector
gamma_t:floatcenter of ramp
width:floatwidth of ramp
Returns
np.ndarray
def gaussian_ramp_func(t, gamma_t, width): (source)

Ramp function based on the gaussian gate used by Schneider and Hamstra, 1999

Parameters
t:np.ndarraytime vector
gamma_t:floatcenter of ramp
width:floatwidth of ramp
Returns
np.ndarray
def hamming_ramp_func(t, gamma_t, width): (source)

Ramp based on the Hamming window function

Parameters
t:np.ndarraytime vector
gamma_t:floatcenter of ramp
width:floatwidth of ramp
Returns
np.ndarray
def hann_ramp_func(t, gamma_t, width): (source)

Ramp based on the Hann window function

Parameters
t:np.ndarraytime vector
gamma_t:floatcenter of ramp
width:floatwidth of ramp
Returns
np.ndarray
def linear_ramp_func(t, gamma_t, width): (source)

Creates a linear ramp from 0.0 to 1.0 for the full duration of t

Note that this ramp function ignores gamma_t and width

Parameters
t:np.ndarraytime vector
gamma_t:float_unused_
width:float_unused_
Returns
np.ndarray
def _cosine_sum(t, gamma_t, width, a0): (source)

Private helper used for cosine-sum ramps, i.e. Hann and Hamming

Computed from:

  • a0 - (1 - a0)cos(π * x / width)
Parameters
t:np.ndarraytime vector
gamma_t:floatcenter of ramp
width:floatwidth of ramp
a0:floatOffset parameter, see function description for details
Returns
np.ndarray