2.5. resampleRegion

hysteresis.resample.resampleRegion(curve, Nsamples, regions=[[0, 0.1], [0.9, 1]])[source]

Resamples only parts of an input a curve. The part of the curve that is resampled is defined using the regions variable. The regions is a list of lists, defining a start and end point of the curve in terms of a parameter varying between 0 and 1.

Each region is resampled using Nsamples

Parameters:
  • curve (Hysteresis Curve, or numpy array) – The input curve to be resampled. Can be either a hystersis curve, or a numpy array. If a numpy array is provided, it must not change direction to be resampled properly.

  • region (list of lists, or list) –

    A lists of regions, written in terms of a parameter that ranges from 0 at the start of the curve to 1 at the end of the curve. Regions are either lists of lists, or a single list if the number of regions is equal to one.

    Regions must be sorted from left to right and have no overlaps, i.e. [[0, 0.2], [0.1, 0.2]] is invalid [[0, 0.1], [0.8, 0.9], [0.4, 0.5]] is invalid

  • Nsample (int) – The number of sample to use for each region.

Return type:

None.