From a20684b87c9cb5c74cf71e7822c952a225f2eae1 Mon Sep 17 00:00:00 2001 From: "gregory.ashton" <gregory.ashton@ligo.org> Date: Thu, 2 Mar 2017 16:06:47 +0100 Subject: [PATCH] Adds test to check SFT_timestamps exists If SFTs where not loaded, i.e. if injectSources was used, no timestamps are generated. In such a case don't attempt to used them. --- pyfstat/core.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/pyfstat/core.py b/pyfstat/core.py index 5ec5aa1..a796766 100755 --- a/pyfstat/core.py +++ b/pyfstat/core.py @@ -547,14 +547,15 @@ class SemiCoherentSearch(BaseSearchClass, ComputeFstat): record_segments=False): """ Returns twoF or ln(BSGL) semi-coherently at a single point """ - if self.tboundaries[0] < self.SFT_timestamps[0]: - logging.debug( - 'Semi-coherent start time {} before first SFT timestamp {}' - .format(self.tboundaries[0], self.SFT_timestamps[0])) - if self.tboundaries[-1] > self.SFT_timestamps[-1]: - logging.debug( - 'Semi-coherent end time {} after last SFT timestamp {}' - .format(self.tboundaries[-1], self.SFT_timestamps[-1])) + if hasattr(self, 'SFT_timestamps'): + if self.tboundaries[0] < self.SFT_timestamps[0]: + logging.debug( + 'Semi-coherent start time {} before first SFT timestamp {}' + .format(self.tboundaries[0], self.SFT_timestamps[0])) + if self.tboundaries[-1] > self.SFT_timestamps[-1]: + logging.debug( + 'Semi-coherent end time {} after last SFT timestamp {}' + .format(self.tboundaries[-1], self.SFT_timestamps[-1])) self.PulsarDopplerParams.fkdot = np.array([F0, F1, F2, 0, 0, 0, 0]) self.PulsarDopplerParams.Alpha = Alpha -- GitLab