From d1c556059ebdc1f62d5bfcbbc40e417231753a56 Mon Sep 17 00:00:00 2001
From: "gregory.ashton" <gregory.ashton@ligo.org>
Date: Mon, 17 Jul 2017 18:25:54 +0200
Subject: [PATCH] Fix sftfilenames and sftfilepath for multiple detectors

If there are multiple detectors, then multiple .sft files are generated.
This updates the attribute 'sftfilename' -> 'sftfilenames', a list of
those files while also updating 'sftpilpath' to a colon separated list
of the relevant sft files.
---
 pyfstat/core.py | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/pyfstat/core.py b/pyfstat/core.py
index 407a2ed..6a6fbdc 100755
--- a/pyfstat/core.py
+++ b/pyfstat/core.py
@@ -940,10 +940,13 @@ class Writer(BaseSearchClass):
 
         self.data_duration = self.maxStartTime - self.minStartTime
         numSFTs = int(float(self.data_duration) / self.Tsft)
-        self.sftfilename = lalpulsar.OfficialSFTFilename(
-            'H', '1', numSFTs, self.Tsft, self.minStartTime,
-            self.data_duration, self.label)
-        self.sftfilepath = '{}/{}'.format(self.outdir, self.sftfilename)
+        self.sftfilenames = [
+            lalpulsar.OfficialSFTFilename(
+                dets[0], dets[1], numSFTs, self.Tsft, self.minStartTime,
+                self.data_duration, self.label)
+            for dets in self.detectors.split(',')]
+        self.sftfilepath = ';'.join([
+            '{}/{}'.format(self.outdir, fn) for fn in self.sftfilenames])
         self.calculate_fmin_Band()
 
     def check_inputs(self):
-- 
GitLab