calamari.plot.chi_series#

calamari.plot.chi_series(measurement, *, x='temperature', field_unit='oe', component='real', units='emu_per_oe', sample=None, source='auto', inverse=False, label=None)#

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

The resolution half of plot_chi_vs_t()/plot_chi_vs_h() – everything except the drawing, returned as arrays so a caller can plot, fit or export them directly.

The source is never silently conflated. An AC susceptibility (chi', from the file’s own AC columns) and a DC M/H are different measurements of related quantities. source='auto' picks whichever the file offers, stamps the provenance into the y-label ($\chi'$ vs $M/H$), and refuses – naming both options – when a file offers both, rather than guessing.

A file measured at more than one AC frequency returns one series per frequency, labelled f = <value> Hz, instead of one series zigzagging between them.

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

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

  • field_unit (str) – For x='field': the unit of PlotSeries.x and its label. 'oe' (the default) is the file’s native unit; 'tesla' is mu0 H from field_tesla, the unit the family legends, the 2-D maps and the transition table’s H_T already use. Only the axis changes: a DC M/H is still moment_emu / field_oe, in emu/Oe. Any value other than the default is refused with x='temperature'.

  • component (str) – 'real' for chi’ (or M/H), 'imag' for chi’’. (The drawing layer’s component='both' is two calls to this function.)

  • units (str) – 'emu_per_oe' is the file’s own extensive quantity; the others need sample and convert via the Sample.chi_to_chi_* methods. The axis label spells the exact unit.

  • sample (Sample | None) – Required for every units other than 'emu_per_oe'.

  • source (str) – 'ac' reads chi_real/chi_imag; 'dc' computes moment_emu / field_oe (component='real' only – a DC measurement has no out-of-phase part; rows at exactly zero field become NaN and are dropped, since M/H means nothing there). 'auto' picks the one the file offers and refuses if both.

  • inverse (bool) – Return 1/chi (for Curie-Weiss analysis): values inverted (chi = 0 becomes NaN and is dropped), errors propagated as yerr/chi**2, symbol and unit labels reciprocated.

  • label (str | None) – Base legend label; a frequency suffix is appended when the file splits by frequency.

Return type:

list[PlotSeries]

Returns:

list of PlotSeries – One entry per AC frequency present (one entry total for a single-frequency or DC file).

Raises:
  • PlotInputError – For an unknown x/field_unit/component/units/ source; field_unit='tesla' with x='temperature'; a units needing a Sample without one; a source the file cannot supply; or source='auto' when the file offers both.

  • AmbiguousColumnError – Propagated from moment_emu (source='dc') when more than one moment column carries data – choose with with_moment or of_type first, exactly as when reading the accessor yourself.