Magnetism type module

Magnetization measurement.

Separate diamagnetic and ferromagnetic contributions.

physicslab.experiment.magnetism_type.process(data, diamagnetism=True, ferromagnetism=True)[source]

Bundle method.

Parameter data must include magnetic field and magnetization. See Columns for details and column names.

Output ratio_DM_FM compares max values - probably for the strongest magnetic field.

Supplying None for data returns pandas.Series of the same columns with values being units.

Parameters
  • data (pandas.DataFrame or None) – Measured data. If None, return units instead

  • diamagnetism (bool, optional) – Look for diamagnetism contribution, defaults to True

  • ferromagnetism (bool, optional) – Look for ferromagnetism contribution, defaults to True

Returns

Derived quantities listed in Columns.process() or units

Return type

pandas.Series

class physicslab.experiment.magnetism_type.Columns[source]

Bases: physicslab.utility._ColumnsBase

Column names.

classmethod mandatory()[source]

Get the current mandatory column names.

Return type

set(str)

classmethod process()[source]

Get the current values of the process() output column names.

Return type

lits(str)

class physicslab.experiment.magnetism_type.Measurement(data)[source]

Magnetization vs magnetic field measurement.

Copy magnetization column as Columns.RESIDUAL_MAGNETIZATION, so individual magnetic effects can be subtracted.

Parameters

data (pandas.DataFrame) – Magnetic field and magnetization data.

Raises

ValueError – If data is missing a mandatory column

diamagnetism(from_residual=False)[source]

Find diamagnetic component of overall magnetization.

Simulated data are subtracted from residue column (making it centred).

Parameters

from_residual (bool, optional) – Use residual data instead of the original data, defaults to False

Returns

Magnetic susceptibility and magnetization offset

Return type

tuple

ferromagnetism(from_residual=False, p0=None)[source]

Find ferromagnetic component of overall magnetization.

Simulated data are subtracted from residue column.
Hysteresis loop shape can be found in magnetic_hysteresis_loop().
Parameters
  • from_residual (bool, optional) – Use residual data instead of the original data, defaults to False

  • p0 (tuple, optional) – Initial guess of hysteresis loop parameters. If None, the parameters will be estimated automatically, defaults to None

Returns

Saturation, remanence and coercivity

Return type

tuple

physicslab.experiment.magnetism_type.plot(data)[source]

Plot single magnetization measurement separated data

Parameters

data (list[pandas.DataFrame]) –

Returns

Same objects as from matplotlib.pyplot.subplots()

Return type

tuple[Figure, Axes]