goldsluice.reference.window_integral

Python mirror of src/window_integral.rs: the integral of the baseline-subtracted trace between two samples.

For one trace x of n samples:

  • baseline = mean of x[glitch_samples:pretrigger_samples] (the window peak and baseline use);

  • window_integral = sum of (x[i] - baseline) for i from start_sample to stop_sample - 1, times sample_period_s: the unit of the trace times seconds.

stop_sample is not included, as in a slice: start_sample = 0, stop_sample = n gives the integral of the whole trace, and stop_sample - start_sample is the number of samples summed. The limits are free of the baseline window: they may overlap it or lie before it. None of the parameters has a default (integral is the whole-trace version); sample_period_s belongs to the readout.

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 baseline (goldpan.quantities.pretrigger_mean), summed over the slice: {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.window_integral.goldpan_expected(traces, params)[source]

The same numbers from goldpan’s baseline (goldpan.quantities.pretrigger_mean), summed over the slice: {output: array}.

goldsluice.reference.window_integral.problem(n_samples, glitch_samples, pretrigger_samples, sample_period_s, start_sample, stop_sample)[source]

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

goldsluice.reference.window_integral.kernel(trace, glitch_samples, pretrigger_samples, sample_period_s, start_sample, stop_sample)[source]
goldsluice.reference.window_integral.cases()[source]

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

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

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