tud_lbm.io.analysis.accelerations.acceleration_analysis

Acceleration-peak analysis of the Ca(t) curve for regime classification.

Computes the raw second backward difference of capillary number Ca over normalised iteration, locates the peak-acceleration / peak-deceleration pair, and derives the slope window used by regime classification (see tud_lbm.io.analysis.accelerations.regime_classification).

Attributes

Smoothing

Classes

AccelerationResult

Ca(t), its raw second difference, and the located peak pair.

Functions

compute_acceleration(→ AccelerationResult)

Locate the peak-acceleration / peak-deceleration pair in df["Ca"].

find_slope_window(→ tuple[int, int] | None)

Return [peak_accel_idx+margin, peak_decel_idx-margin], or None.

save_diagnostic_plot(→ pathlib.Path)

Save Ca(t) + twin-axis accel(t) with peak markers and the slope window.

Module Contents

tud_lbm.io.analysis.accelerations.acceleration_analysis.Smoothing[source]
class tud_lbm.io.analysis.accelerations.acceleration_analysis.AccelerationResult[source]

Ca(t), its raw second difference, and the located peak pair.

iteration: numpy.ndarray[source]
ca: numpy.ndarray[source]
accel: numpy.ndarray[source]
peak_accel_idx: int | None[source]
peak_decel_idx: int | None[source]
has_peak_pair: bool[source]
tud_lbm.io.analysis.accelerations.acceleration_analysis.compute_acceleration(df: pandas.DataFrame, *, x_col: str = 'normalised_iteration', smoothing: Smoothing = 'raw', savgol_window: int = _DEFAULT_SAVGOL_WINDOW, savgol_polyorder: int = _DEFAULT_SAVGOL_POLYORDER) AccelerationResult[source]

Locate the peak-acceleration / peak-deceleration pair in df["Ca"].

accel is the second backward difference of Ca, NaN-padded at indices 0 and 1 so it aligns with iteration/ca. By default (smoothing="raw") it is unsmoothed. With smoothing="savgol", a Savitzky-Golay filter (savgol_window, savgol_polyorder) is applied to the raw second difference to remove spurious spikes before peak detection; this falls back to the raw curve when there are fewer points than savgol_window. Peak acceleration is argmax(accel); peak deceleration is argmin(accel) searched strictly after the peak-acceleration index.

tud_lbm.io.analysis.accelerations.acceleration_analysis.find_slope_window(result: AccelerationResult, *, margin: int = _SLOPE_WINDOW_MARGIN) tuple[int, int] | None[source]

Return [peak_accel_idx+margin, peak_decel_idx-margin], or None.

None when no peak pair was found, or fewer than two indices remain in the window.

tud_lbm.io.analysis.accelerations.acceleration_analysis.save_diagnostic_plot(result: AccelerationResult, window: tuple[int, int] | None, out_path: str | pathlib.Path) pathlib.Path[source]

Save Ca(t) + twin-axis accel(t) with peak markers and the slope window.