utils¶
|
Finds the index of a value in an array most similar to value passed. |
|
Finds maximum and minimum of an array. |
|
Linerarly interpolates between two points. |
-
beatmap.utils.
index_of_value
(array, value)[source]¶ Finds the index of a value in an array most similar to value passed.
- Parameters
array (array) – Array of values.
value (numeric) – Value you wish to find in array.
- Returns
idx – For 2D idx[0] = i index, idx[1] = j index.
- Return type
array
-
beatmap.utils.
max_min
(array)[source]¶ Finds maximum and minimum of an array.
If multiple max and min values exist, all are returned.
- Parameters
array (array) – Array of values.
- Returns
maximum (float) – Maximum value of array.
max_idx (array) – For 2D max_idx[0] = i index, max_idx[1] = j index.
minimum (float) – Minimum value of array.
min_idx (array) – For 2D min_idx[0] = i index, min_idx[1] = j index
-
beatmap.utils.
lin_interp
(df, val)[source]¶ Linerarly interpolates between two points.
Specifically designed to find the relp corresponding to some value of n.
- Parameters
df (dataframe) – Contains raw data, realtaive pressure (relp) and amount adsorbed (n).
- Returns
interp_val – The relp corresponding to some n, between two (n, relp) points.
- Return type
float