magpack.vectorop.scale_range#

scale_range(values, norm_list=None, mask_zero=True)#

Scales all values in the array such that they lie within the specified range.

Parameters:
valuesnp.ndarray

Array of values to scale.

norm_listlist of float (optional)

List of length 2 with lower and upper bound (defaults to [-1, 1]).

mask_zerobool (optional)

If True, zero values will remain zero..

Returns:
np.ndarray

Scaled values.