LAL  7.5.0.1-bede9b2
Skymap.h
Go to the documentation of this file.
1 /*
2  *
3  * Copyright (C) 2008-9 Antony Searle
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 #ifndef SKYMAP_H
21 #define SKYMAP_H
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
27 #include <lal/LALDetectors.h>
28 
29 /* Manipulate log-represented values without overflowing */
30 
31 double XLALSkymapLogSumExp(double a, double b);
32 double XLALSkymapLogTotalExp(double* begin, double* end);
33 
34 /* Lightweight coordinate transformations */
35 
36 void XLALSkymapCartesianFromSpherical(double a[3], double b[2]);
37 void XLALSkymapSphericalFromCartesian(double a[2], double b[3]);
38 
39 /* Cubic interpolation */
40 
41 double XLALSkymapInterpolate(double t, double* x);
42 
43 /* Largest network of interest (needed to allocate storage) */
44 
45 #define XLALSKYMAP_N 5
46 
47 /* Use detector names from LALDetectors.h : */
48 /* LAL_TAMA_300_DETECTOR = 0 */
49 /* LAL_VIRGO_DETECTOR = 1 */
50 /* LAL_GEO_600_DETECTOR = 2 */
51 /* LAL_LHO_2K_DETECTOR = 3 */
52 /* LAL_LHO_4K_DETECTOR = 4 */
53 /* LAL_LLO_4K_DETECTOR = 5 */
54 
55 /* Struct to store basic properties of the analysis: the sample rate, and */
56 /* the detectors involved (described by their LAL ID numbers) */
57 
58 typedef struct tagXLALSkymapPlanType
59 {
61  int n;
64 
66  int sampleFrequency,
67  int n,
68  int* detectors,
69  XLALSkymapPlanType* plan
70  );
71 
72 /* Struct to store reuseable pre-computed quantities for a specific */
73 /* direction, set of detectors, and sample rate */
74 
75 typedef struct tagXLALSkymapDirectionPropertiesType
76 {
77  double f[XLALSKYMAP_N][2];
78  double delay[XLALSKYMAP_N];
80 
82  XLALSkymapPlanType* plan,
83  double direction[2],
85  );
86 
87 /* Struct to store reuseable pre-computed kernel for a specific direction, */
88 /* power spectra, and sample rate */
89 
90 typedef struct tagXLALSkymapKernelType
91 {
95 
97  XLALSkymapPlanType* plan,
99  double* wSw,
100  XLALSkymapKernelType* kernel
101  );
102 
104  XLALSkymapPlanType* plan,
106  double* wSw,
107  double* error,
108  XLALSkymapKernelType* kernel
109  );
110 
111 /* Compute the Bayesian marginalization integral for the specified system */
112 
113 void XLALSkymapApply(
114  XLALSkymapPlanType* plan,
116  XLALSkymapKernelType* kernel,
117  double** xSw,
118  double tau,
119  double* logPosterior
120  );
121 
122 #ifdef __cplusplus
123 }
124 #endif
125 
126 #endif /* SKYMAP_H */
127 
void XLALSkymapDirectionPropertiesConstruct(XLALSkymapPlanType *plan, double direction[2], XLALSkymapDirectionPropertiesType *properties)
Definition: Skymap.c:238
void XLALSkymapApply(XLALSkymapPlanType *plan, XLALSkymapDirectionPropertiesType *properties, XLALSkymapKernelType *kernel, double **xSw, double tau, double *logPosterior)
Definition: Skymap.c:408
#define XLALSKYMAP_N
Definition: Skymap.h:45
void XLALSkymapSphericalFromCartesian(double a[2], double b[3])
Definition: Skymap.c:71
void XLALSkymapUncertainKernelConstruct(XLALSkymapPlanType *plan, XLALSkymapDirectionPropertiesType *properties, double *wSw, double *error, XLALSkymapKernelType *kernel)
Definition: Skymap.c:332
double XLALSkymapLogTotalExp(double *begin, double *end)
Definition: Skymap.c:166
double XLALSkymapLogSumExp(double a, double b)
Definition: Skymap.c:124
double XLALSkymapInterpolate(double t, double *x)
Definition: Skymap.c:180
void XLALSkymapPlanConstruct(int sampleFrequency, int n, int *detectors, XLALSkymapPlanType *plan)
Definition: Skymap.c:219
void XLALSkymapKernelConstruct(XLALSkymapPlanType *plan, XLALSkymapDirectionPropertiesType *properties, double *wSw, XLALSkymapKernelType *kernel)
Definition: Skymap.c:265
void XLALSkymapCartesianFromSpherical(double a[3], double b[2])
Definition: Skymap.c:62
static REAL8TimeSeries * error(const REAL8TimeSeries *s1, const REAL8TimeSeries *s0)
static double f(double theta, double y, double xi)
Definition: XLALMarcumQ.c:258
static const INT4 a
Definition: Random.c:79
Detector structure.
Definition: LALDetectors.h:278
double logNormalization
Definition: Skymap.h:93
int sampleFrequency
Definition: Skymap.h:60
enum @4 site