goldsluice.reference.baseline

Python mirror of src/baseline.rs: the mean and the standard deviation of the pretrigger window of a trace.

For one trace x of n samples, with w = x[glitch_samples:pretrigger_samples] (the same window as peak uses for its baseline):

  • baseline_mean = mean of w;

  • baseline_std = standard deviation of w (the population one, dividing by the number of samples, as numpy.std).

Both are in the units of the trace (ADC counts): there is no conversion to amps here, so no amps_per_adc.

This file is written in the kernel subset (see PORTING.md) so that it can be ported to Rust line by line. The deviations are summed in a second pass over the window (not E[x^2] - E[x]^2), which stays accurate when the baseline is large compared with its scatter.

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, pretrigger_samples)

problem(n_samples, glitch_samples, ...)

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

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

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

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

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

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

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

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

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