calamari.plot.moment_series#

calamari.plot.moment_series(measurement, *, x='field', field_unit='oe', units='emu', sample=None, split_branches=False, label=None)#

Resolve a moment-vs-H (or vs-T) request into PlotSeries.

The resolution half of plot_mh()/plot_mt(). Rows are kept in file order – never sorted by field – so a hysteresis loop’s branches survive; housekeeping rows are excluded and NaN rows dropped exactly as in chi_series().

Parameters:
  • measurement (Measurement) – The loaded file.

  • x (str) – Which axis to resolve against. Default 'field'.

  • field_unit (str) – For x='field': field in Oe (the default, the file’s native unit) or as mu0 H in Tesla – see chi_series(). Branches split at the same points in either unit. Any value other than the default is refused with x='temperature'.

  • units (str) – Moment units; the muB forms need sample.

  • sample (Sample | None) – Required for the muB units.

  • split_branches (bool) – For x='field': return one series per monotonic sweep segment (virgin curve, descending branch, ascending branch, …), each labelled branch <n> (up|down) so a legend can name them. Consecutive branches share their turning point, so they still draw as a connected loop. A sweep with no reversal returns one plainly-labelled series, so the flag is safe to set universally.

  • label (str | None) – Base legend label; the branch suffix is appended when splitting.

Return type:

list[PlotSeries]

Returns:

list of PlotSeries

Raises:
  • PlotInputError – For an unknown x, field_unit or units; a units needing a Sample without one; split_branches or field_unit='tesla' with x='temperature'; or a missing column.

  • AmbiguousColumnError – Propagated from moment_emu when more than one moment column carries data.