diff --git a/pyfstat/core.py b/pyfstat/core.py index 50705e73f48d8ceb6c0ff0db3314a49c3426b7d2..e388b9a945a35ad80ad985769bc649514e22d8b3 100755 --- a/pyfstat/core.py +++ b/pyfstat/core.py @@ -333,6 +333,7 @@ class ComputeFstat(BaseSearchClass): def __init__(self, tref, sftfilepattern=None, minStartTime=None, maxStartTime=None, binary=False, BSGL=False, transientWindowType=None, t0Band=None, tauBand=None, + tauMin=None, dt0=None, dtau=None, detectors=None, minCoverFreq=None, maxCoverFreq=None, injectSources=None, injectSqrtSX=None, assumeSqrtSX=None, @@ -360,9 +361,11 @@ class ComputeFstat(BaseSearchClass): function, but with the full range, for debugging) t0Band, tauBand: int if >0, search t0 in (minStartTime,minStartTime+t0Band) - and tau in (2*Tsft,2*Tsft+tauBand). + and tau in (tauMin,2*Tsft+tauBand). if =0, only compute CW Fstat with t0=minStartTime, tau=maxStartTime-minStartTime. + tauMin: int + defaults to 2*Tsft dt0, dtau: int grid resolutions in transient start-time and duration, both default to Tsft @@ -660,6 +663,14 @@ class ComputeFstat(BaseSearchClass): self.windowRange.tauBand = self.tauBand if self.dtau: self.windowRange.dtau = self.dtau + if self.tauMin is None: + self.windowRange.tau = int(2*self.Tsft) + else: + if not isinstance(self.tauMin, int): + logging.warn('Casting non-integer tauMin={} to int...' + .format(self.tauMin)) + self.tauMin = int(self.tauMin) + self.windowRange.tau = self.tauMin logging.info('Initialising transient FstatMap features...') self.tCWFstatMapFeatures, self.gpu_context = ( @@ -703,10 +714,6 @@ class ComputeFstat(BaseSearchClass): # true single-template search also in transient params: # actual (t0,tau) window was set with tstart, tend before self.windowRange.tau = int(tend - tstart) # TYPE UINT4 - else: - # grid search: start at minimum tau required for nondegenerate - # F-stat computation - self.windowRange.tau = int(2*self.Tsft) self.FstatMap = tcw.call_compute_transient_fstat_map( self.tCWFstatMapVersion, self.tCWFstatMapFeatures, diff --git a/pyfstat/grid_based_searches.py b/pyfstat/grid_based_searches.py index 8d830c291da203b1c05f8f8008f7cd96cb675c2e..9762b378ec7a6203b48f6701d69577b3bf567258 100644 --- a/pyfstat/grid_based_searches.py +++ b/pyfstat/grid_based_searches.py @@ -353,6 +353,7 @@ class TransientGridSearch(GridSearch): detectors=None, SSBprec=None, injectSources=None, input_arrays=False, assumeSqrtSX=None, transientWindowType=None, t0Band=None, tauBand=None, + tauMin = None, dt0=None, dtau=None, outputTransientFstatMap=False, outputAtoms=False, @@ -380,9 +381,11 @@ class TransientGridSearch(GridSearch): debugging). Currently only supported for nsegs=1. t0Band, tauBand: int if >0, search t0 in (minStartTime,minStartTime+t0Band) - and tau in (2*Tsft,2*Tsft+tauBand). + and tau in (tauMin,2*Tsft+tauBand). if =0, only compute CW Fstat with t0=minStartTime, tau=maxStartTime-minStartTime. + tauMin: int + defaults to 2*Tsft dt0, dtau: int grid resolutions in transient start-time and duration, both default to Tsft @@ -415,6 +418,7 @@ class TransientGridSearch(GridSearch): detectors=self.detectors, transientWindowType=self.transientWindowType, t0Band=self.t0Band, tauBand=self.tauBand, + tauMin=self.tauMin, dt0=self.dt0, dtau=self.dtau, minStartTime=self.minStartTime, maxStartTime=self.maxStartTime, BSGL=self.BSGL, SSBprec=self.SSBprec, @@ -738,6 +742,7 @@ class FrequencySlidingWindow(GridSearch): self.transientWindowType = None self.t0Band = None self.tauBand = None + self.tauMin = None if os.path.isdir(outdir) is False: os.mkdir(outdir) @@ -855,6 +860,7 @@ class EarthTest(GridSearch): self.transientWindowType = None self.t0Band = None self.tauBand = None + self.tauMin = None if os.path.isdir(outdir) is False: os.mkdir(outdir)