diff options
| author | Selene ToyKeeper | 2019-03-08 22:10:27 -0700 |
|---|---|---|
| committer | Selene ToyKeeper | 2019-03-08 22:10:27 -0700 |
| commit | ecfcb63de7a79e7df4d851057df97bec24a4f0ed (patch) | |
| tree | 4c99701d30ed0e992717e0cb5a6fd49858641062 /bin/level_calc.py | |
| parent | merged past 2 months of updates from fsm branch: (diff) | |
| download | anduril-ecfcb63de7a79e7df4d851057df97bec24a4f0ed.tar.gz anduril-ecfcb63de7a79e7df4d851057df97bec24a4f0ed.tar.bz2 anduril-ecfcb63de7a79e7df4d851057df97bec24a4f0ed.zip | |
level_calc.py: Combined log_2 and log_e into just log, because all logs have the same curve shape.
Diffstat (limited to '')
| -rwxr-xr-x | bin/level_calc.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/bin/level_calc.py b/bin/level_calc.py index c903800..2edd5fd 100755 --- a/bin/level_calc.py +++ b/bin/level_calc.py @@ -5,7 +5,7 @@ from __future__ import print_function import math interactive = False -# supported shapes: ninth, fifth, cube, square, log_e, log_2 +# supported shapes: ninth, fifth, cube, square, log #ramp_shape = 'cube' @@ -14,7 +14,7 @@ def main(args): """ # Get parameters from the user questions_main = [ - (str, 'ramp_shape', 'cube', 'Ramp shape? [cube, square, fifth, ninth, log_e, log_2]'), + (str, 'ramp_shape', 'cube', 'Ramp shape? [cube, square, fifth, ninth, log]'), (int, 'num_channels', 1, 'How many power channels?'), (int, 'num_levels', 4, 'How many total levels do you want?'), ] @@ -172,8 +172,9 @@ shapes = dict( fifth = (lambda x: x**5, lambda x: math.pow(x, 1/5.0)), cube = (lambda x: x**3, lambda x: math.pow(x, 1/3.0)), square = (lambda x: x**2, lambda x: math.pow(x, 1/2.0)), - log_e = (lambda x: math.e**x, lambda x: math.log(x, math.e)), - log_2 = (lambda x: 2.0**x, lambda x: math.log(x, 2.0)), + log = (lambda x: math.e**x, lambda x: math.log(x, math.e)), + # makes no difference; all logs have the same curve + #log_2 = (lambda x: 2.0**x, lambda x: math.log(x, 2.0)), ) def power(x): |
