goldsluice.reference.peak

Python mirror of src/peak.rs: the largest ADC value and the largest current above the pretrigger baseline of a trace.

For one trace x of n samples:

  • adc_max = max over all samples of x (raw counts);

  • baseline = mean of x[glitch_samples:pretrigger_samples];

  • current_max = (adc_max - baseline) * amps_per_adc (amps).

amps_per_adc has no default: the conversion belongs to the readout, not to this package.

This file is written in the kernel subset (see PORTING.md) so that it can be ported to Rust line by line.

Functions

bad_cases()

Inputs both versions must refuse, with the same message: [(traces, params), ...].

cases()

The standard inputs the parity test runs both versions on: [(traces, params), ...].

goldpan_expected(traces, params)

The same numbers from goldpan's own functions (the analysis side): {output: array}.

kernel(trace, glitch_samples, ...)

problem(n_samples, glitch_samples, ...)

Why the parameters do not fit a trace of n_samples, or None if they do.

goldsluice.reference.peak.goldpan_expected(traces, params)[source]

The same numbers from goldpan’s own functions (the analysis side): {output: array}. The parity test requires every algorithm either to define this or to say, in NO_GOLDPAN, why goldpan has no counterpart.

goldsluice.reference.peak.problem(n_samples, glitch_samples, pretrigger_samples, amps_per_adc)[source]

Why the parameters do not fit a trace of n_samples, or None if they do.

goldsluice.reference.peak.kernel(trace, glitch_samples, pretrigger_samples, amps_per_adc)[source]
goldsluice.reference.peak.cases()[source]

The standard inputs the parity test runs both versions on: [(traces, params), ...].

goldsluice.reference.peak.bad_cases()[source]

Inputs both versions must refuse, with the same message: [(traces, params), ...].