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

Merge branch 'tCWgpu' into 'master'

transient search: user option tauMin

See merge request GregAshton/PyFstat!15
parents 1f081b93 c9fc71e7
Branches
Tags
No related merge requests found
...@@ -332,6 +332,7 @@ class ComputeFstat(BaseSearchClass): ...@@ -332,6 +332,7 @@ class ComputeFstat(BaseSearchClass):
def __init__(self, tref, sftfilepattern=None, minStartTime=None, def __init__(self, tref, sftfilepattern=None, minStartTime=None,
maxStartTime=None, binary=False, BSGL=False, maxStartTime=None, binary=False, BSGL=False,
transientWindowType=None, t0Band=None, tauBand=None, transientWindowType=None, t0Band=None, tauBand=None,
tauMin=None,
dt0=None, dtau=None, dt0=None, dtau=None,
detectors=None, minCoverFreq=None, maxCoverFreq=None, detectors=None, minCoverFreq=None, maxCoverFreq=None,
injectSources=None, injectSqrtSX=None, assumeSqrtSX=None, injectSources=None, injectSqrtSX=None, assumeSqrtSX=None,
...@@ -359,9 +360,11 @@ class ComputeFstat(BaseSearchClass): ...@@ -359,9 +360,11 @@ class ComputeFstat(BaseSearchClass):
function, but with the full range, for debugging) function, but with the full range, for debugging)
t0Band, tauBand: int t0Band, tauBand: int
if >0, search t0 in (minStartTime,minStartTime+t0Band) 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, if =0, only compute CW Fstat with t0=minStartTime,
tau=maxStartTime-minStartTime. tau=maxStartTime-minStartTime.
tauMin: int
defaults to 2*Tsft
dt0, dtau: int dt0, dtau: int
grid resolutions in transient start-time and duration, grid resolutions in transient start-time and duration,
both default to Tsft both default to Tsft
...@@ -659,6 +662,14 @@ class ComputeFstat(BaseSearchClass): ...@@ -659,6 +662,14 @@ class ComputeFstat(BaseSearchClass):
self.windowRange.tauBand = self.tauBand self.windowRange.tauBand = self.tauBand
if self.dtau: if self.dtau:
self.windowRange.dtau = 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...') logging.info('Initialising transient FstatMap features...')
self.tCWFstatMapFeatures, self.gpu_context = ( self.tCWFstatMapFeatures, self.gpu_context = (
...@@ -702,10 +713,6 @@ class ComputeFstat(BaseSearchClass): ...@@ -702,10 +713,6 @@ class ComputeFstat(BaseSearchClass):
# true single-template search also in transient params: # true single-template search also in transient params:
# actual (t0,tau) window was set with tstart, tend before # actual (t0,tau) window was set with tstart, tend before
self.windowRange.tau = int(tend - tstart) # TYPE UINT4 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.FstatMap = tcw.call_compute_transient_fstat_map(
self.tCWFstatMapVersion, self.tCWFstatMapFeatures, self.tCWFstatMapVersion, self.tCWFstatMapFeatures,
......
...@@ -369,6 +369,7 @@ class TransientGridSearch(GridSearch): ...@@ -369,6 +369,7 @@ class TransientGridSearch(GridSearch):
detectors=None, SSBprec=None, injectSources=None, detectors=None, SSBprec=None, injectSources=None,
input_arrays=False, assumeSqrtSX=None, input_arrays=False, assumeSqrtSX=None,
transientWindowType=None, t0Band=None, tauBand=None, transientWindowType=None, t0Band=None, tauBand=None,
tauMin = None,
dt0=None, dtau=None, dt0=None, dtau=None,
outputTransientFstatMap=False, outputTransientFstatMap=False,
outputAtoms=False, outputAtoms=False,
...@@ -396,9 +397,11 @@ class TransientGridSearch(GridSearch): ...@@ -396,9 +397,11 @@ class TransientGridSearch(GridSearch):
debugging). Currently only supported for nsegs=1. debugging). Currently only supported for nsegs=1.
t0Band, tauBand: int t0Band, tauBand: int
if >0, search t0 in (minStartTime,minStartTime+t0Band) 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, if =0, only compute CW Fstat with t0=minStartTime,
tau=maxStartTime-minStartTime. tau=maxStartTime-minStartTime.
tauMin: int
defaults to 2*Tsft
dt0, dtau: int dt0, dtau: int
grid resolutions in transient start-time and duration, grid resolutions in transient start-time and duration,
both default to Tsft both default to Tsft
...@@ -431,6 +434,7 @@ class TransientGridSearch(GridSearch): ...@@ -431,6 +434,7 @@ class TransientGridSearch(GridSearch):
detectors=self.detectors, detectors=self.detectors,
transientWindowType=self.transientWindowType, transientWindowType=self.transientWindowType,
t0Band=self.t0Band, tauBand=self.tauBand, t0Band=self.t0Band, tauBand=self.tauBand,
tauMin=self.tauMin,
dt0=self.dt0, dtau=self.dtau, dt0=self.dt0, dtau=self.dtau,
minStartTime=self.minStartTime, maxStartTime=self.maxStartTime, minStartTime=self.minStartTime, maxStartTime=self.maxStartTime,
BSGL=self.BSGL, SSBprec=self.SSBprec, BSGL=self.BSGL, SSBprec=self.SSBprec,
...@@ -840,6 +844,7 @@ class FrequencySlidingWindow(GridSearch): ...@@ -840,6 +844,7 @@ class FrequencySlidingWindow(GridSearch):
self.nsegs = 1 self.nsegs = 1
self.t0Band = None self.t0Band = None
self.tauBand = None self.tauBand = None
self.tauMin = None
if os.path.isdir(outdir) is False: if os.path.isdir(outdir) is False:
os.mkdir(outdir) os.mkdir(outdir)
...@@ -957,6 +962,7 @@ class EarthTest(GridSearch): ...@@ -957,6 +962,7 @@ class EarthTest(GridSearch):
self.transientWindowType = None self.transientWindowType = None
self.t0Band = None self.t0Band = None
self.tauBand = None self.tauBand = None
self.tauMin = None
if os.path.isdir(outdir) is False: if os.path.isdir(outdir) is False:
os.mkdir(outdir) os.mkdir(outdir)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment