agepy.mag.hysteresis.normalize

normalize(*magnetization, saturation_mean_percentage=10)

Normalizes hysteresis to the saturation region.

Magnetization is normalized to the averaged saturation over a given range. The range over which to average is computed from a percentage relative to the number of data points in one branch. The magnetization needs to be supplied either as one continous sequence containing both hysteresis branches or both branches as separate sequences of uniform length. In the latter case, the second branch needs to be sorted by time recorded, not by magnetic field value.

Parameters:
*magnetization: Sequence

One or two sequences containing the hysteresis branches of the magnetization.

saturation_mean_percentage: float, default 10

Percentage of half the length of magnetization over which to average the saturation value.

Returns:
NDArray

The normalized magnetization values. If magnetization is one continous array, then a 1-D array with the same length is returned. If magnetization is two arrays, a 2-D array is returned containing the two branches in the first axis.

Return type:

ndarray[Any, dtype[TypeVar(_ScalarType_co, bound= generic, covariant=True)]]