gstlal 1.13.0
Loading...
Searching...
No Matches
gstlal_fake_frames_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
24from gstlal.datafind import DataCache, DataType
25
26
27parser = argparse.ArgumentParser()
28parser.add_argument("-c", "--config", help="Sets the path to read configuration from.")
29
30# load config
31args = parser.parse_args()
32config = Config.load(args.config)
33config.setup()
34config.create_time_bins(start_pad=0, overlap=0, one_ifo_only=True)
35
36# create dag
37dag = DAG(config)
38dag.create_log_dir()
39
40# generate dag layers
41if config.frames.whiten_type in ("psd", "median_psd"):
42 ref_psd = dag.reference_psd()
43 if config.frames.whiten_type == "psd":
44 ref_psd = dag.smoothen_psd(ref_psd)
45 elif config.frames.whiten_type == "median_psd":
46 ref_psd = dag.median_psd(ref_psd)
47elif config.frames.whiten_type == "file":
48 ref_psd = DataCache.from_files(DataType.REFERENCE_PSD, config.frames.reference_psd)
49
50dag.create_frames(ref_psd)
51
52# write dag/script to disk
53dag_name = "fake_frames_dag"
54dag.write_dag(f"{dag_name}.dag")
55dag.write_script(f"{dag_name}.sh")