Extrema Finder Utility
Identify extrema points in one-dimensional numerical series.
This module provides helper functions for identifying extrema in one-dimensional data series commonly produced by ReaxFF simulations, such as energy profiles, bond-order trajectories, dipole signals, polarization loops, or field-response curves.
Usage context
- Energy profiling: Locate global or local minima and maxima in trajectories.
- Field-response analysis: Identify peak responses in driven simulations.
- Transition detection: Capture switching points in time-series signals.
Function: get_extrema_points
Identify extrema points in a 1D data series.
This function extracts global or local extrema by locating maximum and/or minimum values of a y-series with respect to a corresponding x-series. Optionally, the x-axis may be partitioned into windows to detect local extrema within each segment.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
y_series
|
Series or array - like
|
Dependent variable values (e.g., energy, polarization, bond order). |
required |
x_series
|
Series or array - like
|
Independent variable values (e.g., iteration index or time). |
required |
mode
|
(max, min, minmax)
|
Type of extrema to extract:
- |
'max'
|
chunk_size
|
float or int
|
Size of the x-axis window used to find local extrema. If not provided, only global extrema are returned. |
None
|
Returns:
| Type | Description |
|---|---|
list of tuple[float, float]
|
List of |
Examples:
>>> get_extrema_points(energy, iters, mode="min")
>>> get_extrema_points(signal, time, mode="minmax", chunk_size=50)