3 # Copyright (C) 2012,2014 Kipp Cannon
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.
19 ## @file gstlal_inspiral_marginalize_likelihoods_online
21 # This program runs gstlal_inspiral_marginalize_likelihood in a while True
22 # loop; See gstlal_inspiral_marginalize_likelihoods_online for more details
25 # This program is not meant to be executed standalone by a user. It should be
26 # part of a DAG managing a running gstlal_inspiral online analysis.
28 # This program takes two or more arguments;
30 # - The path of the output file name
31 # - One or more root URLs of the web servers from which to retrieve event
32 # parameter distribution data (e.g., "http://node001.ligo.caltech.edu")
34 # This program queries each running gstlal_inspiral job via the URL,
35 # computes PDFs of the likelihood ratio ranking statistics from the
36 # parameter distribution data, then marginalizes the ranking statistic PDFs
37 # across jobs and writes the result to the given output file.
39 # It continues to do that in an infinite loop with a 10 minute pause on
40 # each iteration. Files are not overwritten directly, but rather via a
41 # temporary file and mv operation to ensure that no files are corrupted in
42 # a POSIX file environment.
46 # get the output file name
53 # path on the web server to the trigger parameter file
56 LIKELIHOOD_PATH=
"likelihood.xml"
59 # pause for each iteration (seconds)
69 echo
"... sleeping for ${SLEEP} seconds ..."
74 RANKING_PDF_FILE=$(mktemp)
75 RANKING_PDF_FILES=
"${RANKING_PDF_FILES} ${RANKING_PDF_FILE}"
76 gstlal_inspiral_calc_rank_pdfs --ranking-stat-samples 100000 --
verbose --output ${RANKING_PDF_FILE} --samples-file ${SERVER}${LIKELIHOOD_PATH} ${SERVER}${LIKELIHOOD_PATH} ||
break
78 gstlal_inspiral_marginalize_likelihood --
verbose --output ${OUTPUT}.next.gz ${RANKING_PDF_FILES} ||
break
79 rm -vf ${RANKING_PDF_FILES}
80 mv -f ${OUTPUT}.next.gz ${OUTPUT} ||
break
84 # this program ends its an error, always, so condor will restart it