From e74d5b38c7bb61e28dc31cf9637f68fe6c6371b9 Mon Sep 17 00:00:00 2001
From: Gregory Ashton <gregory.ashton@ligo.org>
Date: Mon, 17 Jul 2017 11:40:22 +0200
Subject: [PATCH] Closes #2

The command line argument is matched to formatting used by MFD to
reconstruct the argument (using .16g) formatting. Ideally, all REAL8
should use this formatting.
---
 pyfstat/core.py | 4 ++--
 tests.py        | 3 ++-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/pyfstat/core.py b/pyfstat/core.py
index 1016d0c..407a2ed 100755
--- a/pyfstat/core.py
+++ b/pyfstat/core.py
@@ -1094,8 +1094,8 @@ transientTauDays={:1.3f}\n""")
         else:
             data_duration = self.maxStartTime - self.minStartTime
             cl_mfd.append('--duration={}'.format(int(data_duration)))
-        cl_mfd.append('--fmin={}'.format(self.fmin))
-        cl_mfd.append('--Band={}'.format(self.Band))
+        cl_mfd.append('--fmin={:.16g}'.format(self.fmin))
+        cl_mfd.append('--Band={:.16g}'.format(self.Band))
         cl_mfd.append('--Tsft={}'.format(self.Tsft))
         if self.h0 != 0:
             cl_mfd.append('--injectionSources="{}"'.format(self.config_file_name))
diff --git a/tests.py b/tests.py
index 090d50f..e11b5f5 100644
--- a/tests.py
+++ b/tests.py
@@ -31,9 +31,10 @@ class TestWriter(Test):
             './TestData/H-4800_H1_1800SFT_Test-700000000-8640000.sft'))
 
     def test_makefakedata_usecached(self):
-        Writer = pyfstat.Writer(self.label, outdir=outdir)
+        Writer = pyfstat.Writer(self.label, outdir=outdir, duration=86400)
         if os.path.isfile(Writer.sftfilepath):
             os.remove(Writer.sftfilepath)
+        Writer.make_cff()
         Writer.run_makefakedata()
         time_first = os.path.getmtime(Writer.sftfilepath)
         Writer.run_makefakedata()
-- 
GitLab