Commit 5eb8713e authored by Gregory Ashton's avatar Gregory Ashton
Browse files

Improves semi-coherent search

- Adds debug information
- If no data is in a given segment, a nan will be produced. Rather than
  summing this, the code will now replace it with zero and spit out a
  debug message to the effect.
parent e4096abe
......@@ -240,6 +240,7 @@ class ComputeFstat(object):
detector_names = list(set([ for d in]))
self.detector_names = detector_names
SFT_timestamps = [d.header.epoch for d in]
self.SFT_timestamps = [float(s) for s in SFT_timestamps]
if args.quite is False and args.no_interactive is False:
from bashplotlib.histogram import plot_hist
......@@ -546,6 +547,15 @@ class SemiCoherentSearch(BaseSearchClass, ComputeFstat):
""" Returns twoF or ln(BSGL) semi-coherently at a single point """
if self.tboundaries[0] < self.SFT_timestamps[0]:
'Semi-coherent start time {} before first SFT timestamp {}'
.format(self.tboundaries[0], self.SFT_timestamps[0]))
if self.tboundaries[-1] > self.SFT_timestamps[-1]:
'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
self.PulsarDopplerParams.Delta = Delta
......@@ -600,6 +610,9 @@ class SemiCoherentSearch(BaseSearchClass, ComputeFstat):
log10_BSGL = lalpulsar.ComputeBSGL(
2*[0][0], self.twoFX, self.BSGLSetup)
d_detStat = log10_BSGL/np.log10(np.exp(1))
if np.isnan(d_detStat):
logging.debug('NaNs in semi-coherent twoF treated as zero')
d_detStat = 0
detStat += d_detStat
if record_segments:
Supports Markdown
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