From 921cc823754f4c215176bc5997cac04a7dd45918 Mon Sep 17 00:00:00 2001 From: Gregory Ashton <gregory.ashton@ligo.org> Date: Mon, 30 Jan 2017 11:29:53 +0100 Subject: [PATCH] Further improvements to handling o fdtglitch Now forces use of dtglitch = None for no glitches --- pyfstat/core.py | 11 ++++------- tests.py | 2 +- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/pyfstat/core.py b/pyfstat/core.py index 79d7b82..2b57fa2 100755 --- a/pyfstat/core.py +++ b/pyfstat/core.py @@ -681,7 +681,7 @@ class Writer(BaseSearchClass): start and end times (in gps seconds) of the total observation span dtglitch: float time (in gps seconds) of the glitch after tstart. To create data - without a glitch, set dtglitch=tend-tstart or leave as None + without a glitch, set dtglitch=None delta_phi, delta_F0, delta_F1: float instanteneous glitch magnitudes in rad, Hz, and Hz/s respectively tref: float or None @@ -706,17 +706,14 @@ class Writer(BaseSearchClass): self.minStartTime = self.tstart if self.maxStartTime is None: self.maxStartTime = self.tend - if self.dtglitch is None or self.dtglitch == self.duration: + if self.dtglitch is None: self.tbounds = [self.tstart, self.tend] - elif np.size(self.dtglitch) == 1: - self.dtglitch = np.array([dtglitch]) - self.tbounds = np.concatenate(( - [self.tstart], self.tstart+self.dtglitch, [self.tend])) else: - self.dtglitch = np.array(dtglitch) + self.dtglitch = np.atleast_1d(self.dtglitch) self.tglitch = self.tstart + self.dtglitch self.tbounds = np.concatenate(( [self.tstart], self.tglitch, [self.tend])) + logging.info('Using segment boundaries {}'.format(self.tbounds)) self.check_inputs() diff --git a/tests.py b/tests.py index 7df3718..04ed039 100644 --- a/tests.py +++ b/tests.py @@ -163,7 +163,7 @@ class TestMCMCSearch(Test): Alpha = 5e-3 Delta = 1.2 tref = minStartTime - dtglitch = duration + dtglitch = None delta_F0 = 0 Writer = pyfstat.Writer(F0=F0, F1=F1, F2=F2, label=self.label, h0=h0, sqrtSX=sqrtSX, -- GitLab