spvctrl.scripts.test_data.make_adc_dataset#
- make_adc_dataset(spv_A0_V: float = 0.15, spv_tau_s: float = 0.001, spv_offset_V: float = 0.005, diode_A0_V: float = 0.35, diode_tau_s: float = 1e-06, diode_offset_V: float = 0.007, n_pulses: int = 5, amplitude_step_V: float = 0.005, n_samples: int = 32768, n_pre_trigger: int = 1024, sample_rate_Hz: float = 65536.0) dict[source]#
Generate a synthetic ADC pulse dataset, like an oscilloscope measurement would return it.
Each pulse is a pure exponential decay
A*exp(-t/tau) + Cper channel: the SPV channel withA0 = spv_A0_V,tau = spv_tau_sandC = spv_offset_V, the diode channel with the corresponding diode parameters. The amplitudeAis increased byamplitude_step_Vfor every pulse. The record of each pulse holdsn_pre_triggerpre-trigger samples followed byn_samplespost-trigger samples, where the pre-trigger is filled with the tail of the pulse’s own decay (i.e. the lastn_pre_triggersamples of the post-trigger window, wrapped around to the front; fortaumuch smaller than the record this is the constant offsetC).The voltages are quantized to int16 ADC counts with the +-1 V input range mapped to the full int16 scale (gain
1/32768V/count, offset 0 V) for both channels.- Parameters:
spv_A0_V – SPV amplitude A of the first pulse in V.
spv_tau_s – SPV decay time constant in s.
spv_offset_V – SPV offset C in V.
diode_A0_V – Diode amplitude A of the first pulse in V.
diode_tau_s – Diode decay time constant in s.
diode_offset_V – Diode offset C in V.
n_pulses – Number of pulses to generate.
amplitude_step_V – Amplitude increase per pulse in V.
n_samples – Number of post-trigger samples per pulse.
n_pre_trigger – Number of pre-trigger samples per pulse.
sample_rate_Hz – Sampling rate in Hz.
- Returns:
Dict with the keys
U_spv_raw/U_diode_raw(int16 arrays of shape(n_pulses, n_samples + n_pre_trigger)),sample_rate_Hz,n_pre_trigger,n_pulses,conversion_spv/conversion_diode((gain_V_per_count, offset_V)tuples) andt_s(the time axis of a single record in s).