Commit 921cc823 authored by Gregory Ashton's avatar Gregory Ashton
Browse files

Further improvements to handling o fdtglitch

Now forces use of dtglitch = None for no glitches
parent f6b14869
...@@ -681,7 +681,7 @@ class Writer(BaseSearchClass): ...@@ -681,7 +681,7 @@ class Writer(BaseSearchClass):
start and end times (in gps seconds) of the total observation span start and end times (in gps seconds) of the total observation span
dtglitch: float dtglitch: float
time (in gps seconds) of the glitch after tstart. To create data 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 delta_phi, delta_F0, delta_F1: float
instanteneous glitch magnitudes in rad, Hz, and Hz/s respectively instanteneous glitch magnitudes in rad, Hz, and Hz/s respectively
tref: float or None tref: float or None
...@@ -706,17 +706,14 @@ class Writer(BaseSearchClass): ...@@ -706,17 +706,14 @@ class Writer(BaseSearchClass):
self.minStartTime = self.tstart self.minStartTime = self.tstart
if self.maxStartTime is None: if self.maxStartTime is None:
self.maxStartTime = self.tend 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] 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: else:
self.dtglitch = np.array(dtglitch) self.dtglitch = np.atleast_1d(self.dtglitch)
self.tglitch = self.tstart + self.dtglitch self.tglitch = self.tstart + self.dtglitch
self.tbounds = np.concatenate(( self.tbounds = np.concatenate((
[self.tstart], self.tglitch, [self.tend])) [self.tstart], self.tglitch, [self.tend]))
logging.info('Using segment boundaries {}'.format(self.tbounds))
self.check_inputs() self.check_inputs()
......
...@@ -163,7 +163,7 @@ class TestMCMCSearch(Test): ...@@ -163,7 +163,7 @@ class TestMCMCSearch(Test):
Alpha = 5e-3 Alpha = 5e-3
Delta = 1.2 Delta = 1.2
tref = minStartTime tref = minStartTime
dtglitch = duration dtglitch = None
delta_F0 = 0 delta_F0 = 0
Writer = pyfstat.Writer(F0=F0, F1=F1, F2=F2, label=self.label, Writer = pyfstat.Writer(F0=F0, F1=F1, F2=F2, label=self.label,
h0=h0, sqrtSX=sqrtSX, h0=h0, sqrtSX=sqrtSX,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment