goldsluice.reference.rise_crossing

Python mirror of src/rise_crossing.rs: the time at which the rising edge of the largest pulse of a trace crosses fraction of its height (s).

For one trace x of n samples:

  • baseline = mean of x[glitch_samples:pretrigger_samples], and y[i] = x[i] - baseline;

  • the peak is the first largest y over all n samples (the glitch and the window included), at index peak with height amp;

  • level = fraction * amp, and i = the last index i <= peak with y[i] < level, or -1 if there is none;

  • the crossing lies between samples i and i + 1, and is found by linear interpolation: crossing_time_s = (i + (level - y[i]) / (y[i + 1] - y[i])) * sample_period_s, from the start of the trace (as max_time_s);

  • the result is nan unless amp > 0 and i was found (a trace with no positive peak, or that never lies below the level before its peak).

This is the same last-crossing rule as rise_time, for one level, with the sample fraction kept (a rise time of a few samples is too coarse to tell where on the face an event is). It is computed on the trace as it is: no filter is applied, so it is noisier than a time taken from a filtered pulse. fraction has no default: 0.2 gives the 20 % time that the collaboration’s position quantities (xdel, ydel, the delays between channels) are made of. A step of a definition file writes it. 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), ...].

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.rise_crossing.problem(n_samples, glitch_samples, pretrigger_samples, sample_period_s, fraction)[source]

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

goldsluice.reference.rise_crossing.kernel(trace, glitch_samples, pretrigger_samples, sample_period_s, fraction)[source]
goldsluice.reference.rise_crossing.cases()[source]

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

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

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