lib.Calibration.Qlinearity module
- lib.Calibration.Qlinearity.logistic(x, pars)[source]
Logistic function used in Minuit fitting.
- Parameters:
x (float or array-like) – Input values.
pars (array-like) –
Parameters of the model:
pars[0] : Amplitude in Y of the efficiency curve
pars[1] : Central value in x
pars[2] : Width in x
pars[3] : Offset in y
- Returns:
Value of the logistic function.
- Return type:
float or ndarray
- lib.Calibration.Qlinearity.shift_src(xyper, pars)[source]
Shift and scale a periodic signal.
- Parameters:
xyper (tuple) –
Input data:
xyper[0] : x values
xyper[1] : y values
xyper[2] : period of the signal
pars (array-like) –
Parameters:
pars[0] : Amplitude scaling
pars[1] : Offset
pars[2] : Shift in x
- Returns:
Shifted and scaled signal.
- Return type:
ndarray
- lib.Calibration.Qlinearity.sim_generator_power(time, amplitude, offset, frequency, phase, rf_freq=150.0, finterp_Vin='', finterp_freq='')[source]
Simulate the calibrated power output of the source.
- Parameters:
time (float or array-like) – Time [s].
amplitude (float) – Peak-to-peak amplitude of the generator signal [V].
offset (float) – Offset of the generator signal [V].
frequency (float) – Modulation frequency [Hz].
phase (float) – Initial phase.
rf_freq (float, optional) – RF frequency (default is 150 GHz).
finterp_Vin (callable, optional) – Interpolation function for Vin.
finterp_freq (callable, optional) – Interpolation function for frequency.
- Returns:
Calibrated signal.
- Return type:
ndarray
- lib.Calibration.Qlinearity.sine(x, pars)[source]
Sine function wrapper for Minuit fitting.
- Parameters:
x (float or array-like) – Input values.
pars (array-like) –
Parameters:
pars[0] : Peak-to-peak amplitude
pars[1] : Modulation frequency [Hz]
pars[2] : Phase shift
pars[3] : Offset
- Returns:
Sine signal.
- Return type:
float or ndarray
- lib.Calibration.Qlinearity.sinesat(x, pars)[source]
Model of a calibrated modulated source signal.
- Parameters:
x (float or array-like) – Input values.
pars (array-like) –
Parameters:
Calibration: - pars[0] : Calibration amplitude - pars[1] : Calibration offset
Modulation: - pars[2] : Peak-to-peak amplitude [V] - pars[3] : Period [s] - pars[4] : Phase - pars[5] : Offset [V]
- Returns:
Modeled signal.
- Return type:
ndarray
- lib.Calibration.Qlinearity.source_cal(Vin, freq=150.0, finterp_Vin='', finterp_freq='')[source]
Interpolate the source calibration curve.
- Parameters:
Vin (float or array-like) – Input voltage [V].
freq (float, optional) – RF frequency in GHz (default is 150).
finterp_Vin (callable, optional) – Interpolation function returning the fraction of power as a function of Vin. If not provided, it is computed internally.
finterp_freq (callable, optional) – Interpolation function returning the maximum power as a function of frequency. If not provided, it is computed internally.
- Returns:
Interpolated value(s) at (Vin, freq).
- Return type:
ndarray