2.3. resample

hysteresis.resample.resample(curve, Nsamples, **kwargs)[source]

Creates a new curve object that has a different number of sample points between the start and end of each Cycle object. The curve resampled will be one level down, i.e. Hystereses will their simpleCycles resampled, and SimpleCycles will have their Monotonic Curves resampled

The number of points is specified by the user, and intermediate points will be evenly spaced between the cycles start and end points. Linear interpolation is used to find the y value of intermediate points. In the case of a Hysteresis, every SimpleCycle curve will be resampled with an amount of points equal to Nsamples.

In the case of a SimpleCycle, Monotonic curves are resampled if they are set.

Parameters:
  • curve (Hysteresis, Monotonic Cycle, or numpy array) – The curve to be resampled. If a numpy array is provided, it must be increasing to be resampled properly.

  • Nsamples – The number of samples for the new curve.

Returns:

curve – An object of the input type with a number of points equal to Nsamples

Return type:

Hysteresis, SimpleCycle,