Utilities related to math¶
Angle¶
-
researchutils.math.angle.fit_angle_in_deg_range(angles, min_angle=0.0, max_angle=360.0)[source]¶ Check angle range and correct the range
Parameters: - angle (array-like) – unit is degrees
- min_angle (float) – maximum of range in degrees, default 0.0
- max_angle (float) – minimum of range in degrees, default 360.0
Returns: correct_angle – correct range angle in degrees
Return type: numpy.ndarray
-
researchutils.math.angle.fit_angle_in_rad_range(angles, min_angle=0.0, max_angle=6.283185307179586)[source]¶ Check angle range and correct the range
Parameters: - angle (array-like) – unit is radians
- min_angle (float, optional) – maximum of range in radians, default 0.0
- max_angle (float, optional) – minimum of range in radians, default 2 * math.pi
Returns: correct_angle – correct range angle
Return type: numpy.ndarray
Normalization¶
-
researchutils.math.normalization.normalize_by_min_max(data, min_value=0.0, max_value=1.0)[source]¶ Normalize the data in min_value and max_value
Parameters: - data (array-like) –
- min_value (float) – min_value of the fixed data, default is 0.0
- max_value (float) – max_value of the fixed data, default is 1.0
Returns: normalized_data – the shape of array is same as the input data
Return type: numpy.ndarray