3 # Copyright (C) 2020 Chad Hanna
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.
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.
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.
20 from gstlal
import far
22 from ligo.lw
import utils as ligolw_utils
23 from ligo.lw.utils
import process as ligolw_process
27 _, zlpdf = far.parse_likelihood_control_doc(ligolw_utils.load_url(fname, verbose = True, contenthandler = far.RankingStat.LIGOLWContentHandler))
30 zlpdf.zero_lag_lr_lnpdf.count.array[:] = 0.
32 # write out the file to disk
33 xmldoc = lw.ligolw.Document()
34 xmldoc.appendChild(lw.ligolw.LIGO_LW())
35 process = ligolw_process.register_to_xmldoc(xmldoc, sys.argv[0], paramdict = {})
36 far.gen_likelihood_control_doc(xmldoc, None, zlpdf)
37 ligolw_process.set_process_end_time(process)
38 ligolw_utils.write_url(xmldoc, fname, verbose = True, trap_signals = None)