Skip to content
Snippets Groups Projects
Commit c4badcf8 authored by David Keitel's avatar David Keitel
Browse files

TransientGridSearch: new F_mn writer function matching the format of...

TransientGridSearch: new F_mn writer function matching the format of lalpulsar.write_transientFstatMap_to_fp
parent 7ae31caa
Branches
Tags
No related merge requests found
......@@ -449,7 +449,7 @@ class TransientGridSearch(GridSearch):
lalpulsar.write_transientFstatMap_to_fp ( fo, FstatMap, windowRange, None )
del fo # instead of lal.FileClose() which is not SWIG-exported
else:
np.savetxt(tCWfile, 2.0*F_mn, delimiter=' ')
self.write_F_mn ( tCWfile, F_mn, windowRange)
maxidx = np.unravel_index(F_mn.argmax(), F_mn.shape)
thisCand += [windowRange.t0+maxidx[0]*windowRange.dt0,
windowRange.tau+maxidx[1]*windowRange.dtau]
......@@ -464,6 +464,15 @@ class TransientGridSearch(GridSearch):
self.save_array_to_disk(data)
self.data = data
def write_F_mn (self, tCWfile, F_mn, windowRange ):
with open(tCWfile, 'w') as tfp:
tfp.write('# t0 [s] tau [s] 2F\n')
for m, F_m in enumerate(F_mn):
this_t0 = windowRange.t0 + m * windowRange.dt0
for n, this_F in enumerate(F_m):
this_tau = windowRange.tau + n * windowRange.dtau;
tfp.write(' %10d %10d %- 11.8g\n' % (this_t0, this_tau, 2.0*this_F))
class SliceGridSearch(GridSearch):
""" Slice gridded search using ComputeFstat """
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment