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