goldpan.operations

Operations: pulses in, new (modified) pulses out – same pulse-shaped family.

Every function takes an array shaped (..., n_samples) and returns an array of the same leading shape (trailing/sample axis may shrink, e.g. trim_glitch), never a scalar or boolean – that’s what distinguishes an operation from a quantity or a cut. None of these mutate their input in place.

Functions

baseline_subtract(pulses, config)

Subtract each pulse's own pretrigger mean (see goldpan.quantities.pretrigger_mean).

clip(pulses[, low, high])

Clip every sample to [low, high].

trim_glitch(pulses, config)

Drop the leading config.glitch_samples samples from every pulse.

goldpan.operations.baseline_subtract(pulses, config)[source]

Subtract each pulse’s own pretrigger mean (see goldpan.quantities.pretrigger_mean).

Parameters:

config (PulseConfig)

goldpan.operations.trim_glitch(pulses, config)[source]

Drop the leading config.glitch_samples samples from every pulse.

Shortens the sample axis by glitch_samples – downstream sample indices (e.g. from goldpan.quantities.rise_sample) computed on the untrimmed array will no longer line up after this.

Parameters:

config (PulseConfig)

goldpan.operations.clip(pulses, low=None, high=None)[source]

Clip every sample to [low, high]. Plain np.clip wrapper for pipeline symmetry with the other operations (e.g. clipping a display copy without touching source data).