pybec.analysis.correct_jumps

pybec.analysis.correct_jumps(arr, x=None, jump_quantum=None, jump_threshold=10.0)[source]

Correct discontinuities in trajectory

Either corrects using a best guess to align the slope at the discontinuity with the slope on either side of the discontinuity or using a specified jump size. An integer multiple of this jump is added to the trajectory after the discontinuity to match it closely with the trajectory before.

Parameters
  • arr (numpy.ndarray) – Nx0 array of values in the trajectory of some variable.

  • x (numpy.ndarray, optional, default=None) – Nx0 array defining the spacing between values in the trajectory for calculation of slope. If None, a uniform spacing of 1 is assumed.

  • jump_quantum (float, optional, default=None) – This optionally forces the correction added post-discontinuity to be an integer multiple of this jump_quantum size.

  • jump_threshold (float, optional, default=10.) – Sets the sensitivity for detecting jumps. Larger value increases sensitivity and will try to correct smaller jumps.

Returns

Nx0 array of original values, with jumps corrected.

Return type

np.ndarray