From fcaccc99f1f64fff9969185defd45d9d7c9949aa Mon Sep 17 00:00:00 2001
From: Roland Haas <rhaas@tapir.caltech.edu>
Date: Sun, 16 Jun 2019 21:18:12 -0400
Subject: [PATCH] POWER: add to_bool function

---
 POWER/power.py | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/POWER/power.py b/POWER/power.py
index 7b2380e..06a4161 100755
--- a/POWER/power.py
+++ b/POWER/power.py
@@ -228,6 +228,16 @@ def angular_momentum(x, q, m, chi1, chi2, LInitNR):
         * x**3.))
 	return l - LInitNR
 
+# Convert Cacus truth values to python's
+def to_bool(s):
+        s = tolower(s)
+        if s in ["true", "yes", "1"]:
+            return True
+        elif s in ["false", "no", "0"]:
+            return False
+        else:
+            raise(ValueError("Not a boolean values: %s" % s))
+
 #Get cutoff frequency
 def getCutoffFrequency(sim_name):
 	"""
-- 
GitLab