pyValEIA.utils.math
Functions that support mathematical calculations.
Functions
|
Calculate the exponent of number using base 10. |
|
Round values to the nearest base. |
|
Round values to the desired threshold and return a unique array. |
|
Set a difference threshold. |
Module Contents
- pyValEIA.utils.math.get_exponent(number)[source]
Calculate the exponent of number using base 10.
- Parameters:
- numberdouble
Number for which the base-10 exponent will be calculated
- Returns:
- exp_valfloat
Exponent of number as a whole value
- pyValEIA.utils.math.base_round(xvals, base=5)[source]
Round values to the nearest base.
- Parameters:
- xvalsarray-like
Values to be rounded
- baseint
Base to be rounded to (default=5)
- Returns:
- round_valsarray-like
Values rounded to nearest base
- pyValEIA.utils.math.unique_threshold(xvals, thresh=0.01)[source]
Round values to the desired threshold and return a unique array.
- Parameters:
- xvalsarray-like
Values to be rounded
- threshfloat
Threshold for uniqueness (default=0.01)
- Returns:
- uvalsarray-like
Unique values at the desired threshold level
- pyValEIA.utils.math.set_dif_thresh(lat_span, percent=0.05)[source]
Set a difference threshold.
- Parameters:
- lat_span: double
span of latitude array e.g. max(latitude) - min(latitude)
- percentkwarg double
Percent as a decimal for difference threshold from 0-1 (default=0.05)
- Returns:
- float
Percentage times the span
Notes
Set the threshold for what is different, input scale (if lat_span) = 50, then our max tec/ne is 50 so set thresh to 5 for 10% can also use this for maximum difference between peak and trough, so can use smaller threshold