3# Copyright (C) 2010 Kipp Cannon, Chad Hanna, Leo Singer
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"""Estimate power spectra from LIGO frames or simulated h(t)."""
19
20
56
57#
58# parse command line
59#
60
61
62from optparse import OptionParser
63
64from gstlal import datasource
65from gstlal.psd import measure_psd, write_psd
66
67
68def parse_command_line():
69 parser = OptionParser(description = __doc__)
70
71# generic "source" options
72 datasource.append_options(parser)
73
74# add our own options
75 parser.add_option("--write-psd", metavar = "filename", help = "Write measured noise spectrum to this LIGO light-weight XML file (required).")
76 parser.add_option("--sample-rate", metavar = "Hz", default = 16384, type = "int", help = "Sample rate at which to generate the PSD, default 16384 Hz")
77 parser.add_option("--psd-fft-length", metavar = "s", default = 8, type = "int", help = "FFT length, default 8s")