Commit 165d062c authored by Vivien Raymond's avatar Vivien Raymond
Browse files

Implement "ignore-gracedb-psd" in lalinference_pipe

Original: 4b579e9f0f994ef469675c9cc35284ae41b77514
parent e391d6c9
......@@ -92,6 +92,9 @@ timeslides=false
# Uncomment the following line to ignore science segments. Useful when using fake noise
#ignore-science-segments=True
# Uncomment the following line to ignore the psd.xml.gz file when analyzing a gracedb event.
#ignore-gracedb-psd=True
#####################################################################################
[condor]
# Replace with your own executable locations
......
......@@ -69,7 +69,7 @@ class Event():
dummyCacheNames=['LALLIGO','LALVirgo','LALAdLIGO','LALAdVirgo']
def readLValert(SNRthreshold=0,gid=None,flow=40.0,gracedb="gracedb",savepsdpath="./"):
def readLValert(SNRthreshold=0,gid=None,flow=40.0,gracedb="gracedb",savepsdpath="./",downloadpsd=True):
"""
Parse LV alert file, continaing coinc, sngl, coinc_event_map.
and create a list of Events as input for pipeline
......@@ -103,12 +103,14 @@ def readLValert(SNRthreshold=0,gid=None,flow=40.0,gracedb="gracedb",savepsdpath=
trigSNR = coinctable[0].snr
# Parse PSD
srate_psdfile=16384
print "gracedb download %s psd.xml.gz" % gid
cwd=os.getcwd()
os.chdir(savepsdpath)
subprocess.call([gracedb,"download", gid ,"psd.xml.gz"])
xmlpsd = lalseries.read_psd_xmldoc(utils.load_filename('psd.xml.gz',contenthandler = lalseries.LIGOLWContentHandler))
ifos = xmlpsd.keys()
ifos=None
if downloadpsd:
print "gracedb download %s psd.xml.gz" % gid
subprocess.call([gracedb,"download", gid ,"psd.xml.gz"])
xmlpsd = lalseries.read_psd_xmldoc(utils.load_filename('psd.xml.gz',contenthandler = lalseries.LIGOLWContentHandler))
ifos = xmlpsd.keys()
psdasciidic=None
fhigh=None
if os.path.exists("psd.xml.gz"):
......@@ -546,13 +548,13 @@ class LALInferencePipelineDAG(pipeline.CondorDAG):
if self.config.has_option('lalinference','seglen'):
seglen = self.config.getint('lalinference','seglen')
if os.path.exists("psd.xml.gz"):
if os.path.isfile(os.path.join(self.basepath,'psd.xml.gz')):
psdlength = 0
else:
psdlength = 32*seglen
else:
seglen = max(e.duration for e in self.events)
if os.path.exists("psd.xml.gz"):
if os.path.isfile(os.path.join(self.basepath,'psd.xml.gz')):
psdlength = 0
else:
psdlength = 32*seglen
......@@ -680,7 +682,11 @@ class LALInferencePipelineDAG(pipeline.CondorDAG):
flow=40.0
if self.config.has_option('lalinference','flow'):
flow=min(ast.literal_eval(self.config.get('lalinference','flow')).values())
events = readLValert(gid=gid,flow=flow,gracedb=self.config.get('condor','gracedb'),savepsdpath=self.basepath)
downloadgracedbpsd=True
if self.config.has_option('input','ignore-gracedb-psd'):
if self.config.getboolean('input','ignore-gracedb-psd'):
downloadgracedbpsd=False
events = readLValert(gid=gid,flow=flow,gracedb=self.config.get('condor','gracedb'),savepsdpath=self.basepath,downloadpsd=downloadgracedbpsd)
# pipedown-database
else: gid=None
if self.config.has_option('input','pipedown-db'):
......@@ -799,7 +805,7 @@ class LALInferencePipelineDAG(pipeline.CondorDAG):
self.add_gracedb_log_node(respagenode,event.GID)
elif self.config.has_option('analysis','ugid'):
# LIB will want to upload info to gracedb but if we pass the gid in the usual way the pipeline
# will try to pull inspiral-only XML tables from the gdb page, failing.
# will try to pull inspiral-only XML tables from the gdb page, failing.
# To avoid that, LIB will read the gracedDB id to upload info to as an ugid=ID option
# in the analysis section.
ugid=self.config.get('analysis','ugid')
......
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