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

Minor code polishing

parent 9cdbd15a
Branches
Tags
No related merge requests found
...@@ -632,7 +632,8 @@ class ComputeFstat(BaseSearchClass): ...@@ -632,7 +632,8 @@ class ComputeFstat(BaseSearchClass):
self.windowRange.dt0 = self.Tsft self.windowRange.dt0 = self.Tsft
self.windowRange.dtau = self.Tsft self.windowRange.dtau = self.Tsft
# special treatment of window_type = none ==> replace by rectangular window spanning all the data # special treatment of window_type = none ==> replace by
# rectangular window spanning all the data
if self.windowRange.type == lalpulsar.TRANSIENT_NONE: if self.windowRange.type == lalpulsar.TRANSIENT_NONE:
self.windowRange.t0 = int(self.minStartTime) self.windowRange.t0 = int(self.minStartTime)
self.windowRange.t0Band = 0 self.windowRange.t0Band = 0
...@@ -660,7 +661,9 @@ class ComputeFstat(BaseSearchClass): ...@@ -660,7 +661,9 @@ class ComputeFstat(BaseSearchClass):
if self.dtau: if self.dtau:
self.windowRange.dtau = self.dtau self.windowRange.dtau = self.dtau
self.tCWFstatMapFeatures, self.gpu_context = tcw.init_transient_fstat_map_features ( self.tCWFstatMapVersion=='pycuda', self.cudaDeviceName ) self.tCWFstatMapFeatures, self.gpu_context = (
tcw.init_transient_fstat_map_features(
self.tCWFstatMapVersion == 'pycuda', self.cudaDeviceName))
def get_fullycoherent_twoF(self, tstart, tend, F0, F1, F2, Alpha, Delta, def get_fullycoherent_twoF(self, tstart, tend, F0, F1, F2, Alpha, Delta,
asini=None, period=None, ecc=None, tp=None, asini=None, period=None, ecc=None, tp=None,
...@@ -704,20 +707,28 @@ class ComputeFstat(BaseSearchClass): ...@@ -704,20 +707,28 @@ class ComputeFstat(BaseSearchClass):
# F-stat computation # F-stat computation
self.windowRange.tau = int(2*self.Tsft) self.windowRange.tau = int(2*self.Tsft)
#logging.debug('Calling "%s" version of ComputeTransientFstatMap() with windowRange: (type=%d (%s), t0=%f, t0Band=%f, dt0=%f, tau=%f, tauBand=%f, dtau=%f)...' % (self.tCWFstatMapVersion, self.windowRange.type, self.transientWindowType, self.windowRange.t0, self.windowRange.t0Band, self.windowRange.dt0, self.windowRange.tau, self.windowRange.tauBand, self.windowRange.dtau)) # logging.debug(
self.FstatMap = tcw.call_compute_transient_fstat_map( self.tCWFstatMapVersion, # 'Calling "%s" version of ComputeTransientFstatMap() with\
self.tCWFstatMapFeatures, # windowRange: (type=%d (%s), t0=%f, t0Band=%f, dt0=%f, tau=%f,\
self.FstatResults.multiFatoms[0], # tauBand=%f, dtau=%f)...' % (
self.windowRange # self.tCWFstatMapVersion, self.windowRange.type,
) # self.transientWindowType, self.windowRange.t0,
# self.windowRange.t0Band, self.windowRange.dt0,
# self.windowRange.tau, self.windowRange.tauBand,
# self.windowRange.dtau))
self.FstatMap = tcw.call_compute_transient_fstat_map(
self.tCWFstatMapVersion, self.tCWFstatMapFeatures,
self.FstatResults.multiFatoms[0], self.windowRange)
if self.tCWFstatMapVersion == 'lal': if self.tCWFstatMapVersion == 'lal':
F_mn = self.FstatMap.F_mn.data F_mn = self.FstatMap.F_mn.data
else: else:
F_mn = self.FstatMap.F_mn F_mn = self.FstatMap.F_mn
#logging.debug('maxF: {}'.format(FstatMap.maxF)) # logging.debug('maxF: {}'.format(self.FstatMap.maxF))
#logging.debug('t0_ML: %ds=T0+%fd' % (FstatMap.t0_ML, (FstatMap.t0_ML-tstart)/(3600.*24.))) # logging.debug('t0_ML: %ds=T0+%fd' % (
#logging.debug('tau_ML: %ds=%fd' % (FstatMap.tau_ML, FstatMap.tau_ML/(3600.*24.))) # self.FstatMap.t0_ML, (self.FstatMap.t0_ML-tstart)/(3600.*24.)))
# logging.debug('tau_ML: %ds=%fd' % (
# self.FstatMap.tau_ML, self.FstatMap.tau_ML/(3600.*24.)))
# logging.debug('F_mn: {}'.format(F_mn)) # logging.debug('F_mn: {}'.format(F_mn))
twoF = 2*np.max(F_mn) twoF = 2*np.max(F_mn)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment