stretch_data#

static MonostaticRCSPlotter.stretch_data(data, scaling_factor, offset)#

Stretches and scales the input data to a specified range.

This method normalizes the input data between its minimum and maximum values and then applies a linear transformation using the formula: scaled_data = (data - min) / (max - min) * m + b. The parameters m and b control the scaling and shifting of the normalized data.

Parameters:
datanumpy.ndarray or pandas.Series

The input data array or series to be stretched.

scaling_factorfloat

The scaling factor applied to the normalized data.

offsetfloat

The offset added to the scaled data after normalization.

Returns:
numpy.ndarray or pandas.Series

Transformed data

Example:
>>> :obj:`data` = :obj:`np.array`\([1, 2, 3, 4, 5])
    ..
>>> :obj:`stretched_data` = :obj:`stretch_data`\(data,2,1)
    ..
>>> :obj:`print`\(:obj:`stretched_data`)
    ..
[1. 1.5 2. 2.5 3. ]