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

Add ability to record individual segment detStat values

parent eff47496
No related branches found
No related tags found
No related merge requests found
...@@ -542,7 +542,8 @@ class SemiCoherentSearch(BaseSearchClass, ComputeFstat): ...@@ -542,7 +542,8 @@ class SemiCoherentSearch(BaseSearchClass, ComputeFstat):
def run_semi_coherent_computefstatistic_single_point( def run_semi_coherent_computefstatistic_single_point(
self, F0, F1, F2, Alpha, Delta, asini=None, self, F0, F1, F2, Alpha, Delta, asini=None,
period=None, ecc=None, tp=None, argp=None): period=None, ecc=None, tp=None, argp=None,
record_segments=False):
""" Returns twoF or ln(BSGL) semi-coherently at a single point """ """ Returns twoF or ln(BSGL) semi-coherently at a single point """
self.PulsarDopplerParams.fkdot = np.array([F0, F1, F2, 0, 0, 0, 0]) self.PulsarDopplerParams.fkdot = np.array([F0, F1, F2, 0, 0, 0, 0])
...@@ -573,6 +574,8 @@ class SemiCoherentSearch(BaseSearchClass, ComputeFstat): ...@@ -573,6 +574,8 @@ class SemiCoherentSearch(BaseSearchClass, ComputeFstat):
# return log10_BSGL/np.log10(np.exp(1)) # return log10_BSGL/np.log10(np.exp(1))
detStat = 0 detStat = 0
if record_segments:
self.detStat_per_segment = []
for tstart, tend in zip(self.tboundaries[:-1], self.tboundaries[1:]): for tstart, tend in zip(self.tboundaries[:-1], self.tboundaries[1:]):
self.windowRange.t0 = int(tstart) # TYPE UINT4 self.windowRange.t0 = int(tstart) # TYPE UINT4
self.windowRange.tau = int(tend - tstart) # TYPE UINT4 self.windowRange.tau = int(tend - tstart) # TYPE UINT4
...@@ -581,9 +584,8 @@ class SemiCoherentSearch(BaseSearchClass, ComputeFstat): ...@@ -581,9 +584,8 @@ class SemiCoherentSearch(BaseSearchClass, ComputeFstat):
self.FstatResults.multiFatoms[0], self.windowRange, False) self.FstatResults.multiFatoms[0], self.windowRange, False)
if self.BSGL is False: if self.BSGL is False:
detStat += 2*FS.F_mn.data[0][0] d_detStat = 2*FS.F_mn.data[0][0]
continue else:
FstatResults_single = copy.copy(self.FstatResults) FstatResults_single = copy.copy(self.FstatResults)
FstatResults_single.lenth = 1 FstatResults_single.lenth = 1
FstatResults_single.data = self.FstatResults.multiFatoms[0].data[0] FstatResults_single.data = self.FstatResults.multiFatoms[0].data[0]
...@@ -597,8 +599,10 @@ class SemiCoherentSearch(BaseSearchClass, ComputeFstat): ...@@ -597,8 +599,10 @@ class SemiCoherentSearch(BaseSearchClass, ComputeFstat):
self.twoFX[1] = 2*FS1.F_mn.data[0][0] self.twoFX[1] = 2*FS1.F_mn.data[0][0]
log10_BSGL = lalpulsar.ComputeBSGL( log10_BSGL = lalpulsar.ComputeBSGL(
2*FS.F_mn.data[0][0], self.twoFX, self.BSGLSetup) 2*FS.F_mn.data[0][0], self.twoFX, self.BSGLSetup)
d_detStat = log10_BSGL/np.log10(np.exp(1))
detStat += log10_BSGL/np.log10(np.exp(1)) detStat += d_detStat
if record_segments:
self.detStat_per_segment.append(d_detStat)
return detStat return detStat
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment