Stoner.Util.hysteresis_correct(data, **kargs)[source]

Peform corrections to a hysteresis loop.


data (Data) – The data containing the hysteresis loop. The DataFile.setas attribute should be set to give the H and M axes as x and y.

Keyword Arguments
  • correct_background (bool) – Correct for a diamagnetic or paramagnetic background to the hystersis loop also recentres the loop about zero moment (default True).

  • correct_H (bool) – Finds the co-ercive fields and sets them to be equal and opposite. If the loop is sysmmetric this will remove any offset in filed due to trapped flux (default True)

  • saturated_fraction (float) – The fraction of the horizontal (field) range where the moment can be assumed to be fully saturated. If an integer is given it will use that many data points at the end of the loop.

  • h_sat_method (str) –

    The method used to determine thwe saturation field. Options are - - “linear_intercept” (default): Fit a straight line to the central region of each branch of the loop

    and look at the intercept with the relevant saturation moment.

    • ”delta_M”: Look for a field where the moment has changed by h_sat_fraction times the error in M_s.

    • ”susceptibility” - Calcualte H_sat from where the susceptibility changes by 1% of the average susceptibility

  • h_sat_fraction (float) – The central fraction of the saturation moment that is used for calculating the saturation field. Defaults to 0.5

  • xcol (column index) – Column with the x data in it

  • ycol (column_index) – Column with the y data in it

  • setas (string or iterable) – Column assignments.


(Stoner.Data) – The original loop with the x and y columns replaced with corrected data and extra metadata added to give the background suceptibility, offset in moment, co-ercive fields and saturation magnetisation.