rizer.electrical_model.components.generator#
Classes#
An ideal voltage waveform generator. |
|
Trapezoidal generator. |
|
Gaussian generator. |
|
Constant generator. |
|
A pulse train: one single-pulse waveform repeated at a fixed PRF. |
|
Generator voltage from an experimentally-measured trace. |
Functions#
|
Get a generator object from the input dictionary. |
Module Contents#
- class rizer.electrical_model.components.generator.BaseGenerator#
Bases:
abc.ABCAn ideal voltage waveform generator.
Carries no source impedance of its own – see
ResistiveSourceCircuitfor a generator paired with a source resistance \(R_g\).
- class rizer.electrical_model.components.generator.TrapezoidalGenerator(U_off: float = 0.0, U_on: float = 10000.0, t_rise: float = 3e-09, t_on: float = 1e-08, t_fall: float = 3e-09)#
Bases:
BaseGeneratorTrapezoidal generator.
The generator voltage is a trapezoidal pulse.
- Parameters:
U_off (
float, optional) – Voltage when the pulser is turned off, by default 0.0 V.U_on (
float, optional) – Voltage when the pulser is turned on, by default 5e3 V.t_rise (
float, optional) – Time to go from U_off to U_on, by default 3e-9 s.t_on (
float, optional) – Time to stay at U_on, by default 10e-9 s.t_fall (
float, optional) – Time to go from U_on to U_off, by default 3e-9 s.
- class rizer.electrical_model.components.generator.GaussianGenerator(height: float, mean: float, FWHM: float)#
Bases:
BaseGeneratorGaussian generator.
The generator voltage is a Gaussian pulse.
- Parameters:
- class rizer.electrical_model.components.generator.ConstantGenerator(U_g: float)#
Bases:
BaseGeneratorConstant generator.
- Parameters:
U_g (
float) – Voltage of the generator [V].
- U_g#
- class rizer.electrical_model.components.generator.RepetitivePulseGenerator(pulse: BaseGenerator, pulse_repetition_frequency: float, nb_pulses: int)#
Bases:
BaseGeneratorA pulse train: one single-pulse waveform repeated at a fixed PRF.
The waveform of pulse \(k\) is the single-pulse waveform shifted by \(k / f_{PRF}\):
\[U(t) = U_{pulse}\left(t - \frac{k}{f_{PRF}}\right), \qquad k = \min\left(\lfloor t\, f_{PRF} \rfloor, N - 1\right)\]so the train is off after the last of its \(N\) pulses.
- Parameters:
pulse (
BaseGenerator) – The single-pulse waveform, fired at t = 0.pulse_repetition_frequency (
float) – PRF [Hz]. Its inverse is the pulse period, which must be longer than the pulse itself (checked when the pulse exposespulse_end_time).nb_pulses (
int) – Number of pulses in the train.
Examples
>>> pulse = TrapezoidalGenerator(U_on=1.0e3, t_rise=1e-9, t_on=2e-9, t_fall=1e-9) >>> train = RepetitivePulseGenerator(pulse, 1e8, nb_pulses=2) # 10 ns period >>> train.generator_voltage(2e-9) # plateau of the first pulse 1000.0 >>> train.generator_voltage(12e-9) # plateau of the second pulse 1000.0 >>> train.generator_voltage(22e-9) # the train is over 0.0
- pulse#
- pulse_repetition_frequency#
- nb_pulses#
- pulse_period#
- class rizer.electrical_model.components.generator.FromMeasurementGenerator(times: numpy.ndarray, voltages: numpy.ndarray)#
Bases:
BaseGeneratorGenerator voltage from an experimentally-measured trace.
Plays the role of
generator_voltage(t)exactly like any otherBaseGenerator– pair with aResistiveSourceCircuit’s own R_g (chosen independently). There is no single correct convention for what a measured trace represents – a true open-circuit EMF, a terminal voltage, a mid-cable probe reading that already reflects some attenuation – picking R_g consistent with where the measurement was actually taken is the caller’s responsibility.- Parameters:
times (
numpy.ndarray) – Strictly increasing sample times [s], starting at t=0.voltages (
numpy.ndarray) – Measured voltage at each time in times [V].
- times#
- voltages#
- rizer.electrical_model.components.generator.get_generator_from_input(generator_input: dict[str, Any]) BaseGenerator#
Get a generator object from the input dictionary.
- Parameters:
generator_input (
dictofstrandstrorfloat) –A dictionary containing the parameters of the generator. Expected keys are:
”type”: Type of the generator. Supported types are “from_measurement”, “gaussian”, “trapezoidal”, “constant”, “repetitive”.
- For “gaussian” type:
”height”: Height of the Gaussian pulse in Volts.
”mean”: Mean of the Gaussian pulse in seconds.
”FWHM”: Full width at half maximum of the Gaussian pulse in seconds.
- For “constant” type:
”U_g”: Voltage of the generator in Volts.
- For “trapezoidal” type:
”U_off”: Voltage level when the generator is off, in Volts.
”U_on”: Voltage level when the generator is on, in Volts.
”t_rise”: Rise time of the trapezoidal pulse in seconds.
”t_on”: Duration for which the generator is on (at U_on) in seconds.
”t_fall”: Fall time of the trapezoidal pulse in seconds.
- For “repetitive” type (a train of identical pulses):
”pulse_repetition_frequency”: PRF of the train in Hz.
”nb_pulses”: Number of pulses in the train.
”pulse”: Nested generator input describing one pulse.
- For “from_measurement” type (an experimentally-measured trace):
”path”: Path to an experiment .npz, relative to data/experiments/.
”t_start”, “t_end”: Optional window bounds [s] in the file’s own time axis; see
load_experiment_trace_window().
- Returns:
An instance of the generator class corresponding to the specified type, initialized with the parameters from the input dictionary.
- Return type:
- Raises:
ValueError – If the generator type is unknown or if required parameters are missing for the specified type.