Skip to content
Snippets Groups Projects
Commit a2950497 authored by Gregory Ashton's avatar Gregory Ashton
Browse files

Move the per-segment semi-coherent calculation to sep. functions

This helps with timing to see which functions are being called
repeatedly
parent 9b6d34b7
No related branches found
No related tags found
No related merge requests found
......@@ -917,9 +917,18 @@ class SemiCoherentSearch(BaseSearchClass, ComputeFstat):
detStat = 0
if record_segments:
self.detStat_per_segment = []
for tstart, tend in zip(self.tboundaries[:-1], self.tboundaries[1:]):
self.windowRange.tau = int(self.Tcoh) # TYPE UINT4
for tstart in self.tboundaries[:-1]:
d_detStat = self._get_per_segment_det_stat(tstart)
detStat += d_detStat
if record_segments:
self.detStat_per_segment.append(d_detStat)
return detStat
def _get_per_segment_det_stat(self, tstart):
self.windowRange.t0 = int(tstart) # TYPE UINT4
self.windowRange.tau = int(tend - tstart) # TYPE UINT4
FS = lalpulsar.ComputeTransientFstatMap(
self.FstatResults.multiFatoms[0], self.windowRange, False)
......@@ -944,11 +953,8 @@ class SemiCoherentSearch(BaseSearchClass, ComputeFstat):
if np.isnan(d_detStat):
logging.debug('NaNs in semi-coherent twoF treated as zero')
d_detStat = 0
detStat += d_detStat
if record_segments:
self.detStat_per_segment.append(d_detStat)
return detStat
return d_detStat
class SemiCoherentGlitchSearch(BaseSearchClass, ComputeFstat):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment