stretch_data#

static MonostaticRCSPlotter.stretch_data(data, scaling_factor, offset)[source]#

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

Examples

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