3 # Copyright (C) 2019 Leo Tsukdda
5 # This program is free software; you can redistribute it and/or modify it
6 # under the terms of the GNU General Public License as published by the
7 # Free Software Foundation; either version 2 of the License, or (at your
8 # option) any later version.
10 # This program is distributed in the hope that it will be useful, but
11 # WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
13 # Public License for more details.
15 # You should have received a copy of the GNU General Public License along
16 # with this program; if not, write to the Free Software Foundation, Inc.,
17 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 from gstlal
import dagparts
21 from gstlal.stats
import inspiral_extrinsics, inspiral_lr
24 parser = argparse.ArgumentParser(description =
'generate a dt dphi covariance matrix and tree data to replace share/inspiral_dtdphi_pdf.h5')
25 parser.add_argument(
'--snr-thresh', type=
float,
default = inspiral_lr.LnLRDensity.snr_min, help =
'set the snr minimum to define found')
26 # parser.add_argument('--output-file', default = 'p_of_instruments_given_H_d.h5', help = 'set the output hdf5 file. Default extparams.h5')
27 parser.add_argument(
'--instruments', type=str, help=
'add instruments. Separate tham with comma, does not have to be alphabetical.', required = True)
28 args = parser.parse_args()
30 instruments =
"".join(sorted(args.instruments.split(
",")))
36 dag = dagparts.DAG(
"p_of_I_%s" % instruments)
38 margJob = dagparts.DAGJob(
"gstlal_inspiral_create_p_of_ifos_given_horizon", condor_commands = {
"request_memory":
"4GB",
"want_graceful_removal":
"True",
"kill_sig":
"15",
"accounting_group":
"ligo.prod.o3.cbc.uber.gstlaloffline"})
39 addJob = dagparts.DAGJob(
"gstlal_inspiral_add_p_of_ifos_given_horizon", condor_commands = {
"request_memory":
"4GB",
"want_graceful_removal":
"True",
"kill_sig":
"15",
"accounting_group":
"ligo.prod.o3.cbc.uber.gstlaloffline"})
44 for start in range(0, 41**(len(instruments) / 2 - 1), num):
46 margnodes.append(dagparts.DAGNode(margJob, dag, parent_nodes = [], opts = {
"start":str(start),
"stop":str(stop),
"instruments": args.instruments}, output_files = {
"output-file":
"%s/%s_p_of_instruments_given_H_d_%d_%d.h5" % (margJob.output_path,
"".join(instruments), start, stop)}))
49 addJob_input.extend([n.output_files[
"output-file"]
for n in margnodes])
50 addnode = dagparts.DAGNode(addJob, dag, parent_nodes = margnodes, opts = {
"": args.instruments}, input_files = {
"": addJob_input})