gstlal 1.13.0
Loading...
Searching...
No Matches
gstlal_psd_workflow
1#!/usr/bin/env python3
2#
3# Copyright (C) 2020 Patrick Godwin (patrick.godwin@ligo.org)
4#
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.
9#
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.
14#
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.
18
19
20import argparse
21
22from gstlal.config import Config
23from gstlal.dags import DAG
24
25
26parser = argparse.ArgumentParser()
27parser.add_argument("-c", "--config", help="Sets the path to read configuration from.")
28
29# load config
30args = parser.parse_args()
31config = Config.load(args.config)
32config.setup()
33
34# create dag
35dag = DAG(config)
36dag.create_log_dir()
37
38# generate dag layers
39ref_psd = dag.reference_psd()
40median_psd = dag.median_psd(ref_psd)
41
42# write dag/script to disk
43dag_name = "psd_dag"
44dag.write_dag(f"{dag_name}.dag")
45dag.write_script(f"{dag_name}.sh")