Commit 3330a845 authored by Soichiro Morisaki's avatar Soichiro Morisaki
Browse files enable using psd.xml.gz only for distance max calculation

Previously, if we set distance max with psd.xml.gz, we necessarily have to use that for PSD.
This patch enables using psd.xml.gz only for distance max calculation. Whether psd.xml.gz is
used for PSD is controlled by ignore-gracedb-psd option.
parent ba12fd34
...@@ -870,15 +870,17 @@ class LALInferencePipelineDAG(pipeline.CondorDAG): ...@@ -870,15 +870,17 @@ class LALInferencePipelineDAG(pipeline.CondorDAG):
seglen = int(np.ceil(self.config.getfloat('engine','seglen'))) seglen = int(np.ceil(self.config.getfloat('engine','seglen')))
if self.config.has_option('lalinference','seglen'): if self.config.has_option('lalinference','seglen'):
seglen = self.config.getint('lalinference','seglen') seglen = self.config.getint('lalinference','seglen')
if os.path.isfile(os.path.join(self.basepath,'psd.xml.gz')) or self.config.has_option('condor','bayesline') or self.config.has_option('condor','bayeswave'): use_gracedbpsd = (not self.config.getboolean('input','ignore-gracedb-psd'))
use_gracedbpsd = True
if (use_gracedbpsd and os.path.isfile(os.path.join(self.basepath,'psd.xml.gz'))) or self.config.has_option('condor','bayesline') or self.config.has_option('condor','bayeswave'):
psdlength = 0 psdlength = 0
padding = 0 padding = 0
self.config.set('input','padding',str(padding)) self.config.set('input','padding',str(padding))
if self.config.has_option('condor','bayeswave'): if self.config.has_option('condor','bayeswave'):
if (np.log2(seglen)%1): if (np.log2(seglen)%1):
seglen = np.power(2., np.ceil(np.log2(seglen))) seglen = np.power(2., np.ceil(np.log2(seglen)))
else: else:
psdlength = 32*seglen psdlength = 32*seglen
else: else:
...@@ -1065,16 +1067,11 @@ class LALInferencePipelineDAG(pipeline.CondorDAG): ...@@ -1065,16 +1067,11 @@ class LALInferencePipelineDAG(pipeline.CondorDAG):
client = GraceDb() client = GraceDb()
print("Download %s coinc.xml" % gid) print("Download %s coinc.xml" % gid)
coinc_file_obj = client.files(gid, "coinc.xml") coinc_file_obj = client.files(gid, "coinc.xml")
print("Download %s psd.xml.gz" % gid)
try: try:
downloadpsd = (not self.config.getboolean('input','ignore-gracedb-psd')) psd_file_obj = client.files(gid, "psd.xml.gz")
except: except HTTPError:
downloadpsd = True print("Failed to download %s psd.xml.gz. lalinference will estimate the psd itself." % gid)
if downloadpsd:
print("Download %s psd.xml.gz" % gid)
psd_file_obj = client.files(gid, "psd.xml.gz")
except HTTPError:
print("Failed to download %s psd.xml.gz. lalinference will estimate the psd itself." % gid)
else: else:
coinc_file_obj = open(self.config.get('input', 'coinc-xml'), "rb") coinc_file_obj = open(self.config.get('input', 'coinc-xml'), "rb")
try: try:
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