Commit 00fcb3c4 authored by Vivien Raymond's avatar Vivien Raymond
Browse files

When using ROQ, do not try to guess segment lenght needed as it's set by the basis.

Original: 8a0dbc02aec58a3b56242266e7a7168a9a29acac
parent 6eada4b4
......@@ -75,7 +75,7 @@ class Event():
dummyCacheNames=['LALLIGO','LALVirgo','LALAdLIGO','LALAdVirgo']
def readLValert(threshold_snr=None,gid=None,flow=40.0,gracedb="gracedb",basepath="./",downloadpsd=True):
def readLValert(threshold_snr=None,gid=None,flow=40.0,gracedb="gracedb",basepath="./",downloadpsd=True,roq=False):
"""
Parse LV alert file, containing coinc, sngl, coinc_event_map.
and create a list of Events as input for pipeline
......@@ -125,10 +125,11 @@ def readLValert(threshold_snr=None,gid=None,flow=40.0,gracedb="gracedb",basepath
horizon_distance=[]
for e in these_sngls:
# Review: Replace this with a call to LALSimulation function at some point
p=Popen(["lalapps_chirplen","--flow",str(flow),"-m1",str(e.mass1),"-m2",str(e.mass2)],stdout=PIPE, stderr=PIPE, stdin=PIPE)
strlen = p.stdout.read()
dur.append(pow(2.0, ceil( log(max(8.0,float(strlen.splitlines()[2].split()[5]) + 2.0), 2) ) ) )
srate.append(pow(2.0, ceil( log(float(strlen.splitlines()[1].split()[5]), 2) ) ) * 2 )
if roq==False:
p=Popen(["lalapps_chirplen","--flow",str(flow),"-m1",str(e.mass1),"-m2",str(e.mass2)],stdout=PIPE, stderr=PIPE, stdin=PIPE)
strlen = p.stdout.read()
dur.append(pow(2.0, ceil( log(max(8.0,float(strlen.splitlines()[2].split()[5]) + 2.0), 2) ) ) )
srate.append(pow(2.0, ceil( log(float(strlen.splitlines()[1].split()[5]), 2) ) ) * 2 )
snr = e.snr
eff_dist = e.eff_distance
if threshold_snr is not None:
......@@ -136,14 +137,21 @@ def readLValert(threshold_snr=None,gid=None,flow=40.0,gracedb="gracedb",basepath
horizon_distance.append(eff_dist * snr/threshold_snr)
else:
horizon_distance.append(2 * eff_dist)
if max(srate)<srate_psdfile:
srate = max(srate)
if srate:
if max(srate)<srate_psdfile:
srate = max(srate)
else:
srate = srate_psdfile
if downloadpsd:
fhigh = srate_psdfile/2.0 * 0.95 # Because of the drop-off near Nyquist of the PSD from gstlal
else:
srate = None
if dur:
duration = max(dur)
else:
srate = srate_psdfile
if downloadpsd:
fhigh = srate_psdfile/2.0 * 0.95 # Because of the drop-off near Nyquist of the PSD from gstlal
duration = None
horizon_distance = max(horizon_distance) if len(horizon_distance) > 0 else None
ev=Event(CoincInspiral=coinc, GID=gid, ifos = ifos, duration = max(dur), srate = srate,
ev=Event(CoincInspiral=coinc, GID=gid, ifos = ifos, duration = duration, srate = srate,
trigSNR = trigSNR, fhigh = fhigh, horizon_distance=horizon_distance)
output.append(ev)
......@@ -936,7 +944,8 @@ class LALInferencePipelineDAG(pipeline.CondorDAG):
threshold_snr = None
if not self.config.has_option('engine','distance-max') and self.config.has_option('input','threshold-snr'):
threshold_snr=self.config.getfloat('input','threshold-snr')
events = readLValert(gid=gid,flow=flow,gracedb=self.config.get('condor','gracedb'),basepath=self.basepath,downloadpsd=downloadgracedbpsd,threshold_snr=threshold_snr)
events = readLValert(gid=gid,flow=flow,gracedb=self.config.get('condor','gracedb'),basepath=self.basepath,downloadpsd=downloadgracedbpsd,
threshold_snr=threshold_snr,roq=self.config.has_option('condor','computeroqweights'))
else: gid=None
# pipedown-database
if self.config.has_option('input','gstlal-db'):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment