Commit 9f80109b authored by Soichiro Morisaki's avatar Soichiro Morisaki
Browse files

lalinference_pipe.py, lalinference_pipe_utils.py and...

lalinference_pipe.py, lalinference_pipe_utils.py and lalinference_pipe_exmaple.ini: enable it to specify xml files instead of specifying GID for GraceDB triggers
parent 3c18a12d
......@@ -157,11 +157,25 @@ class Event():
dummyCacheNames=['LALLIGO','LALVirgo','LALAdLIGO','LALAdVirgo']
def readLValert(threshold_snr=None,gid=None,flow=20.0,basepath="./",downloadpsd=True,roq=False,service_url=None):
"""
Parse LV alert file, containing coinc, sngl, coinc_event_map.
and create a list of Events as input for pipeline
Based on Chris Pankow's script
def create_events_from_coinc_and_psd(
coinc_xml_obj, psd_dict, gid=None, threshold_snr=None, flow=20.0, roq=False
):
"""This function calculates seglen, fhigh, srate and horizon distance from
coinc.xml and psd.xml.gz from GraceDB and create list of Events as input of
pipeline. This function is based on Chris Pankow's script.
Parameters
----------
coinc_xml_obj: glue.ligolw.ligolw.Document
file object of coinc.xml
psd_dict: dictionary of REAL8FrequencySeries
PSDs of all the ifos
threshold_snr: float
snr threshold for detection
flow: float
lower frequecy cutoff for overlap calculation
roq: bool
Whether the run uses ROQ or not
"""
output=[]
from glue.ligolw import utils as ligolw_utils
......@@ -175,40 +189,19 @@ def readLValert(threshold_snr=None,gid=None,flow=20.0,basepath="./",downloadpsd=
from gstlal import reference_psd
except ImportError:
reference_psd = None
cwd=os.getcwd()
os.chdir(basepath)
print("Download %s coinc.xml" % gid)
if service_url is None:
client = GraceDb()
else:
client = GraceDb(service_url=service_url)
xmldoc = ligolw_utils.load_fileobj(client.files(gid, "coinc.xml"), contenthandler = lsctables.use_in(ligolw.LIGOLWContentHandler))[0]
ligolw_utils.write_filename(xmldoc, "coinc.xml")
coinc_events = lsctables.CoincInspiralTable.get_table(xmldoc)
sngl_event_idx = dict((row.event_id, row) for row in lsctables.SnglInspiralTable.get_table(xmldoc))
coinc_events = lsctables.CoincInspiralTable.get_table(coinc_xml_obj)
sngl_event_idx = dict((row.event_id, row) for row in lsctables.SnglInspiralTable.get_table(coinc_xml_obj))
ifos = sorted(coinc_events[0].instruments)
trigSNR = coinc_events[0].snr
# Parse PSD
srate_psdfile=16384
fhigh=None
psdfileobj = None
if downloadpsd:
print("Download %s psd.xml.gz" % gid)
try:
psdfileobj = client.files(gid, "psd.xml.gz")
except HTTPError:
print("Failed to download %s psd.xml.gz. lalinference will estimate the psd itself." % gid)
if psdfileobj is not None:
if reference_psd is not None:
xmlpsd = ligolw_utils.load_fileobj(psdfileobj, contenthandler = lalseries.PSDContentHandler)[0]
psd = lalseries.read_psd_xmldoc(xmlpsd)
ligolw_utils.write_filename(xmlpsd, "psd.xml.gz", gz = True)
else:
open("psd.xml.gz", "wb").write(psdfileobj.read())
psdasciidic = get_xml_psds(os.path.realpath("./psd.xml.gz"),ifos,os.path.realpath('./PSDs'),end_time=None)
combine = np.loadtxt(psdasciidic[list(psdasciidic.keys())[0]])
srate_psdfile = pow(2.0, ceil( log(float(combine[-1][0]), 2) ) ) * 2
coinc_map = lsctables.CoincMapTable.get_table(xmldoc)
if psd_dict is not None:
psd = list(psd_dict.values())[0]
srate_psdfile = pow(
2.0, ceil(log(psd.f0 + psd.deltaF * (psd.data.length - 1), 2))
) * 2
coinc_map = lsctables.CoincMapTable.get_table(coinc_xml_obj)
for coinc in coinc_events:
these_sngls = [sngl_event_idx[c.event_id] for c in coinc_map if c.coinc_event_id == coinc.coinc_event_id]
dur=[]
......@@ -228,17 +221,17 @@ def readLValert(threshold_snr=None,gid=None,flow=20.0,basepath="./",downloadpsd=
else:
horizon_distance.append(2 * e.eff_distance)
else:
if reference_psd is not None and psdfileobj is not None:
if reference_psd is not None and psd_dict is not None:
if not roq==False:
fstop = IMRPhenomDGetPeakFreq(e.mass1, e.mass2, 0.0, 0.0)
HorizonDistanceObj = reference_psd.HorizonDistance(f_min = flow, f_max = fstop, delta_f = 1.0 / 32.0, m1 = e.mass1, m2 = e.mass2)
horizon_distance.append(HorizonDistanceObj(psd[e.ifo], snr = threshold_snr)[0])
horizon_distance.append(HorizonDistanceObj(psd_dict[e.ifo], snr = threshold_snr)[0])
if srate:
if max(srate)<srate_psdfile:
srate = max(srate)
else:
srate = srate_psdfile
if psdfileobj is not None:
if psd_dict is not None:
fhigh = srate_psdfile/2.0 * 0.95 # Because of the drop-off near Nyquist of the PSD from gstlal
else:
srate = None
......@@ -252,7 +245,6 @@ def readLValert(threshold_snr=None,gid=None,flow=20.0,basepath="./",downloadpsd=
output.append(ev)
print("Found %d coinc events in table." % len(coinc_events))
os.chdir(cwd)
return output
def open_pipedown_database(database_filename,tmp_space):
......@@ -529,21 +521,11 @@ def get_xml_psds(psdxml,ifos,outpath,end_time=None):
out[ifo]=os.path.join(outpath,ifo+'_psd_'+time+'.txt')
return out
def get_trigger_chirpmass(gid=None,service_url=None):
def get_trigger_chirpmass(coinc_xml_obj):
from glue.ligolw import lsctables
from glue.ligolw import ligolw
from glue.ligolw import utils as ligolw_utils
from ligo.gracedb.rest import GraceDb
cwd=os.getcwd()
if service_url is None:
client = GraceDb()
else:
client = GraceDb(service_url=service_url)
xmldoc = ligolw_utils.load_fileobj(client.files(gid, "coinc.xml"), contenthandler = lsctables.use_in(ligolw.LIGOLWContentHandler))[0]
ligolw_utils.write_filename(xmldoc, "coinc.xml")
coinc_events = lsctables.CoincInspiralTable.get_table(xmldoc)
sngl_event_idx = dict((row.event_id, row) for row in lsctables.SnglInspiralTable.get_table(xmldoc))
coinc_map = lsctables.CoincMapTable.get_table(xmldoc)
coinc_events = lsctables.CoincInspiralTable.get_table(coinc_xml_obj)
sngl_event_idx = dict((row.event_id, row) for row in lsctables.SnglInspiralTable.get_table(coinc_xml_obj))
coinc_map = lsctables.CoincMapTable.get_table(coinc_xml_obj)
mass1 = []
mass2 = []
for coinc in coinc_events:
......@@ -556,18 +538,17 @@ def get_trigger_chirpmass(gid=None,service_url=None):
assert len(set(mass2)) == 1
mchirp = (mass1[0]*mass2[0])**(3./5.) / ( (mass1[0] + mass2[0])**(1./5.) )
os.remove("coinc.xml")
return mchirp
def get_roq_mchirp_priors(path, roq_paths, roq_params, key, gid=None,sim_inspiral=None, service_url=None):
def get_roq_mchirp_priors(path, roq_paths, roq_params, key, coinc_xml_obj=None, sim_inspiral=None):
## XML and GID cannot be given at the same time
## sim_inspiral must already point at the right row
mc_priors = {}
if gid is not None and sim_inspiral is not None:
print("Error in get_roq_mchirp_priors, cannot use both gid and sim_inspiral\n")
if coinc_xml_obj is not None and sim_inspiral is not None:
print("Error in get_roq_mchirp_priors, cannot use both coinc.xml and sim_inspiral\n")
sys.exit(1)
for roq in roq_paths:
......@@ -585,8 +566,8 @@ def get_roq_mchirp_priors(path, roq_paths, roq_params, key, gid=None,sim_inspira
if i<len(roq_paths)-1:
mc_priors[roq][1]-= (mc_priors[roq][1]- mc_priors[ordered_roq_paths[i+1]][0])/2.
i+=1'''
if gid is not None:
trigger_mchirp = get_trigger_chirpmass(gid=gid,service_url=service_url)
if coinc_xml_obj is not None:
trigger_mchirp = get_trigger_chirpmass(coinc_xml_obj)
elif sim_inspiral is not None:
trigger_mchirp = sim_inspiral.mchirp
else:
......@@ -594,15 +575,15 @@ def get_roq_mchirp_priors(path, roq_paths, roq_params, key, gid=None,sim_inspira
return mc_priors, trigger_mchirp
def get_roq_component_mass_priors(path, roq_paths, roq_params, key, gid=None,sim_inspiral=None,service_url=None):
def get_roq_component_mass_priors(path, roq_paths, roq_params, key, coinc_xml_obj=None, sim_inspiral=None):
## XML and GID cannot be given at the same time
## coinc_xml_obj and sim_inspiral cannot be given at the same time
## sim_inspiral must already point at the right row
m1_priors = {}
m2_priors = {}
if gid is not None and sim_inspiral is not None:
print("Error in get_roq_mchirp_priors, cannot use both gid and sim_inspiral\n")
if coinc_xml_obj is not None and sim_inspiral is not None:
print("Error in get_roq_mchirp_priors, cannot use both coinc.xml and sim_inspiral\n")
sys.exit(1)
for roq in roq_paths:
......@@ -611,8 +592,8 @@ def get_roq_component_mass_priors(path, roq_paths, roq_params, key, gid=None,sim
m1_priors[roq]=[float(roq_params[roq]['mass1min']),float(roq_params[roq]['mass1max'])]
m2_priors[roq]=[float(roq_params[roq]['mass2min']),float(roq_params[roq]['mass2max'])]
if gid is not None:
trigger_mchirp = get_trigger_chirpmass(gid,service_url=service_url)
if coinc_xml_obj is not None:
trigger_mchirp = get_trigger_chirpmass(coinc_xml_obj)
elif sim_inspiral is not None:
trigger_mchirp = sim_inspiral.mchirp
else:
......@@ -906,7 +887,7 @@ class LALInferencePipelineDAG(pipeline.CondorDAG):
gpsstart=self.config.getfloat('input','gps-start-time')
if self.config.has_option('input','gps-end-time'):
gpsend=self.config.getfloat('input','gps-end-time')
inputnames=['gps-time-file','burst-injection-file','injection-file','sngl-inspiral-file','coinc-inspiral-file','pipedown-db','gid','gstlal-db']
inputnames=['gps-time-file','burst-injection-file','injection-file','coinc-xml','pipedown-db','gid','gstlal-db']
ReadInputFromList=sum([ 1 if self.config.has_option('input',name) else 0 for name in inputnames])
# If no input events given, just return an empty list (e.g. for PP pipeline)
if ReadInputFromList!=1 and (gpsstart is None or gpsend is None):
......@@ -1006,34 +987,84 @@ class LALInferencePipelineDAG(pipeline.CondorDAG):
injTable=lsctables.SimBurstTable.get_table(utils.load_filename(injfile,contenthandler = lsctables.use_in(LIGOLWContentHandler)))
events=[Event(SimBurst=inj) for inj in injTable]
self.add_pfn_cache([create_pfn_tuple(self.config.get('input','burst-injection-file'))])
# SnglInspiral Table
if self.config.has_option('input','sngl-inspiral-file'):
trigTable = lsctables.SnglInspiralTable.get_table(utils.load_filename(injfile, contenthandler = lsctables.use_in(ligolw.LIGOLWContentHandler)))
events=[Event(SnglInspiral=trig) for trig in trigTable]
self.add_pfn_cache([create_pfn_tuple(self.config.get('input','sngl-inspiral-file'))])
if self.config.has_option('input','coinc-inspiral-file'):
coincTable = lsctables.CoincInspiralTable.get_table(utils.load_filename(injfile, contenthandler = lsctables.use_in(ligolw.LIGOLWContentHandler)))
events = [Event(CoincInspiral=coinc) for coinc in coincTable]
self.add_pfn_cache([create_pfn_tuple(self.config.get('input','coinc-inspiral-file'))])
# LVAlert CoincInspiral Table
if self.config.has_option('input','gid'):
gid=self.config.get('input','gid')
gid = None
if self.config.has_option('input','gid') or self.config.has_option('input', 'coinc-xml'):
flow=20.0
if self.config.has_option('lalinference','flow'):
flow=min(ast.literal_eval(self.config.get('lalinference','flow')).values())
downloadgracedbpsd=True
if self.config.has_option('input','ignore-gracedb-psd'):
if self.config.getboolean('input','ignore-gracedb-psd'):
downloadgracedbpsd=False
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')
service_url = None
if self.config.has_option('analysis','service-url'):
service_url = self.config.get('analysis','service-url')
events = readLValert(gid=gid,flow=flow,basepath=self.basepath,downloadpsd=downloadgracedbpsd,
threshold_snr=threshold_snr,roq=self.config.getboolean('analysis','roq'),service_url=service_url)
else: gid=None
# get coinc object and psd object
from glue.ligolw import utils as ligolw_utils
from glue.ligolw import lsctables
from glue.ligolw import ligolw
from lal import series as lalseries
psd_file_obj = None
if self.config.has_option('input', 'gid'):
from ligo.gracedb.rest import GraceDb, HTTPError
gid = self.config.get('input', 'gid')
if self.config.has_option('analysis','service-url'):
client = GraceDb(
service_url=self.config.get('analysis', 'service-url')
)
else:
client = GraceDb()
print("Download %s coinc.xml" % gid)
coinc_file_obj = client.files(gid, "coinc.xml")
try:
downloadpsd = (not self.config.getboolean('input','ignore-gracedb-psd'))
except:
downloadpsd = True
if downloadpsd:
print("Download %s psd.xml.gz" % gid)
try:
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:
coinc_file_obj = open(self.config.get('input', 'coinc-xml'), "rb")
try:
psd_file_obj = open(self.config.get('input', 'psd-xml-gz'), "rb")
except:
print("lalinference will estimate the psd itself.")
# write down the objects to files
coinc_xml_obj = ligolw_utils.load_fileobj(
coinc_file_obj,
contenthandler = lsctables.use_in(ligolw.LIGOLWContentHandler)
)[0]
ligolw_utils.write_filename(
coinc_xml_obj, os.path.join(self.basepath, "coinc.xml")
)
if psd_file_obj is not None:
path_to_psd = os.path.join(self.basepath, "psd.xml.gz")
psd_xml_obj = ligolw_utils.load_fileobj(
psd_file_obj,
contenthandler = lalseries.PSDContentHandler
)[0]
psd_dict = lalseries.read_psd_xmldoc(psd_xml_obj)
ligolw_utils.write_filename(psd_xml_obj, path_to_psd, gz = True)
ifos = sorted(
lsctables.CoincInspiralTable.get_table(
coinc_xml_obj
)[0].instruments
)
get_xml_psds(
os.path.realpath(path_to_psd), ifos,
os.path.realpath(os.path.join(self.basepath, "PSDs")),
end_time=None
)
else:
psd_dict = None
events = create_events_from_coinc_and_psd(
coinc_xml_obj, psd_dict, gid, threshold_snr=None, flow=flow,
roq=self.config.getboolean('analysis','roq')
)
# pipedown-database
if self.config.has_option('input','gstlal-db'):
queryfunc=get_zerolag_lloid
......@@ -1118,7 +1149,11 @@ class LALInferencePipelineDAG(pipeline.CondorDAG):
respagenode.set_psd_files(enginenodes[0].get_psd_files())
respagenode.set_snr_file(enginenodes[0].get_snr_file())
if os.path.exists(self.basepath+'/coinc.xml'):
respagenode.set_coinc_file(self.basepath+'/coinc.xml',self.config.get('input','gid'))
try:
gid = self.config.get('input','gid')
except:
gid = None
respagenode.set_coinc_file(os.path.join(self.basepath, 'coinc.xml'), gid)
mkdirs(os.path.join(self.basepath,'coherence_test'))
par_mergenodes=[]
for ifo in enginenodes[0].ifos:
......@@ -1155,7 +1190,11 @@ class LALInferencePipelineDAG(pipeline.CondorDAG):
subresnode.set_psd_files(cotest_nodes[0].get_psd_files())
subresnode.set_snr_file(cotest_nodes[0].get_snr_file())
if os.path.exists(self.basepath+'/coinc.xml'):
subresnode.set_coinc_file(self.basepath+'/coinc.xml',self.config.get('input','gid'))
try:
gid = self.config.get('input','gid')
except:
gid = None
subresnode.set_coinc_file(os.path.join(self.basepath, 'coinc.xml'), gid)
if self.config.has_option('input','injection-file') and event.event_id is not None:
subresnode.set_injection(self.config.get('input','injection-file'),event.event_id)
elif self.config.has_option('input','burst-injection-file') and event.event_id is not None:
......@@ -1177,7 +1216,11 @@ class LALInferencePipelineDAG(pipeline.CondorDAG):
respagenode.set_psd_files(enginenodes[0].get_psd_files())
respagenode.set_snr_file(enginenodes[0].get_snr_file())
if os.path.exists(self.basepath+'/coinc.xml'):
respagenode.set_coinc_file(self.basepath+'/coinc.xml',self.config.get('input','gid'))
try:
gid = self.config.get('input','gid')
except:
gid = None
respagenode.set_coinc_file(os.path.join(self.basepath, 'coinc.xml'), gid)
if self.config.has_option('input','injection-file') and event.event_id is not None:
respagenode.set_injection(self.config.get('input','injection-file'),event.event_id)
elif self.config.has_option('input','burst-injection-file') and event.event_id is not None:
......@@ -1256,7 +1299,11 @@ class LALInferencePipelineDAG(pipeline.CondorDAG):
respagenode.set_psd_files(enginenodes[0].get_psd_files())
respagenode.set_snr_file(enginenodes[0].get_snr_file())
if os.path.exists(self.basepath+'/coinc.xml'):
respagenode.set_coinc_file(self.basepath+'/coinc.xml',self.config.get('input','gid'))
try:
gid = self.config.get('input','gid')
except:
gid = None
respagenode.set_coinc_file(os.path.join(self.basepath, 'coinc.xml'), gid)
if self.config.has_option('input','injection-file') and event.event_id is not None:
respagenode.set_injection(self.config.get('input','injection-file'),event.event_id)
if self.config.has_option('input','burst-injection-file') and event.event_id is not None:
......
......@@ -31,8 +31,6 @@ parser=OptionParser(usage)
parser.add_option("-r","--run-path",default=None,action="store",type="string",help="Directory to run pipeline in (default: $PWD)",metavar="RUNDIR")
parser.add_option("-p","--daglog-path",default=None,action="store",type="string",help="Path to directory to contain DAG log file. SHOULD BE LOCAL TO SUBMIT NODE",metavar="LOGDIR")
parser.add_option("-g","--gps-time-file",action="store",type="string",default=None,help="Text file containing list of GPS times to analyse",metavar="TIMES.txt")
parser.add_option("-t","--single-triggers",action="store",type="string",default=None,help="SnglInspiralTable trigger list",metavar="SNGL_FILE.xml")
parser.add_option("-C","--coinc-triggers",action="store",type="string",default=None,help="CoinInspiralTable trigger list",metavar="COINC_FILE.xml")
parser.add_option("--gid",action="store",type="string",default=None,help="GraceDB ID")
parser.add_option("--service-url",action="store",type="string",default=None,help="GraceDB url from which xml files are downloaded")
parser.add_option("-I","--injections",action="store",type="string",default=None,help="List of injections to perform and analyse",metavar="INJFILE.xml")
......@@ -159,9 +157,6 @@ mkdirs(daglogdir)
if opts.gps_time_file is not None:
cp.set('input','gps-time-file',os.path.abspath(opts.gps_time_file))
if opts.single_triggers is not None:
cp.set('input','sngl-inspiral-file',os.path.abspath(opts.single_triggers))
if opts.injections is not None:
cp.set('input','injection-file',os.path.abspath(opts.injections))
......@@ -171,9 +166,6 @@ if opts.burst_injections is not None:
sys.exit(1)
cp.set('input','burst-injection-file',os.path.abspath(opts.burst_injections))
if opts.coinc_triggers is not None:
cp.set('input','coinc-inspiral-file',os.path.abspath(opts.coinc_triggers))
if opts.gid is not None:
cp.set('input','gid',opts.gid)
......@@ -223,38 +215,54 @@ def setup_roq(cp):
print("WARNING: Forcing the f_low to ", str(roq_force_flow), "Hz")
print("WARNING: Overwriting user choice of flow, srate, seglen, and (mc_min, mc_max and q-min) or (mass1_min, mass1_max, mass2_min, mass2_max)")
gid=None
row=None
def key(item): # to order the ROQ bases
return float(item[1]['seglen'])
coinc_xml_obj = None
row=None
# Get file object of coinc.xml
if opts.gid is not None:
from ligo.gracedb.rest import GraceDb
from glue.ligolw import ligolw
from glue.ligolw import lsctables
from glue.ligolw import utils as ligolw_utils
gid=opts.gid
elif opts.injections is not None or cp.has_option('input','injection-file'):
cwd=os.getcwd()
if cp.has_option('analysis', 'service-url'):
client = GraceDb(cp.get('analysis', 'service-url'))
else:
client = GraceDb()
coinc_xml_obj = ligolw_utils.load_fileobj(client.files(gid, "coinc.xml"), contenthandler = lsctables.use_in(ligolw.LIGOLWContentHandler))[0]
elif cp.has_option('input', 'coinc-xml'):
from glue.ligolw import ligolw
from glue.ligolw import lsctables
from glue.ligolw import utils as ligolw_utils
coinc_xml_obj = ligolw_utils.load_fileobj(open(cp.get('input', 'coinc-xml'), "rb"), contenthandler = lsctables.use_in(ligolw.LIGOLWContentHandler))[0]
# Get sim_inspiral from injection file
if cp.has_option('input','injection-file'):
print("Only 0-th event in the XML table will be considered while running with ROQ\n")
# Read event 0 from Siminspiral Table
from glue.ligolw import ligolw
from glue.ligolw import lsctables
from glue.ligolw import utils
inxml=cp.get('input','injection-file')
injTable = lsctables.SimInspiralTable.get_table(utils.load_filename(inxml,contenthandler = lsctables.use_in(ligolw.LIGOLWContentHandler)))
row=injTable[0]
else:
gid=None
row=None
from glue.ligolw import utils as ligolw_utils
row = lsctables.SimInspiralTable.get_table(
utils.load_filename(cp.get('input','injection-file'),contenthandler=lsctables.use_in(ligolw.LIGOLWContentHandler))
)[0]
service_url = None
if cp.has_option('analysis', 'service-url'):
service_url = cp.get('analysis', 'service-url')
roq_bounds = pipe_utils.Query_ROQ_Bounds_Type(path, roq_paths)
if roq_bounds == 'chirp_mass_q':
print('ROQ has bounds in chirp mass and mass-ratio')
mc_priors, trigger_mchirp = pipe_utils.get_roq_mchirp_priors(path, roq_paths, roq_params, key, gid=gid, sim_inspiral=row, service_url=service_url)
mc_priors, trigger_mchirp = pipe_utils.get_roq_mchirp_priors(
path, roq_paths, roq_params, key, coinc_xml_obj=coinc_xml_obj, sim_inspiral=row
)
elif roq_bounds == 'component_mass':
print('ROQ has bounds in component masses')
# get component mass bounds, then compute the chirp mass that can be safely covered
# further below we pass along the component mass bounds to the sampler, not the tighter chirp-mass, q bounds
m1_priors, m2_priors, trigger_mchirp = pipe_utils.get_roq_component_mass_priors(path, roq_paths, roq_params, key, gid=gid, sim_inspiral=row, service_url=service_url)
m1_priors, m2_priors, trigger_mchirp = pipe_utils.get_roq_component_mass_priors(
path, roq_paths, roq_params, key, coinc_xml_obj=coic_xml_obj, sim_inspiral=row
)
mc_priors = {}
for (roq,m1_prior), (roq2,m2_prior) in zip(m1_priors.items(), m2_priors.items()):
mc_priors[roq] = sorted([pipe_utils.mchirp_from_components(m1_prior[1], m2_prior[0]), pipe_utils.mchirp_from_components(m1_prior[0], m2_prior[1])])
......@@ -266,7 +274,7 @@ def setup_roq(cp):
print('WARNING: Rescaling ROQ basis, please ensure it is allowed with the model used.')
# If the true chirp mass is unknown, add variations over the mass bins
if opts.gid is not None or (opts.injections is not None or cp.has_option('input','injection-file')) or cp.has_option('lalinference','trigger_mchirp'):
if opts.gid is not None or (opts.injections is not None or cp.has_option('input','injection-file')) or cp.has_option('lalinference','trigger_mchirp') or cp.has_option('input', 'coinc-xml'):
for mc_prior in mc_priors:
mc_priors[mc_prior] = array(mc_priors[mc_prior])
......
......@@ -82,8 +82,8 @@ analyse-all-time=False
# Can manually specify input files here or over-ride on the command line
#gps-time-file=
#injection-file=
#sngl-inspiral-file=
#coinc-inspiral-file=
#coinc-xml=
#psd-xml-gz=
#pipedown-db=
#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