LALPulsar  6.1.0.1-89842e6
LineRobustStats.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2011-2014 David Keitel
3  * Copyright (C) 2014 Reinhard Prix
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with with program; see the file COPYING. If not, write to the
17  * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
18  * MA 02110-1301 USA
19  */
20 
21 /**
22  * \defgroup LineRobustStats_h Header LineRobustStats.h
23  * \ingroup lalpulsar_LR
24  * \author David Keitel, Reinhard Prix
25  *
26  * \brief Functions to compute line-robust CW statistics
27  */
28 /** @{ */
29 
30 #ifndef _LINEROBUSTSTATS_H /* Double-include protection. */
31 #define _LINEROBUSTSTATS_H
32 
33 /* C++ protection. */
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37 
38 /*---------- exported INCLUDES ----------*/
39 
40 /* lal includes */
41 #include <lal/LALStdlib.h>
42 #include <lal/PulsarDataTypes.h>
43 #include <lal/StringVector.h>
44 #include <lal/LALConstants.h>
45 #include <math.h>
46 
47 /* additional includes */
48 typedef struct tagBSGLSetup BSGLSetup; ///< internal storage for setup and pre-computed BSGL quantities
49 
50 /*---------- exported DEFINES ----------*/
51 
52 /*---------- exported types ----------*/
53 
54 /*---------- exported Global variables ----------*/
55 
56 /*---------- exported prototypes [API] ----------*/
57 
58 BSGLSetup *
60  const REAL4 Fstar0sc,
63  const UINT4 numSegments
64  );
65 
66 void
67 XLALDestroyBSGLSetup( BSGLSetup *setup );
68 
69 int
71  const LALStringVector *oLGX_string
72  );
73 
74 // ---------- vector BSGL functions ----------
75 int
77  const REAL4 *twoF,
78  const REAL4 *twoFPerDet[PULSAR_MAX_DETECTORS],
79  const UINT4 len,
80  const BSGLSetup *setup
81  );
82 
83 int
84 XLALVectorComputeBSGLtL( REAL4 *outBSGLtL,
85  const REAL4 *twoF,
86  const REAL4 *twoFPerDet[PULSAR_MAX_DETECTORS],
87  const REAL4 *maxTwoFSegPerDet[PULSAR_MAX_DETECTORS],
88  const UINT4 len,
89  const BSGLSetup *setup
90  );
91 int
92 XLALVectorComputeBtSGLtL( REAL4 *outBtSGLtL,
93  const REAL4 *maxTwoFSeg,
94  const REAL4 *twoFPerDet[PULSAR_MAX_DETECTORS],
95  const REAL4 *maxTwoFSegPerDet[PULSAR_MAX_DETECTORS],
96  const UINT4 len,
97  const BSGLSetup *setup
98  );
99 
100 // ---------- single-bin BSGL function wrappers ----------
101 REAL4
102 XLALComputeBSGL( const REAL4 twoF,
103  const REAL4 twoFX[PULSAR_MAX_DETECTORS],
104  const BSGLSetup *setup
105  );
106 
107 REAL4
108 XLALComputeBSGLtL( const REAL4 twoF,
109  const REAL4 twoFX[PULSAR_MAX_DETECTORS],
110  const REAL4 maxtwoFXl[PULSAR_MAX_DETECTORS],
111  const BSGLSetup *setup
112  );
113 
114 REAL4
115 XLALComputeBtSGLtL( const REAL4 maxtwoFl,
116  const REAL4 twoFX[PULSAR_MAX_DETECTORS],
117  const REAL4 maxtwoFXl[PULSAR_MAX_DETECTORS],
118  const BSGLSetup *setup
119  );
120 
121 REAL4
122 XLALComputeBStSGLtL( const REAL4 twoF,
123  const REAL4 maxtwoFl,
124  const REAL4 twoFX[PULSAR_MAX_DETECTORS],
125  const REAL4 maxtwoFXl[PULSAR_MAX_DETECTORS],
126  const BSGLSetup *setup
127  );
128 
129 
130 /** @} */
131 
132 #ifdef __cplusplus
133 }
134 #endif
135 /* C++ protection. */
136 
137 #endif /* Double-include protection. */
unsigned char BOOLEAN
uint32_t UINT4
float REAL4
int XLALVectorComputeBSGLtL(REAL4 *outBSGLtL, const REAL4 *twoF, const REAL4 *twoFPerDet[PULSAR_MAX_DETECTORS], const REAL4 *maxTwoFSegPerDet[PULSAR_MAX_DETECTORS], const UINT4 len, const BSGLSetup *setup)
REAL4 XLALComputeBSGLtL(const REAL4 twoF, const REAL4 twoFX[PULSAR_MAX_DETECTORS], const REAL4 maxtwoFlX[PULSAR_MAX_DETECTORS], const BSGLSetup *setup)
Single-bin wrapper of XLALVectorComputeBSGLtL(), provided for backwards compatibility.
REAL4 XLALComputeBtSGLtL(const REAL4 maxtwoFl, const REAL4 twoFX[PULSAR_MAX_DETECTORS], const REAL4 maxtwoFXl[PULSAR_MAX_DETECTORS], const BSGLSetup *setup)
Single-bin wrapper of XLALVectorComputeBtSGLtL(), provided for backwards compatibility.
void XLALDestroyBSGLSetup(BSGLSetup *setup)
int XLALVectorComputeBSGL(REAL4 *outBSGL, const REAL4 *twoF, const REAL4 *twoFPerDet[PULSAR_MAX_DETECTORS], const UINT4 len, const BSGLSetup *setup)
REAL4 XLALComputeBStSGLtL(const REAL4 twoF, const REAL4 maxtwoFl, const REAL4 twoFX[PULSAR_MAX_DETECTORS], const REAL4 maxtwoFXl[PULSAR_MAX_DETECTORS], const BSGLSetup *setup)
BSGLSetup * XLALCreateBSGLSetup(const UINT4 numDetectors, const REAL4 Fstar0sc, const REAL4 oLGX[PULSAR_MAX_DETECTORS], const BOOLEAN useLogCorrection, const UINT4 numSegments)
REAL4 XLALComputeBSGL(const REAL4 twoF, const REAL4 twoFX[PULSAR_MAX_DETECTORS], const BSGLSetup *setup)
Single-bin wrapper of XLALVectorComputeBSGL(), provided for backwards compatibility.
int XLALParseLinePriors(REAL4 oLGX[PULSAR_MAX_DETECTORS], const LALStringVector *oLGX_string)
Parse string-vectors (typically input by user) of N per-detector line-to-Gaussian prior ratios to a ...
int XLALVectorComputeBtSGLtL(REAL4 *outBtSGLtL, const REAL4 *maxTwoFSeg, const REAL4 *twoFPerDet[PULSAR_MAX_DETECTORS], const REAL4 *maxTwoFSegPerDet[PULSAR_MAX_DETECTORS], const UINT4 len, const BSGLSetup *setup)
#define PULSAR_MAX_DETECTORS
maximal number of detectors we can handle (for static arrays of detector quantities)
internal storage for setup and pre-computed BSGL quantities
REAL4 oLGX[PULSAR_MAX_DETECTORS]
BOOLEAN useLogCorrection