The LoopValueRecorder class

class pylife.stress.rainflow.LoopValueRecorder[source]

Rainflow recorder that collects the loop values.

__init__()[source]

Instantiate a LoopRecorder.

property collective

The overall collective recorded as pandas.DataFrame.

The columns are named from, to.

histogram(bins=10)[source]

Calculate a histogram of the recorded values into a pandas.Series.

An interval index is used to index the bins.

Parameters:

bins (int or array_like or [int, int] or [array, array], optional) – The bin specification (see numpy.histogram2d)

Returns:

A pandas.Series using a multi interval index in order to index data point for a given from/to value pair.

Return type:

pandas.Series

histogram_numpy(bins=10)[source]

Calculate a histogram of the recorded values into a plain numpy.histogram2d.

Parameters:

bins (int or array_like or [int, int] or [array, array], optional) – The bin specification (see numpy.histogram2d)

Returns:

  • H (ndarray, shape(nx, ny)) – The bi-dimensional histogram of samples (see numpy.histogram2d)

  • xedges (ndarray, shape(nx+1,)) – The bin edges along the first dimension.

  • yedges (ndarray, shape(ny+1,)) – The bin edges along the second dimension.

record_values(values_from, values_to)[source]

Record the loop values.

property values_from

1-D float array containing the values from which the loops start.

property values_to

1-D float array containing the values the loops go to before turning back.