aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorSelene ToyKeeper2019-03-26 11:57:17 -0600
committerSelene ToyKeeper2019-03-26 11:57:17 -0600
commit0a9a0b76c600091398b9c696e4697e4543a46576 (patch)
tree411aec3bd5b1da1a04f8533134c134ea58a1f90e /bin
parentmerged Emisar D18 branch, which also includes a bunch of Anduril refactoring (diff)
parentlevel_calc.py: Combined log_2 and log_e into just log, because all logs have ... (diff)
downloadanduril-0a9a0b76c600091398b9c696e4697e4543a46576.tar.gz
anduril-0a9a0b76c600091398b9c696e4697e4543a46576.tar.bz2
anduril-0a9a0b76c600091398b9c696e4697e4543a46576.zip
merged from trunk
Diffstat (limited to 'bin')
-rwxr-xr-xbin/level_calc.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/bin/level_calc.py b/bin/level_calc.py
index 7635595..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, seventh, 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, seventh, 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?'),
]
@@ -173,8 +173,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):
If you find this content useful please consider a small donation via bitcoin: bitcoin:1mxKyQsHHugqRxPKgwaA7wUwJEGCNthn2?amount=0.001&message=Donation Scraping git contents via cgit is very resource intensive. The continued hosting of these git repositories is entirely financed by your bitcoin contributions. For donations of a least 1 mBTC you include your IP address in the message of your bitcoin donation. This will remove this message in the future for requests from your IP, which will significantly reduce token usage. In any case, any contributions to bitcoin address 1mxKyQsHHugqRxPKgwaA7wUwJEGCNthn2 are very welcome. Thanks in advance for you contribution to a self-sustaining ecosystem.