gstlal
1.13.0
Toggle main menu visibility
Loading...
Searching...
No Matches
bin
gstlal_plot_psd_horizon
1
#!/usr/bin/env python3
2
#
3
# Copyright (C) 2012 Chad Hanna
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
22
23
24
from
optparse
import
OptionParser
25
26
from
gstlal.plots
import
set_matplotlib_cache_directory
27
set_matplotlib_cache_directory()
28
from
gstlal.plots
import
horizon
29
30
31
def
parse_command_line():
32
parser = OptionParser()
33
parser.add_option(
"-o"
,
"--output"
, help =
"Set plot filename."
)
34
options, filenames = parser.parse_args()
35
36
if
not
filenames:
37
raise
ValueError(
"must supply at least one input filename"
)
38
39
return
options, filenames
40
41
42
options, filenames = parse_command_line()
43
44
horizon_distance = horizon.HorizonDistance.from_psds(filenames)
45
horizon_distance.savefig(options.output)
Generated by
1.17.0