calamari.transitions.smooth_derivative#

calamari.transitions.smooth_derivative(x, y, *, order=1, smooth_window=None, polyorder=3)#

Noise-robust Savitzky-Golay derivative of y with respect to x.

Kept public because downstream analysis reuses it directly. The sweep is resampled onto a uniform grid at its own median spacing (see _resample() for what that manufactures across sparse regions); smooth_window is in x-units, not points.

Returns (x_uniform, y_smooth, d) where d is the order-th derivative (order=0 returns the smoothed signal twice).

Raises:

CurveInputError – Mismatched shapes, insufficient finite points, a non-monotonic or systematically repeated swept axis, or a non-positive smoothing window. Also a ValueError. NumPy/SciPy exceptions retain their types.

Return type:

tuple[ndarray, ndarray, ndarray]