calamari.transitions#

Phase-transition candidate detection for 1-D magnetometry sweeps.

Search DC moment or AC susceptibility on a single T- or H-scan with detect_transitions(), or process a campaign with detect_transitions_all(). find_transitions() accepts arrays directly. Candidates describe signal features; identifying a phase transition requires the caller’s scientific interpretation.

Methods and defaults#

The METHODS registry contains criterion definitions and citations:

  • 'peak': maxima and minima of the smoothed signal.

  • 'derivative': extrema of the signed first derivative.

  • 'kink': extrema of the second derivative, for changes of slope.

  • 'onset': intersection of a baseline and the steepest-slope tangent.

  • 'fisher': extrema of d(yT)/dT, subject to the susceptibility assumptions documented by find_transitions(). Fisher candidates remain separate from other criteria when grouping detections.

H-scans default to 'peak' for susceptibility and 'derivative' for moment. T-scans run both. Kink, onset and Fisher searches are opt-in because they assume particular feature shapes or response interpretations. Smoothing affects each criterion’s location; see find_transitions() for grouping and error conventions.

Noise and significance#

Detection uses a permissive prominence floor. significance normalises prominence by the noise of the smoothed representation, with a sweep-length correction. It is not a calibrated z-score or false-alarm probability.

noise='auto' prefers usable instrument errors, otherwise a second-difference scatter estimate. It warns when instrument errors exceed the scatter estimate by NOISE_RATIO_WARN. Explicit 'instrument', 'scatter' or positive sigma choices are available. Both estimates and the resolved choice are recorded.

Result transformations#

All operations are deterministic for their inputs and settings. TransitionResult.robust() filters by declared diagnostic thresholds. TransitionResult.link() describes chains across neighbouring sweeps; combined chain scores remain diagnostics. TransitionResult.select() records an explicit criterion, sign and swept-axis window, retaining at most one candidate per sweep. TransitionResult.reconcile() compares selected T- and H-scan boundaries by interpolation, without extrapolation or implicit concordance tolerances. Linking and reconciliation describe results without dropping points. See TransitionResult for transformation order and recorded settings.

Module attributes

METHODS

Detection identities, display markers and scientific/statistical citations.

CRITERION_PRIORITY

Reporting priority within a grouped feature; Fisher candidates remain separate.

DEFAULT_PROMINENCE_FRACTION

Permissive prominence floor, as a fraction of the signal's peak-to-peak range.

DEFAULT_MIN_SIGNIFICANCE

Uncalibrated diagnostic threshold used by TransitionResult.robust().

NOISE_RATIO_WARN

Instrument/scatter noise ratio above which auto noise selection warns.

CANDIDATE_COLUMNS

Canonical measurement-level candidate columns, including stable sweep identity.

DETECTION_COLUMNS

Canonical constituent-detection columns, linked to their candidate by ID.

CHAIN_COLUMNS

Chain summaries; their significance statistic is not a calibrated probability.

DEFAULT_LINK_BY

Candidate fields that must match within a linked chain, besides the swept axis.

Functions

detect_transitions

Detect transition candidates in one Measurement's sweep.

detect_transitions_all

Detect over many sweeps, collecting failures instead of hiding them.

find_transitions

Detect transition candidates in one 1-D sweep given as arrays.

smooth_derivative

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

Classes

Citation

One literature citation backing a detection method.

MethodInfo

Identity card for one detection method.

TransitionResult

Detected transition candidates plus the evidence and the recipe.