From 78ab5b6d81c9a78be01e3682aadc7d81bd2cc418 Mon Sep 17 00:00:00 2001
From: Gregory Ashton <gregory.ashton@ligo.org>
Date: Wed, 30 Nov 2016 18:39:55 +0100
Subject: [PATCH] Adds error message if run has neither Nsegs0 or run_setup

---
 pyfstat.py | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/pyfstat.py b/pyfstat.py
index ffc79c0..1ddb98f 100755
--- a/pyfstat.py
+++ b/pyfstat.py
@@ -2232,8 +2232,13 @@ class MCMCFollowUpSearch(MCMCSemiCoherentSearch):
         except KeyError:
             return False
 
-    def init_run_setup(self, run_setup, log_table=True, gen_tex_table=True,
-                       R=10, Nsegs0=None):
+    def init_run_setup(self, run_setup=None, R=10, Nsegs0=None, log_table=True,
+                       gen_tex_table=True):
+
+        if run_setup is None and Nsegs0 is None:
+            raise ValueError(
+                'You must either specify the run_setup, or Nsegs0 from which '
+                'the optimial run_setup given R can be estimated')
         fiducial_freq, DeltaOmega, DeltaFs = self.init_V_estimate_parameters()
         if run_setup is None:
             logging.info('No run_setup provided')
-- 
GitLab