goldsluice.reference.excursion

Python mirror of src/excursion.rs: how far a trace strays from its baseline after the pretrigger window, and relative to its noise.

For one trace x of n samples, with the baseline window w = x[glitch_samples:pretrigger_samples], its mean m and its standard deviation s (the population one, as baseline computes them):

  • max_deviation = the largest abs(x[i] - m) over the samples after the window, i from pretrigger_samples to n - 1 (the “dev” of the noise-selection notebooks; measuring it over the whole trace would put the window itself in it);

  • excursion_ratio = max_deviation / s (the “ratio”). A window with no scatter (s = 0) gives inf if the trace strays and nan if it does not, as the division does in numpy.

The trace must have at least one sample after the window. 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.quantities.max_deviation and excursion_ratio: {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.excursion.goldpan_expected(traces, params)[source]

The same numbers from goldpan.quantities.max_deviation and excursion_ratio: {output: array}.

goldsluice.reference.excursion.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.excursion.kernel(trace, glitch_samples, pretrigger_samples)[source]
goldsluice.reference.excursion.cases()[source]

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

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

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