aboutsummaryrefslogtreecommitdiff
path: root/bin/level_calc.py
diff options
context:
space:
mode:
authorSelene ToyKeeper2019-04-14 16:44:35 -0600
committerSelene ToyKeeper2019-04-14 16:44:35 -0600
commit25720b4a45b812bd82a5a7d63a37db69248e286f (patch)
tree58be3722414c28560630c414f78651a4ace60ef2 /bin/level_calc.py
parentconfigured Fireflies-EDC-Thrower discrete ramp better, updated meta info (diff)
parentfixed bug: hold-from-off then release and hold failed in stepped ramp (diff)
downloadanduril-25720b4a45b812bd82a5a7d63a37db69248e286f.tar.gz
anduril-25720b4a45b812bd82a5a7d63a37db69248e286f.tar.bz2
anduril-25720b4a45b812bd82a5a7d63a37db69248e286f.zip
merged upstream fsm changes
Diffstat (limited to 'bin/level_calc.py')
-rwxr-xr-xbin/level_calc.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/bin/level_calc.py b/bin/level_calc.py
index c903800..f16f8ce 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, seventh, 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, seventh, ninth, log]'),
(int, 'num_channels', 1, 'How many power channels?'),
(int, 'num_levels', 4, 'How many total levels do you want?'),
]
@@ -169,11 +169,13 @@ def get_value(text, default, args):
shapes = dict(
ninth = (lambda x: x**9, lambda x: math.pow(x, 1/9.0)),
+ seventh= (lambda x: x**7, lambda x: math.pow(x, 1/7.0)),
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):