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
Classes
Ca(t), its raw second difference, and the located peak pair. |
Functions
|
Locate the peak-acceleration / peak-deceleration pair in |
|
Return |
|
Save Ca(t) + twin-axis accel(t) with peak markers and the slope window. |
Module Contents
- class tud_lbm.io.analysis.accelerations.acceleration_analysis.AccelerationResult[source]
Ca(t), its raw second difference, and the located peak pair.
- 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"].accelis the second backward difference ofCa, NaN-padded at indices 0 and 1 so it aligns withiteration/ca. By default (smoothing="raw") it is unsmoothed. Withsmoothing="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 thansavgol_window. Peak acceleration isargmax(accel); peak deceleration isargmin(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], orNone.Nonewhen 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.