polyBkg

fiducia.rawProcess.polyBkg(time, signal, lowerEdge, upperEdge, order=3, lowerLength=None, upperLength=None, plot=False)[source]

Fit polynomial function to ends of the signal as an estimate of the background signal + hyesteresis. Default is cubic fit.

Parameters
  • time (numpy.ndarray) – array of times corresponding to signal

  • signal (numpy.ndarray) – array of signal values for a single dante channel

  • lowerEdge (int) – Index of time array corresponding to lower edge of detected signal. See signalEdges().

  • upperEdge (int) – Index of time array corresponding to upper edge of detected signal. See signalEdges().

  • order (int) – Order of polynomial to be fitted to estimated background/hysteresis.

  • lowerLength (int) – Length over which to take the polynomial background fit on the lower end (earlier in time) segment of the signal, with respect to lowerEdge. Default is None, which just takes the first point in the signal.

  • upperLength (int) – Length over which to take the polynomial background fit on the upper end (later in time) segment of the signal, with respect to upperEdge. Defualt is None, which then just picks the second to last point in the signal.

  • plot (bool) – Flag for plotting polynomial fitted background signal. Default is False.

Returns

Return type

time

fitSignal:

Notes

Examples