Loading [MathJax]/extensions/TeX/AMSsymbols.js
LALPulsar 7.1.1.1-b246709
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
old-FstatMetric.c
Go to the documentation of this file.
1/*
2 * Copyright (C) 2006, 2013 Reinhard Prix
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with with program; see the file COPYING. If not, write to the
16 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
17 * MA 02110-1301 USA
18 */
19
20/**
21 * \file
22 * \ingroup UniversalDopplerMetric_h
23 * \author Reinhard Prix
24 * \brief
25 * The only purpose of this file is to serve as a backwards-comparison
26 * check for XLALDopplerFstatMetric(). This used to be a standalone-code
27 * 'lalapps_FstatMetric', and was XLALified and moved into the test-directory,
28 * main() was wrapped into the forwards-compatible function XLALOldDopplerFstatMetric()
29 * and called in UniversalDopplerMetricTest for comparison.
30 */
31
32/* ---------- includes ---------- */
33#include <math.h>
34
35
36#include <gsl/gsl_vector.h>
37#include <gsl/gsl_matrix.h>
38
39
40#include <lal/LALConstants.h>
41#include <lal/Date.h>
42#include <lal/LALInitBarycenter.h>
43#include <lal/AVFactories.h>
44#include <lal/SkyCoordinates.h>
45#include <lal/ComputeFstat.h>
46#include <lal/GetEarthTimes.h>
47#include <lal/SFTfileIO.h>
48
49#include <lal/ComputeFstat.h>
50#include <lal/UniversalDopplerMetric.h>
51
52/* ----- compile switches ----- */
53/* uncomment the following to turn off range-checking in GSL vector-functions */
54/* #define GSL_RANGE_CHECK_OFF 1*/
55
56/*---------- local defines ---------- */
57
58#define NUM_SPINS 2
59#define METRIC_DIM 2 + NUM_SPINS
60
61/* ----- Macros ----- */
62/** Simple Euklidean scalar product for two 3-dim vectors in cartesian coords */
63#define SCALAR(u,v) ((u)[0]*(v)[0] + (u)[1]*(v)[1] + (u)[2]*(v)[2])
64
65/** copy 3 components of Euklidean vector */
66#define COPY_VECT(dst,src) do { (dst)[0] = (src)[0]; (dst)[1] = (src)[1]; (dst)[2] = (src)[2]; } while(0)
67
68#define SQ(x) ((x) * (x))
69
70/* ---------- local types ---------- */
71typedef enum {
72 OLDMETRIC_TYPE_PHASE = 0, /**< compute phase metric only */
73 OLDMETRIC_TYPE_FSTAT = 1, /**< compute full F-metric only */
74 OLDMETRIC_TYPE_ALL = 2, /**< compute both F-metric and phase-metric */
77
78typedef struct tagOldDopplerMetric {
79 DopplerMetricParams meta; /**< "meta-info" describing/specifying the type of Doppler metric */
80
81 gsl_matrix *g_ij; /**< symmetric matrix holding the phase-metric, averaged over segments */
82 gsl_matrix *g_ij_seg; /**< the phase-metric for each segment, concatenated by column: [g_ij_1, g_ij_2, ...] */
83
84 gsl_matrix *gF_ij; /**< full F-statistic metric gF_ij, including antenna-pattern effects (see \cite Prix07) */
85 gsl_matrix *gFav_ij; /**< 'average' Fstat-metric */
86 gsl_matrix *m1_ij, *m2_ij, *m3_ij; /**< Fstat-metric sub components */
87
88 gsl_matrix *Fisher_ab; /**< Full 4+n dimensional Fisher matrix, ie amplitude + Doppler space */
89
90 double maxrelerr_gPh; /**< estimate for largest relative error in phase-metric component integrations */
91 double maxrelerr_gF; /**< estimate for largest relative error in Fmetric component integrations */
92
93 REAL8 rho2; /**< signal SNR rho^2 = A^mu M_mu_nu A^nu */
95
96typedef enum {
104
105/** a 'point' in the "Doppler parameter space" {alpha, delta, fkdot } */
106typedef struct {
110
111typedef struct {
117
118typedef struct {
119 UINT4 length; /**< number of IFOs */
120 PhaseDerivs **data; /**< phase-derivs array */
122
123typedef struct {
125 REAL8 vel[3];
126} PosVel_t;
127
128typedef struct {
129 const EphemerisData *edat; /**< ephemeris data (from XLALInitBarycenter()) */
130 LIGOTimeGPS startTime; /**< start time of observation */
131 LIGOTimeGPS refTime; /**< reference time for spin-parameters */
132 DopplerPoint dopplerPoint; /**< sky-position and spins */
133 MultiDetectorStateSeries *multiDetStates;/**< pos, vel and LMSTs for detector at times t_i */
134 MultiAMCoeffs *multiAMcoe; /**< Amplitude Modulation coefficients a,b(t)*/
135 MultiPhaseDerivs *multidPhi; /**< Phase-derivatives d_i phi(t) */
136 REAL8Vector *GLweights; /**< Gauss-Legendre Integration-weights */
137 MultiNoiseWeights *multiNoiseWeights; /**< noise-weights for the different IFOs */
138 REAL8 Al1, Al2, Al3; /**< amplitude factors alpha1, alpha2, alpha3 */
139 REAL8 Ad, Bd, Cd, Dd;
142
143/* ---------- global variables ----------*/
144
145/* ---------- local prototypes ---------- */
146int InitCode( ConfigVariables *cfg, const DopplerMetricParams *metricParams, const EphemerisData *edat );
148
149int computeFstatMetric( gsl_matrix *gF_ij, gsl_matrix *gFav_ij,
150 gsl_matrix *m1_ij, gsl_matrix *m2_ij, gsl_matrix *m3_ij,
151 ConfigVariables *cfg );
152
153int computePhaseMetric( gsl_matrix *g_ij, const PhaseDerivs *dphi, const REAL8Vector *GLweights );
154
155int project_metric( gsl_matrix *ret_ij, gsl_matrix *g_ij, const UINT4 coordinate );
156int outer_product( gsl_matrix *ret_ij, const gsl_vector *u_i, const gsl_vector *v_j );
157int symmetrize( gsl_matrix *mat );
158REAL8 quad_form( const gsl_matrix *mat, const gsl_vector *vec );
159
160
161void getPtolePosVel( PosVel_t *posvel, REAL8 tGPS, REAL8 tAutumn );
162
164
165void gauleg( double x1, double x2, double x[], double w[], int n );
166
169int XLALAddOldDopplerMetric( OldDopplerMetric **metric1, const OldDopplerMetric *metric2 );
171
172/*============================================================
173 * FUNCTION definitions
174 *============================================================*/
175
176/**
177 * The only purpose of this function is to serve as a backwards-comparison
178 * check for XLALDopplerFstatMetric(). This is why it has been moved
179 * into the test-directory
180 *
181 * This is basically a wrapper of the 'main()' function from the old
182 * standalone 'lalapps_FstatMetric' code, providing an API compatible
183 * with XLALDopplerFstatMetric().
184 *
185 */
187XLALOldDopplerFstatMetric( const OldMetricType_t metricType, /**< type of metric to compute */
188 const DopplerMetricParams *metricParams, /**< input parameters determining the metric calculation */
189 const EphemerisData *edat /**< ephemeris data */
190 )
191{
192 XLAL_CHECK_NULL( metricParams != NULL, XLAL_EINVAL );
193 XLAL_CHECK_NULL( edat != NULL, XLAL_EINVAL );
194
196 UINT4 Nseg = metricParams->segmentList.length;
197 XLAL_CHECK_NULL( Nseg == 1, XLAL_EINVAL, "Segment list must only contain Nseg=1 segments, got Nseg=%d", Nseg );
198
200
201 const DopplerCoordinateSystem *coordSys = &( metricParams->coordSys );
202 XLAL_CHECK_NULL( coordSys->dim == METRIC_DIM, XLAL_EINVAL );
207
209 XLAL_CHECK_NULL( ( metric = XLALCalloc( 1, sizeof( *metric ) ) ) != NULL, XLAL_ENOMEM );
210
212
213 /* basic setup and initializations */
214 metric->gF_ij = gsl_matrix_calloc( METRIC_DIM, METRIC_DIM );
215 metric->gFav_ij = gsl_matrix_calloc( METRIC_DIM, METRIC_DIM );
216 metric->m1_ij = gsl_matrix_calloc( METRIC_DIM, METRIC_DIM );
217 metric->m2_ij = gsl_matrix_calloc( METRIC_DIM, METRIC_DIM );
218 metric->m3_ij = gsl_matrix_calloc( METRIC_DIM, METRIC_DIM );
219 metric->g_ij = gsl_matrix_calloc( METRIC_DIM, METRIC_DIM );
220
221 XLAL_CHECK_NULL( InitCode( &config, metricParams, edat ) == XLAL_SUCCESS, XLAL_EFUNC );
222
223 /* ----- compute phase derivatives ----- */
224 config.multidPhi = getMultiPhaseDerivs( config.multiDetStates, &( config.dopplerPoint ), config.phaseType );
225 XLAL_CHECK_NULL( config.multidPhi != NULL, XLAL_EFUNC, "getMultiPhaseDerivs() failed.\n" );
226
227 if ( ( metricType == OLDMETRIC_TYPE_FSTAT ) || ( metricType == OLDMETRIC_TYPE_ALL ) ) {
228 XLAL_CHECK_NULL( computeFstatMetric( metric->gF_ij, metric->gFav_ij, metric->m1_ij, metric->m2_ij, metric->m3_ij, &config ) == XLAL_SUCCESS, XLAL_EFUNC );
229 }
230 if ( ( metricType == OLDMETRIC_TYPE_PHASE ) || ( metricType == OLDMETRIC_TYPE_ALL ) ) {
231 XLAL_CHECK_NULL( config.multidPhi->length == 1, XLAL_EFAILED, "%s: computePhaseMetric() can only handle a single detector!", __func__ );
232 XLAL_CHECK_NULL( computePhaseMetric( metric->g_ij, config.multidPhi->data[0], config.GLweights ) == XLAL_SUCCESS, XLAL_EFUNC );
233 } // endif metricType==PHASE || ALL
234
235 // ----- Free internal memory
236 XLALDestroyMultiPhaseDerivs( config.multidPhi );
237 XLALDestroyMultiAMCoeffs( config.multiAMcoe );
238 XLALDestroyMultiDetectorStateSeries( config.multiDetStates );
239 XLALDestroyREAL8Vector( config.GLweights );
240 for ( UINT4 X = 0; X < config.multiNoiseWeights->length; X++ ) {
241 XLALDestroyREAL8Vector( config.multiNoiseWeights->data[X] );
242 }
243 XLALFree( config.multiNoiseWeights->data );
244 XLALFree( config.multiNoiseWeights );
245 XLALDestroyREAL8Vector( config.dopplerPoint.fkdot );
246
247 return metric;
248
249} /* XLALOldDopplerFstatMetric() */
250
251
252/** Free a OldDopplerMetric structure */
253void
255{
256 if ( !metric ) {
257 return;
258 }
259
260 if ( metric->g_ij ) {
261 gsl_matrix_free( metric->g_ij );
262 }
263 if ( metric->gF_ij ) {
264 gsl_matrix_free( metric->gF_ij );
265 }
266 if ( metric->gFav_ij ) {
267 gsl_matrix_free( metric->gFav_ij );
268 }
269 if ( metric->m1_ij ) {
270 gsl_matrix_free( metric->m1_ij );
271 }
272 if ( metric->m2_ij ) {
273 gsl_matrix_free( metric->m2_ij );
274 }
275 if ( metric->m3_ij ) {
276 gsl_matrix_free( metric->m3_ij );
277 }
278 if ( metric->Fisher_ab ) {
279 gsl_matrix_free( metric->Fisher_ab );
280 }
281
282 XLALFree( metric );
283
284 return;
285
286} /* XLALDestroyOldDopplerMetric() */
287
288
289/**
290 * Add 'metric2' to 'metric1', by adding the matrixes and 'rho2', and adding error-estimates in quadrature.
291 *
292 * Note1: if the '*metric1 == NULL', then it is initialized to the values
293 * in 'metric2'. The elements are *copied* and the result is allocated here.
294 *
295 * Note2: the 'meta' field-information of 'metric2' is simply copied into the output,
296 * meta-info consistency is *not* checked.
297 */
298int
300{
301 XLAL_CHECK( metric1, XLAL_EINVAL, "Invalid NULL input 'metric1'\n" );
302 XLAL_CHECK( metric2, XLAL_EINVAL, "Invalid NULL input 'metric2'\n" );
303
304 OldDopplerMetric *m1 = ( *metric1 );
305 const OldDopplerMetric *m2 = metric2;
306
307 if ( m1 == NULL ) { // create new empty matrices for those that exist in 'metric2'
308 int len, len1, len2;
309 XLAL_CHECK( ( m1 = XLALCalloc( 1, len = sizeof( *m1 ) ) ) != NULL, XLAL_ENOMEM, "Failed to XLALCalloc(1,%d)\n", len );
310
311 if ( m2->g_ij ) {
312 XLAL_CHECK( ( m1->g_ij = gsl_matrix_calloc( len1 = m2->g_ij->size1, len2 = m2->g_ij->size2 ) ), XLAL_ENOMEM, "Failed: g_ij = gsl_matrix_calloc(%d,%d)\n", len1, len2 );
313 }
314 if ( m2->gF_ij ) {
315 XLAL_CHECK( ( m1->gF_ij = gsl_matrix_calloc( len1 = m2->gF_ij->size1, len2 = m2->gF_ij->size2 ) ), XLAL_ENOMEM, "Failed: gF_ij = gsl_matrix_calloc(%d,%d)\n", len1, len2 );
316 }
317 if ( m2->gFav_ij ) {
318 XLAL_CHECK( ( m1->gFav_ij = gsl_matrix_calloc( len1 = m2->gFav_ij->size1, len2 = m2->gFav_ij->size2 ) ), XLAL_ENOMEM, "Failed: gFav_ij = gsl_matrix_calloc(%d,%d)\n", len1, len2 );
319 }
320 if ( m2->m1_ij ) {
321 XLAL_CHECK( ( m1->m1_ij = gsl_matrix_calloc( len1 = m2->m1_ij->size1, len2 = m2->m1_ij->size2 ) ), XLAL_ENOMEM, "Failed: m1_ij = gsl_matrix_calloc(%d,%d)\n", len1, len2 );
322 }
323 if ( m2->m2_ij ) {
324 XLAL_CHECK( ( m1->m2_ij = gsl_matrix_calloc( len1 = m2->m2_ij->size1, len2 = m2->m2_ij->size2 ) ), XLAL_ENOMEM, "Failed: m2_ij = gsl_matrix_calloc(%d,%d)\n", len1, len2 );
325 }
326 if ( m2->m3_ij ) {
327 XLAL_CHECK( ( m1->m3_ij = gsl_matrix_calloc( len1 = m2->m3_ij->size1, len2 = m2->m3_ij->size2 ) ), XLAL_ENOMEM, "Failed: m3_ij = gsl_matrix_calloc(%d,%d)\n", len1, len2 );
328 }
329 if ( m2->Fisher_ab ) {
330 XLAL_CHECK( ( m1->Fisher_ab = gsl_matrix_calloc( len1 = m2->Fisher_ab->size1, len2 = m2->Fisher_ab->size2 ) ), XLAL_ENOMEM, "Failed: Fisher_ab = gsl_matrix_calloc(%d,%d)\n", len1, len2 );
331 }
332
333 ( *metric1 ) = m1;
334 } // if *metric1==NULL
335
336 // copy meta-information from m2 into m1
337 memcpy( &( m1->meta ), &( m2->meta ), sizeof( m1->meta ) );
338
339 int ret;
340 // add existing matrices
341 if ( m2->g_ij ) {
342 XLAL_CHECK( ( ret = gsl_matrix_add( m1->g_ij, m2->g_ij ) ) == 0, XLAL_EFAILED, "g_ij: gsl_matrix_add() failed with status=%d\n", ret );
343 }
344 if ( m2->gF_ij ) {
345 XLAL_CHECK( ( ret = gsl_matrix_add( m1->gF_ij, m2->gF_ij ) ) == 0, XLAL_EFAILED, "gF_ij: gsl_matrix_add() failed with status=%d\n", ret );
346 }
347 if ( m2->gFav_ij ) {
348 XLAL_CHECK( ( ret = gsl_matrix_add( m1->gFav_ij, m2->gFav_ij ) ) == 0, XLAL_EFAILED, "gFav_ij: gsl_matrix_add() failed with status=%d\n", ret );
349 }
350 if ( m2->m1_ij ) {
351 XLAL_CHECK( ( ret = gsl_matrix_add( m1->m1_ij, m2->m1_ij ) ) == 0, XLAL_EFAILED, "m1_ij: gsl_matrix_add() failed with status=%d\n", ret );
352 }
353 if ( m2->m2_ij ) {
354 XLAL_CHECK( ( ret = gsl_matrix_add( m1->m2_ij, m2->m2_ij ) ) == 0, XLAL_EFAILED, "m2_ij: gsl_matrix_add() failed with status=%d\n", ret );
355 }
356 if ( m2->m3_ij ) {
357 XLAL_CHECK( ( ret = gsl_matrix_add( m1->m3_ij, m2->m3_ij ) ) == 0, XLAL_EFAILED, "m3_ij: gsl_matrix_add() failed with status=%d\n", ret );
358 }
359 if ( m2->Fisher_ab ) {
360 XLAL_CHECK( ( ret = gsl_matrix_add( m1->Fisher_ab, m2->Fisher_ab ) ) == 0, XLAL_EFAILED, "Fisher_ab: gsl_matrix_add() failed with status=%d\n", ret );
361 }
362
363 // add errors in quadrature
364 m1->maxrelerr_gPh = sqrt( SQ( m1->maxrelerr_gPh ) + SQ( m2->maxrelerr_gPh ) );
365 m1->maxrelerr_gF = sqrt( SQ( m1->maxrelerr_gF ) + SQ( m2->maxrelerr_gF ) );
366
367 // add SNR^2
368 m1->rho2 += m2->rho2;
369
370 return XLAL_SUCCESS;
371
372} /* XLALAddOldDopplerMetric() */
373
374/**
375 * Scale all (existing) matrices, error-estimates and 'rho2' by 'scale'
376 */
377int
379{
380 XLAL_CHECK( m != NULL, XLAL_EINVAL, "Invalid NULL input 'metric'\n" );
381
382 int ret;
383 // scale all existing matrices
384 if ( m->g_ij ) {
385 XLAL_CHECK( ( ret = gsl_matrix_scale( m->g_ij, scale ) ) == 0, XLAL_EFAILED, "g_ij: gsl_matrix_scale(%g) failed with status=%d\n", scale, ret );
386 }
387 if ( m->gF_ij ) {
388 XLAL_CHECK( ( ret = gsl_matrix_scale( m->gF_ij, scale ) ) == 0, XLAL_EFAILED, "gF_ij: gsl_matrix_scale(%g) failed with status=%d\n", scale, ret );
389 }
390 if ( m->gFav_ij ) {
391 XLAL_CHECK( ( ret = gsl_matrix_scale( m->gFav_ij, scale ) ) == 0, XLAL_EFAILED, "gFav_ij: gsl_matrix_scale(%g) failed with status=%d\n", scale, ret );
392 }
393 if ( m->m1_ij ) {
394 XLAL_CHECK( ( ret = gsl_matrix_scale( m->m1_ij, scale ) ) == 0, XLAL_EFAILED, "m1_ij: gsl_matrix_scale(%g) failed with status=%d\n", scale, ret );
395 }
396 if ( m->m2_ij ) {
397 XLAL_CHECK( ( ret = gsl_matrix_scale( m->m2_ij, scale ) ) == 0, XLAL_EFAILED, "m2_ij: gsl_matrix_scale(%g) failed with status=%d\n", scale, ret );
398 }
399 if ( m->m3_ij ) {
400 XLAL_CHECK( ( ret = gsl_matrix_scale( m->m3_ij, scale ) ) == 0, XLAL_EFAILED, "m3_ij: gsl_matrix_scale(%g) failed with status=%d\n", scale, ret );
401 }
402 if ( m->Fisher_ab ) {
403 XLAL_CHECK( ( ret = gsl_matrix_scale( m->Fisher_ab, scale ) ) == 0, XLAL_EFAILED, "Fisher_ab: gsl_matrix_scale(%g) failed with status=%d\n", scale, ret );
404 }
405
406 // scale errors
407 m->maxrelerr_gPh *= scale;
408 m->maxrelerr_gF *= scale;
409
410 // scale SNR^2
411 m->rho2 *= scale;
412
413 return XLAL_SUCCESS;
414
415} /* XLALScaleOldDopplerMetric() */
416
417
418/* calculate Fstat-metric components m1_ij, m2_ij, m3_ij, and metrics gF_ij, gFav_ij,
419 * which must be allocated 4x4 matrices.
420 *
421 * Return 0 = OK, -1 on error.
422 */
423int
424computeFstatMetric( gsl_matrix *gF_ij, gsl_matrix *gFav_ij,
425 gsl_matrix *m1_ij, gsl_matrix *m2_ij, gsl_matrix *m3_ij,
426 ConfigVariables *cfg )
427{
428 UINT4 i;
429 REAL8 AMA;
430
431 gsl_matrix *P1_ij, *P2_ij, *P3_ij;
432 gsl_vector *a2_dPhi_i, *b2_dPhi_i, *ab_dPhi_i;
433
434 gsl_matrix *Q1_ij, *Q2_ij, *Q3_ij;
435
436 gsl_vector *dPhi_i;
437 gsl_matrix *mat1, *mat2;
438 gsl_vector *vec;
439
440 gsl_matrix *a2_a2, *a2_b2, *a2_ab;
441 gsl_matrix *b2_b2, *b2_ab;
442 gsl_matrix *ab_ab;
443
444 /* ----- check input ----- */
445 XLAL_CHECK( cfg != NULL, XLAL_EINVAL );
447
448 XLAL_CHECK( ( gF_ij != NULL ) && ( gFav_ij != NULL ) && ( m1_ij != NULL ) && ( m2_ij != NULL ) && ( m3_ij != NULL ), XLAL_EINVAL );
449
450 XLAL_CHECK( ( gF_ij->size1 == gF_ij->size2 ) && ( gF_ij->size1 == METRIC_DIM ), XLAL_EINVAL );
451 XLAL_CHECK( ( gFav_ij->size1 == gFav_ij->size2 ) && ( gFav_ij->size1 == METRIC_DIM ), XLAL_EINVAL );
452 XLAL_CHECK( ( m1_ij->size1 == m1_ij->size2 ) && ( m1_ij->size1 == METRIC_DIM ), XLAL_EINVAL );
453 XLAL_CHECK( ( m2_ij->size1 == m2_ij->size2 ) && ( m2_ij->size1 == METRIC_DIM ), XLAL_EINVAL );
454 XLAL_CHECK( ( m3_ij->size1 == m3_ij->size2 ) && ( m3_ij->size1 == METRIC_DIM ), XLAL_EINVAL );
455
458
459 /* ----- allocate matrices/vectors ----- */
460 dPhi_i = gsl_vector_calloc( METRIC_DIM );
461
462 mat1 = gsl_matrix_calloc( METRIC_DIM, METRIC_DIM );
463 mat2 = gsl_matrix_calloc( METRIC_DIM, METRIC_DIM );
464 vec = gsl_vector_calloc( METRIC_DIM );
465
466 P1_ij = gsl_matrix_calloc( METRIC_DIM, METRIC_DIM );
467 P2_ij = gsl_matrix_calloc( METRIC_DIM, METRIC_DIM );
468 P3_ij = gsl_matrix_calloc( METRIC_DIM, METRIC_DIM );
469
470 a2_dPhi_i = gsl_vector_calloc( METRIC_DIM );
471 b2_dPhi_i = gsl_vector_calloc( METRIC_DIM );
472 ab_dPhi_i = gsl_vector_calloc( METRIC_DIM );
473
474 Q1_ij = gsl_matrix_calloc( METRIC_DIM, METRIC_DIM );
475 Q2_ij = gsl_matrix_calloc( METRIC_DIM, METRIC_DIM );
476 Q3_ij = gsl_matrix_calloc( METRIC_DIM, METRIC_DIM );
477
478 a2_a2 = gsl_matrix_calloc( METRIC_DIM, METRIC_DIM );
479 a2_b2 = gsl_matrix_calloc( METRIC_DIM, METRIC_DIM );
480 a2_ab = gsl_matrix_calloc( METRIC_DIM, METRIC_DIM );
481
482 b2_b2 = gsl_matrix_calloc( METRIC_DIM, METRIC_DIM );
483 b2_ab = gsl_matrix_calloc( METRIC_DIM, METRIC_DIM );
484
485 ab_ab = gsl_matrix_calloc( METRIC_DIM, METRIC_DIM );
486
487 /* ----- calculate averages ----- */
488 REAL8 A = 0, B = 0, C = 0;
489 for ( UINT4 X = 0; X < numDet; X ++ ) {
490 UINT4 numSteps = cfg->multiDetStates->data[X]->length;
491 AMCoeffs *amcoe = cfg->multiAMcoe->data[X];
492 PhaseDerivs *dPhi = cfg->multidPhi->data[X];
493 gsl_matrix *P1_Xij, *P2_Xij, *P3_Xij;
494 gsl_vector *a2_dPhi_Xi, *b2_dPhi_Xi, *ab_dPhi_Xi;
495
496 P1_Xij = gsl_matrix_calloc( METRIC_DIM, METRIC_DIM );
497 P2_Xij = gsl_matrix_calloc( METRIC_DIM, METRIC_DIM );
498 P3_Xij = gsl_matrix_calloc( METRIC_DIM, METRIC_DIM );
499
500 a2_dPhi_Xi = gsl_vector_calloc( METRIC_DIM );
501 b2_dPhi_Xi = gsl_vector_calloc( METRIC_DIM );
502 ab_dPhi_Xi = gsl_vector_calloc( METRIC_DIM );
503
504 for ( i = 0; i < numSteps; i ++ ) {
505 REAL8 a = amcoe->a->data[i];
506 REAL8 b = amcoe->b->data[i];
507 REAL8 a2 = SQ( a );
508 REAL8 b2 = SQ( b );
509 REAL8 ab = a * b;
510
511 A += a2;
512 B += b2;
513 C += ab;
514
515 gsl_vector_set( dPhi_i, 0, dPhi->dFreq->data[i] );
516 gsl_vector_set( dPhi_i, 1, dPhi->dAlpha->data[i] );
517 gsl_vector_set( dPhi_i, 2, dPhi->dDelta->data[i] );
518 gsl_vector_set( dPhi_i, 3, dPhi->df1dot->data[i] );
519
520 outer_product( mat1, dPhi_i, dPhi_i );
521
522 /* ----- P1_ij ----- */
523 gsl_matrix_memcpy( mat2, mat1 );
524 gsl_matrix_scale( mat2, a2 );
525 gsl_matrix_add( P1_Xij, mat2 );
526
527 /* ----- P2_ij ----- */
528 gsl_matrix_memcpy( mat2, mat1 );
529 gsl_matrix_scale( mat2, b2 );
530 gsl_matrix_add( P2_Xij, mat2 );
531
532 /* ----- P3_ij ----- */
533 gsl_matrix_memcpy( mat2, mat1 );
534 gsl_matrix_scale( mat2, ab );
535 gsl_matrix_add( P3_Xij, mat2 );
536
537 /* ----- a2_dPhi_i ----- */
538 gsl_vector_memcpy( vec, dPhi_i );
539 gsl_vector_scale( vec, a2 );
540 gsl_vector_add( a2_dPhi_Xi, vec );
541
542 /* ----- b2_dPhi_i ----- */
543 gsl_vector_memcpy( vec, dPhi_i );
544 gsl_vector_scale( vec, b2 );
545 gsl_vector_add( b2_dPhi_Xi, vec );
546
547 /* ----- ab_dPhi_i ----- */
548 gsl_vector_memcpy( vec, dPhi_i );
549 gsl_vector_scale( vec, ab );
550 gsl_vector_add( ab_dPhi_Xi, vec );
551
552 } /* for i < numSteps */
553
554 gsl_matrix_add( P1_ij, P1_Xij );
555 gsl_matrix_add( P2_ij, P2_Xij );
556 gsl_matrix_add( P3_ij, P3_Xij );
557
558 gsl_vector_add( a2_dPhi_i, a2_dPhi_Xi );
559
560 gsl_vector_add( b2_dPhi_i, b2_dPhi_Xi );
561
562 gsl_vector_add( ab_dPhi_i, ab_dPhi_Xi );
563
564 gsl_matrix_free( P1_Xij );
565 gsl_matrix_free( P2_Xij );
566 gsl_matrix_free( P3_Xij );
567
568 gsl_vector_free( a2_dPhi_Xi );
569 gsl_vector_free( b2_dPhi_Xi );
570 gsl_vector_free( ab_dPhi_Xi );
571
572 } /* for X < numDet */
573
574 /* ---------- composite quantities ---------- */
575 REAL8 D = A * B - C * C;
576 cfg->Ad = A;
577 cfg->Bd = B;
578 cfg->Cd = C;
579 cfg->Dd = D;
580
581 outer_product( a2_a2, a2_dPhi_i, a2_dPhi_i );
582 outer_product( a2_b2, a2_dPhi_i, b2_dPhi_i );
583 outer_product( a2_ab, a2_dPhi_i, ab_dPhi_i );
584
585 outer_product( b2_b2, b2_dPhi_i, b2_dPhi_i );
586 outer_product( b2_ab, b2_dPhi_i, ab_dPhi_i );
587
588 outer_product( ab_ab, ab_dPhi_i, ab_dPhi_i );
589
590 /* ----- Q1_ij ----- */
591 gsl_matrix_memcpy( mat1, ab_ab );
592 gsl_matrix_scale( mat1, A / D );
593 gsl_matrix_memcpy( Q1_ij, mat1 ); /* = (A/D)<ab_dPhi_i><ab_dPhi_j> */
594
595 gsl_matrix_memcpy( mat1, a2_a2 );
596 gsl_matrix_scale( mat1, B / D );
597 gsl_matrix_add( Q1_ij, mat1 ); /* + (B/D)<a2_dPhi_i><a2_dPhi_j> */
598
599 gsl_matrix_memcpy( mat1, a2_ab );
600 gsl_matrix_scale( mat1, - 2.0 * C / D );
601 gsl_matrix_add( Q1_ij, mat1 ); /* -2(C/D)<a2_dPhi_i><ab_dPhi_j> */
602
603 symmetrize( Q1_ij ); /* (i,j) */
604
605 /* ----- Q2_ij ----- */
606 gsl_matrix_memcpy( mat1, b2_b2 );
607 gsl_matrix_scale( mat1, A / D );
608 gsl_matrix_memcpy( Q2_ij, mat1 ); /* = (A/D)<b2_dPhi_i><b2_dPhi_j> */
609
610 gsl_matrix_memcpy( mat1, ab_ab );
611 gsl_matrix_scale( mat1, B / D );
612 gsl_matrix_add( Q2_ij, mat1 ); /* + (B/D)<ab_dPhi_i><ab_dPhi_j> */
613
614 gsl_matrix_memcpy( mat1, b2_ab );
615 gsl_matrix_scale( mat1, - 2.0 * C / D );
616 gsl_matrix_add( Q2_ij, mat1 ); /* -2(C/D)<b2_dPhi_i><ab_dPhi_j> */
617
618 symmetrize( Q2_ij ); /* (i,j) */
619
620 /* ----- Q3_ij ----- */
621 gsl_matrix_memcpy( mat1, b2_ab );
622 gsl_matrix_scale( mat1, A / D );
623 gsl_matrix_memcpy( Q3_ij, mat1 ); /* = (A/D)<b2_dPhi_i><ab_dPhi_j> */
624
625 gsl_matrix_memcpy( mat1, a2_ab );
626 gsl_matrix_scale( mat1, B / D );
627 gsl_matrix_add( Q3_ij, mat1 ); /* + (B/D)<a2_dPhi_i><ab_dPhi_j> */
628
629 gsl_matrix_memcpy( mat1, a2_b2 );
630 gsl_matrix_add( mat1, ab_ab );
631 gsl_matrix_scale( mat1, - 1.0 * C / D );
632 gsl_matrix_add( Q3_ij, mat1 ); /* -(C/D)(<a2_dPhi_i><b2_dPhi_j> + <ab_dPhi_i><ab_dPhi_j>)*/
633
634 symmetrize( Q3_ij ); /* (i,j) */
635
636 /* ===== final matrics: m1_ij, m2_ij, m3_ij ===== */
637 gsl_matrix_memcpy( m1_ij, P1_ij );
638 gsl_matrix_sub( m1_ij, Q1_ij );
639
640 gsl_matrix_memcpy( m2_ij, P2_ij );
641 gsl_matrix_sub( m2_ij, Q2_ij );
642
643 gsl_matrix_memcpy( m3_ij, P3_ij );
644 gsl_matrix_sub( m3_ij, Q3_ij );
645
646
647 /* ===== full F-metric gF_ij */
648 AMA = A * cfg->Al1 + B * cfg->Al2 + 2.0 * C * cfg->Al3;
649
650 gsl_matrix_memcpy( gF_ij, m1_ij );
651 gsl_matrix_scale( gF_ij, cfg->Al1 ); /* alpha1 m^1_ij */
652
653 gsl_matrix_memcpy( mat1, m2_ij );
654 gsl_matrix_scale( mat1, cfg->Al2 );
655 gsl_matrix_add( gF_ij, mat1 ); /* + alpha2 m^2_ij */
656
657 gsl_matrix_memcpy( mat1, m3_ij );
658 gsl_matrix_scale( mat1, 2.0 * cfg->Al3 );
659 gsl_matrix_add( gF_ij, mat1 ); /* + 2 * alpha3 m^3_ij */
660
661 gsl_matrix_scale( gF_ij, 1.0 / AMA );
662
663 /* ===== averaged F-metric gFav_ij */
664 gsl_matrix_memcpy( gFav_ij, m1_ij );
665 gsl_matrix_scale( gFav_ij, B ); /* B m^1_ij */
666
667 gsl_matrix_memcpy( mat1, m2_ij );
668 gsl_matrix_scale( mat1, A );
669 gsl_matrix_add( gFav_ij, mat1 ); /* + A m^2_ij */
670
671 gsl_matrix_memcpy( mat1, m3_ij );
672 gsl_matrix_scale( mat1, - 2.0 * C );
673 gsl_matrix_add( gFav_ij, mat1 ); /* - 2C m^3_ij */
674
675 gsl_matrix_scale( gFav_ij, 1.0 / ( 2.0 * D ) ); /* 1/ (2D) */
676
677
678 /* ----- free memory ----- */
679 gsl_vector_free( dPhi_i );
680
681 gsl_matrix_free( mat1 );
682 gsl_matrix_free( mat2 );
683 gsl_vector_free( vec );
684
685 gsl_matrix_free( P1_ij );
686 gsl_matrix_free( P2_ij );
687 gsl_matrix_free( P3_ij );
688
689 gsl_vector_free( a2_dPhi_i );
690 gsl_vector_free( b2_dPhi_i );
691 gsl_vector_free( ab_dPhi_i );
692
693 gsl_matrix_free( Q1_ij );
694 gsl_matrix_free( Q2_ij );
695 gsl_matrix_free( Q3_ij );
696
697 gsl_matrix_free( a2_a2 );
698 gsl_matrix_free( a2_b2 );
699 gsl_matrix_free( a2_ab );
700
701 gsl_matrix_free( b2_b2 );
702 gsl_matrix_free( b2_ab );
703
704 gsl_matrix_free( ab_ab );
705
706
707 return 0;
708
709} /* computeFstatMetric() */
710
711/* calculate pure Phase-metric gij, which must be allocated 4x4 matrix.
712 *
713 * Return 0 = OK, -1 on error.
714 */
715int
716computePhaseMetric( gsl_matrix *g_ij, const PhaseDerivs *dPhi, const REAL8Vector *GLweights )
717{
718 UINT4 i;
719 UINT4 numSteps = GLweights->length;
720
721 gsl_vector *dPhi_i;
722 gsl_matrix *dPhi_i_dPhi_j;
723
724 gsl_matrix *aPhi_ij;
725 gsl_vector *aPhi_i;
726 gsl_matrix *aPhi_i_aPhi_j;
727
728 /* ----- check input ----- */
729 if ( !g_ij ) {
730 return -1;
731 }
732
733 if ( ( g_ij->size1 != METRIC_DIM ) || ( g_ij->size2 != METRIC_DIM ) ) {
734 return -1;
735 }
736
737 if ( dPhi->dAlpha->length != numSteps ) {
738 return -1;
739 }
740
741 /* ----- allocate matrices/vectors ----- */
742 dPhi_i = gsl_vector_calloc( METRIC_DIM );
743 dPhi_i_dPhi_j = gsl_matrix_calloc( METRIC_DIM, METRIC_DIM );
744
745 aPhi_i = gsl_vector_calloc( METRIC_DIM );
746 aPhi_ij = gsl_matrix_calloc( METRIC_DIM, METRIC_DIM );
747 aPhi_i_aPhi_j = gsl_matrix_calloc( METRIC_DIM, METRIC_DIM );
748
749 /* ----- calculate averages using Gauss-Legendre integration ----- */
750 for ( i = 0; i < numSteps; i ++ ) {
751 REAL8 wi = GLweights->data[i];
752 gsl_vector_set( dPhi_i, 0, dPhi->dFreq->data[i] );
753 gsl_vector_set( dPhi_i, 1, dPhi->dAlpha->data[i] );
754 gsl_vector_set( dPhi_i, 2, dPhi->dDelta->data[i] );
755 gsl_vector_set( dPhi_i, 3, dPhi->df1dot->data[i] );
756
757 outer_product( dPhi_i_dPhi_j, dPhi_i, dPhi_i );
758
759 /* Gauss-Legendre integration: weighted sum */
760 gsl_vector_scale( dPhi_i, wi );
761 gsl_matrix_scale( dPhi_i_dPhi_j, wi );
762
763 /* ----- av_dPhi_i ----- */
764 gsl_vector_add( aPhi_i, dPhi_i );
765
766 /* ----- av_dPhi_i_dPhi_j ----- */
767 gsl_matrix_add( aPhi_ij, dPhi_i_dPhi_j );
768
769 } /* for i < numSteps */
770
771 /* ---------- composite quantities ---------- */
772 outer_product( aPhi_i_aPhi_j, aPhi_i, aPhi_i );
773
774 /* ===== final answer: m1_ij, m2_ij, m3_ij ===== */
775 gsl_matrix_memcpy( g_ij, aPhi_ij );
776 gsl_matrix_sub( g_ij, aPhi_i_aPhi_j );
777
778 /* ----- free memory ----- */
779 gsl_vector_free( dPhi_i );
780 gsl_matrix_free( dPhi_i_dPhi_j );
781 gsl_matrix_free( aPhi_ij );
782 gsl_vector_free( aPhi_i );
783 gsl_matrix_free( aPhi_i_aPhi_j );
784
785 return 0;
786
787} /* computePhaseMetric() */
788
789/**
790 * basic initializations: set-up 'ConfigVariables'
791 * Taken from FstatMetric where it parsed user-input into ConfigVariables,
792 * now basically just translates from modern-API 'metricParams' into old-API 'ConfigVariables'
793 *
794 */
795int
797 const DopplerMetricParams *metricParams,
798 const EphemerisData *edat
799 )
800{
801 XLAL_CHECK( cfg != NULL, XLAL_EINVAL );
802 XLAL_CHECK( metricParams != NULL, XLAL_EINVAL );
803 XLAL_CHECK( edat != NULL, XLAL_EINVAL );
804
806 XLAL_CHECK( metricParams->segmentList.length == 1, XLAL_EDOM ); // only 1 segment allowed
807
808 LIGOTimeGPSVector *GLtimestamps = NULL;
809 REAL8Vector *detWeights;
810
811 cfg->edat = edat;
812
813 cfg->startTime = metricParams->segmentList.segs[0].start;
814 cfg->refTime = metricParams->signalParams.Doppler.refTime;
815
816 REAL8 startTimeREAL8 = XLALGPSGetREAL8( &( metricParams->segmentList.segs[0].start ) );
817 REAL8 endTimeREAL8 = XLALGPSGetREAL8( &( metricParams->segmentList.segs[0].end ) );
818 REAL8 duration = XLALGPSDiff( &( metricParams->segmentList.segs[0].end ), &( metricParams->segmentList.segs[0].start ) );
819
820 /* NOTE: internally we always deal with a fixed number of spins */
822
823 cfg->dopplerPoint.fkdot->data[0] = metricParams->signalParams.Doppler.fkdot[0];
824 cfg->dopplerPoint.fkdot->data[1] = metricParams->signalParams.Doppler.fkdot[1];
825
829
830 /* ----- construct Gauss-Legendre timestamps and corresponding weights
831 * for computing the integrals by Gauss-Legendre quadrature
832 */
833 UINT4 numSteps = 2000; // just kept the default value from lalapps_FstatMetric, which was used in testMetricCodes.py
834
835 REAL8Vector *ti; /* temporary */
836 REAL8 Tinv = 1.0 / duration;
837
838 XLAL_CHECK( ( cfg->GLweights = XLALCreateREAL8Vector( numSteps ) ) != NULL, XLAL_EFUNC );
839 XLAL_CHECK( ( ti = XLALCreateREAL8Vector( numSteps ) ) != NULL, XLAL_EFUNC );
840 XLAL_CHECK( ( GLtimestamps = XLALCreateTimestampVector( numSteps ) ) != NULL, XLAL_EFUNC );
841
842 /* compute Gauss-Legendre roots, timestamps and associated weights */
843 gauleg( startTimeREAL8, endTimeREAL8, ti->data, cfg->GLweights->data, numSteps );
844
845 /* convert REAL8-times into LIGOTimeGPS-times */
846 for ( UINT4 i = 0; i < numSteps; i ++ ) {
847 XLALGPSSetREAL8( &( GLtimestamps->data[i] ), ti->data[i] );
848 cfg->GLweights->data[i] *= Tinv;
849 }
850
852
853 /* ----- initialize IFOs and (Multi-)DetectorStateSeries ----- */
854 UINT4 numDet = metricParams->multiIFO.length;
855
856 XLAL_CHECK( ( cfg->multiDetStates = XLALCalloc( 1, sizeof( *( cfg->multiDetStates ) ) ) ) != NULL, XLAL_ENOMEM );
857 XLAL_CHECK( ( cfg->multiDetStates->data = XLALCalloc( numDet, sizeof( *( cfg->multiDetStates->data ) ) ) ) != NULL, XLAL_ENOMEM );
858
860
861 for ( UINT4 X = 0; X < numDet; X ++ ) {
862 const LALDetector *ifo = &( metricParams->multiIFO.sites[X] );
863 /* obtain detector positions and velocities, together with LMSTs */
864 cfg->multiDetStates->data[X] = XLALGetDetectorStates( GLtimestamps, ifo, edat, 0 );
865 XLAL_CHECK( cfg->multiDetStates->data[X] != NULL, XLAL_EFUNC );
866 } /* for X < numDet */
867
868 /* ----- get relative detector-weights from user ---------- */
869 XLAL_CHECK( ( detWeights = XLALCreateREAL8Vector( numDet ) ) != NULL, XLAL_EFUNC );
870
871 for ( UINT4 X = 0; X < numDet ; X ++ ) {
872 detWeights->data[X] = metricParams->multiNoiseFloor.sqrtSn[X];
873 }
874
875 /* ---------- combine relative detector-weights with GL-weights ----------*/
877 XLAL_CHECK( ( tmp = XLALCalloc( 1, sizeof( *tmp ) ) ) != NULL, XLAL_ENOMEM );
878 tmp->length = numDet;
879 XLAL_CHECK( ( tmp->data = XLALCalloc( numDet, sizeof( *( tmp->data ) ) ) ) != NULL, XLAL_ENOMEM );
880
881 for ( UINT4 X = 0; X < numDet; X ++ ) {
882 /* create k^th weights vector */
883 XLAL_CHECK( ( tmp->data[X] = XLALCreateREAL8Vector( numSteps ) ) != NULL, XLAL_EFUNC );
884
885 /* set all weights to detectorWeight * GLweight */
886 for ( UINT4 i = 0; i < numSteps; i ++ ) {
887 tmp->data[X]->data[i] = detWeights->data[X] * cfg->GLweights->data[i];
888 } // for i < numSteps
889
890 } /* for X < numDet */
891
892 cfg->multiNoiseWeights = tmp;
893
895 XLAL_CHECK( cfg->multiAMcoe != NULL, XLAL_EFUNC );
896
897 /* ----- compute amplitude-factors alpha1, alpha2, alpha3 ----- */
898 REAL8 psi = metricParams->signalParams.Amp.psi;
899
900 REAL8 Aplus = metricParams->signalParams.Amp.aPlus;
901 REAL8 Across = metricParams->signalParams.Amp.aCross;
902 REAL8 cos2psi = cos( 2.0 * psi );
903 REAL8 sin2psi = sin( 2.0 * psi );
904 cfg->Al1 = SQ( Aplus ) * SQ( cos2psi ) + SQ( Across ) * SQ( sin2psi );
905 cfg->Al2 = SQ( Aplus ) * SQ( sin2psi ) + SQ( Across ) * SQ( cos2psi );
906 cfg->Al3 = ( SQ( Aplus ) - SQ( Across ) ) * sin2psi * cos2psi ;
907
908 // ----- translate 'new-API' DetectorMotionType into 'old-API' PhaseType_t
909 switch ( ( int )metricParams->detMotionType ) {
911 cfg->phaseType = PHASE_FULL;
912 break;
913
914 case DETMOTION_ORBIT:
916 break;
917
918 case DETMOTION_SPIN:
919 cfg->phaseType = PHASE_SPIN;
920 break;
921
923 cfg->phaseType = PHASE_PTOLE;
924 break;
925
926 default:
927 XLAL_ERROR( XLAL_EDOM, "Can't deal with detMotionType = %d, not analog exists for XLALOldDopplerFstatMetric()\n", metricParams->detMotionType );
928 break;
929 } // switch(detMotionType)
930
931 /* free temporary memory */
932 XLALDestroyREAL8Vector( detWeights );
933 XLALDestroyTimestampVector( GLtimestamps );
934
935 return XLAL_SUCCESS;
936
937} /* InitCode() */
938
939
940/**
941 * calculate the phase-derivatives \f$ \partial_i \phi \f$ for the
942 * time-series detStates and the given doppler-point.
943 * Has the option of using only the orbital part of the phase (PHASE_ORBITAL)
944 * or the full-phase (PHASE_FULL).
945 *
946 * returned PhaseDerivs is allocated in here.
947 */
950 const DopplerPoint *dopplerPoint,
951 PhaseType_t phaseType
952 )
953{
954 XLAL_CHECK_NULL( multiDetStates != NULL, XLAL_EINVAL );
955 XLAL_CHECK_NULL( dopplerPoint != NULL, XLAL_EINVAL );
957 XLAL_CHECK_NULL( dopplerPoint->fkdot->length == 2, XLAL_EDOM );
958
959 UINT4 numDet = multiDetStates->length;
960 REAL8 Alpha = dopplerPoint->skypos.longitude;
961 REAL8 Delta = dopplerPoint->skypos.latitude;
962
963 REAL8 vn[3]; /* unit-vector pointing to source in Cart. equatorial coord. */
964 vn[0] = cos( Delta ) * cos( Alpha );
965 vn[1] = cos( Delta ) * sin( Alpha );
966 vn[2] = sin( Delta );
967
968 LIGOTimeGPS refTimeGPS = multiDetStates->data[0]->data[0].tGPS; /* use 1st detectors startTime as refTime */
969 REAL8 refTime = XLALGPSGetREAL8( &refTimeGPS );
970
971 /* get tAutumn */
972 REAL8 tMidnight, tAutumn;
973 XLAL_CHECK_NULL( XLALGetEarthTimes( &refTimeGPS, &tMidnight, &tAutumn ) == XLAL_SUCCESS, XLAL_EFUNC );
974
975 MultiPhaseDerivs *mdPhi = NULL;
976 XLAL_CHECK_NULL( ( mdPhi = XLALCalloc( 1, sizeof( *mdPhi ) ) ) != NULL, XLAL_ENOMEM );
977 XLAL_CHECK_NULL( ( mdPhi->data = XLALCalloc( numDet, sizeof( *( mdPhi->data ) ) ) ) != NULL, XLAL_ENOMEM );
978
979 mdPhi->length = numDet;
980
981 for ( UINT4 X = 0; X < numDet; X ++ ) {
982 UINT4 numStepsX = multiDetStates->data[X]->length;
983 DetectorStateSeries *detStatesX = multiDetStates->data[X];
984 PhaseDerivs *dPhi;
985
986 XLAL_CHECK_NULL( ( dPhi = XLALCalloc( 1, sizeof( *dPhi ) ) ) != NULL, XLAL_ENOMEM );
987
988 dPhi->dFreq = XLALCreateREAL8Vector( numStepsX );
989 dPhi->dAlpha = XLALCreateREAL8Vector( numStepsX );
990 dPhi->dDelta = XLALCreateREAL8Vector( numStepsX );
991 dPhi->df1dot = XLALCreateREAL8Vector( numStepsX );
992
993 mdPhi->data[X] = dPhi;
994
995 for ( UINT4 i = 0; i < numStepsX; i++ ) {
996 REAL8 ti, dT, taui;
997 REAL8 rX[3]; /* radius-vector to use: full, orbital or spin-only */
998 REAL8 rDet[3]; /* vector from earth center to detector */
999 REAL8 fi; /* instantaneous intrinsic frequency in SSB */
1000 PosVel_t posvel;
1001
1002 ti = XLALGPSGetREAL8( &( detStatesX->data[i].tGPS ) ) - refTime;
1003
1004 /* compute detector-vector relative to earth's center */
1005 rDet[0] = detStatesX->data[i].rDetector[0] - detStatesX->data[i].earthState.posNow[0];
1006 rDet[1] = detStatesX->data[i].rDetector[1] - detStatesX->data[i].earthState.posNow[1];
1007 rDet[2] = detStatesX->data[i].rDetector[2] - detStatesX->data[i].earthState.posNow[2];
1008
1009 switch ( phaseType ) {
1010 case PHASE_FULL:
1011 COPY_VECT( rX, detStatesX->data[i].rDetector );
1012 break;
1013 case PHASE_ORBITAL:
1014 COPY_VECT( rX, detStatesX->data[i].earthState.posNow );
1015 break;
1016 case PHASE_SPIN: /* just given for completeness, probably not very useful */
1017 COPY_VECT( rX, rDet );
1018 break;
1019 case PHASE_PTOLE: /* use Ptolemaic orbital approximation */
1020 getPtolePosVel( &posvel, ti, tAutumn );
1021 COPY_VECT( rX, posvel.pos );
1022 /* add on the detector-motion due to the Earth's spin */
1023
1024 rX[0] += rDet[0];
1025 rX[1] += rDet[1];
1026 rX[2] += rDet[2];
1027
1028 break;
1029 default:
1030 XLAL_ERROR_NULL( XLAL_EINVAL, "Unknown phase-type specified '%d'\n", phaseType );
1031 break;
1032 } /* switch(phaseType) */
1033
1034 /* correct for time-delay from SSB to detector */
1035 dT = SCALAR( vn, rX );
1036 taui = ( ti + dT );
1037
1038 fi = dopplerPoint->fkdot->data[0] + taui * dopplerPoint->fkdot->data[1];
1039
1040 /* phase-derivatives */
1041 dPhi->dFreq->data[i] = LAL_TWOPI * taui;
1042
1043 dPhi->dAlpha->data[i] = LAL_TWOPI * fi * cos( Delta ) * ( - rX[0] * sin( Alpha ) + rX[1] * cos( Alpha ) );
1044
1045 dPhi->dDelta->data[i] = LAL_TWOPI * fi * ( - rX[0] * cos( Alpha ) * sin( Delta )
1046 - rX[1] * sin( Alpha ) * sin( Delta )
1047 + rX[2] * cos( Delta ) );
1048
1049 dPhi->df1dot->data[i] = LAL_TWOPI * 0.5 * SQ( taui );
1050
1051 } /* for i < numStepsX */
1052
1053 } /* for X < numDet */
1054
1055 return mdPhi;
1056
1057} /* getMultiPhaseDerivs() */
1058
1059/**
1060 * Calculate the projected metric onto the subspace of 'c' given by
1061 * ret_ij = g_ij - ( g_ic * g_jc / g_cc ) , where c is the value of the projected coordinate
1062 * The output-matrix ret must be allocated
1063 *
1064 * return 0 = OK, -1 on error.
1065 */
1066int
1067project_metric( gsl_matrix *ret_ij, gsl_matrix *g_ij, const UINT4 c )
1068{
1069 UINT4 i, j;
1070
1071 if ( !ret_ij ) {
1072 return -1;
1073 }
1074 if ( !g_ij ) {
1075 return -1;
1076 }
1077 if ( ( ret_ij->size1 != ret_ij->size2 ) ) {
1078 return -1;
1079 }
1080 if ( ( g_ij->size1 != g_ij->size2 ) ) {
1081 return -1;
1082 }
1083
1084 for ( i = 0; i < ret_ij->size1; i ++ ) {
1085 for ( j = 0; j < ret_ij->size2; j ++ ) {
1086 if ( i == c || j == c ) {
1087 gsl_matrix_set( ret_ij, i, j, 0.0 );
1088 } else {
1089 gsl_matrix_set( ret_ij, i, j, ( gsl_matrix_get( g_ij, i, j ) - ( gsl_matrix_get( g_ij, i, c ) * gsl_matrix_get( g_ij, j, c ) / gsl_matrix_get( g_ij, c, c ) ) ) );
1090 }
1091 }
1092 }
1093 return 0;
1094}
1095
1096
1097/**
1098 * Calculate the outer product ret_ij of vectors u_i and v_j, given by
1099 * ret_ij = u_i v_j
1100 * The output-matrix ret must be allocated and have dimensions len(u) x len(v)
1101 *
1102 * return 0 = OK, -1 on error.
1103 */
1104int
1105outer_product( gsl_matrix *ret_ij, const gsl_vector *u_i, const gsl_vector *v_j )
1106{
1107 UINT4 i, j;
1108
1109 if ( !ret_ij || !u_i || !v_j ) {
1110 return -1;
1111 }
1112
1113 if ( ( ret_ij->size1 != u_i->size ) || ( ret_ij->size2 != v_j->size ) ) {
1114 return -1;
1115 }
1116
1117
1118 for ( i = 0; i < ret_ij->size1; i ++ )
1119 for ( j = 0; j < ret_ij->size2; j ++ ) {
1120 gsl_matrix_set( ret_ij, i, j, gsl_vector_get( u_i, i ) * gsl_vector_get( v_j, j ) );
1121 }
1122
1123 return 0;
1124
1125} /* outer_product() */
1126
1127
1128/* symmetrize the input-matrix 'mat' (which must be quadratic)
1129 */
1130int
1131symmetrize( gsl_matrix *mat )
1132{
1133 gsl_matrix *tmp;
1134
1135 if ( !mat ) {
1136 return -1;
1137 }
1138 if ( mat->size1 != mat->size2 ) {
1139 return -1;
1140 }
1141
1142 tmp = gsl_matrix_calloc( mat->size1, mat->size2 );
1143
1144 gsl_matrix_transpose_memcpy( tmp, mat );
1145
1146 gsl_matrix_add( mat, tmp );
1147
1148 gsl_matrix_scale( mat, 0.5 );
1149
1150 gsl_matrix_free( tmp );
1151
1152 return 0;
1153
1154} /* symmetrize() */
1155
1156
1157/* compute the quadratic form = vec.mat.vec
1158 */
1159REAL8
1160quad_form( const gsl_matrix *mat, const gsl_vector *vec )
1161{
1162 UINT4 i, j;
1163 REAL8 ret = 0;
1164
1165 if ( !mat || !vec ) {
1166 return 0;
1167 }
1168 if ( ( mat->size1 != mat->size2 ) || ( mat->size1 != vec->size ) ) {
1169 return 0;
1170 }
1171
1172 for ( i = 0; i < mat->size1; i ++ )
1173 for ( j = 0; j < mat->size2; j ++ ) {
1174 ret += gsl_vector_get( vec, i ) * gsl_matrix_get( mat, i, j ) * gsl_vector_get( vec, j );
1175 }
1176
1177 return ret;
1178
1179} /* quad_form() */
1180
1181
1182/**
1183 * Get Ptolemaic position and velocity at time tGPS
1184 * cut-down version of LALDTBaryPtolemaic()
1185 */
1186
1187void
1188getPtolePosVel( PosVel_t *posvel, REAL8 tGPS, REAL8 tAutumnGPS )
1189{
1190 REAL8 rev; /* Earth revolution angle, in radians. */
1191
1192 /* Some local constants. */
1193 REAL8 tRev = LAL_AU_SI / LAL_C_SI;
1194 REAL8 vRev = LAL_TWOPI * tRev / LAL_YRSID_SI;
1195 REAL8 cosi = cos( LAL_IEARTH );
1196 REAL8 sini = sin( LAL_IEARTH );
1197
1198 if ( !posvel ) {
1199 return;
1200 }
1201
1202 rev = LAL_TWOPI * ( tGPS - tAutumnGPS ) / LAL_YRSID_SI;
1203
1204 /* Get detector position. */
1205 posvel->pos[0] = tRev * cos( rev );
1206 posvel->pos[1] = tRev * sin( rev ) * cosi;
1207 posvel->pos[2] = tRev * sin( rev ) * sini;
1208
1209 /* Get detector velocity. */
1210 posvel->vel[0] = -vRev * sin( rev );
1211 posvel->vel[1] = vRev * cos( rev ) * cosi;
1212 posvel->vel[2] = vRev * cos( rev ) * sini;
1213
1214 return;
1215
1216} /* getPtolePosVel() */
1217
1218void
1220{
1221 UINT4 numDet, X;
1222
1223 if ( !mdPhi ) {
1224 return;
1225 }
1226 numDet = mdPhi->length;
1227
1228 if ( numDet && !mdPhi->data ) {
1230 }
1231
1232 for ( X = 0; X < numDet; X ++ ) {
1233 PhaseDerivs *dPhiX = mdPhi->data[X];
1234 if ( !dPhiX ) {
1235 continue;
1236 }
1239 XLALDestroyREAL8Vector( dPhiX->dFreq );
1241
1242 LALFree( dPhiX );
1243
1244 } /* for X < numDet */
1245
1246 LALFree( mdPhi->data );
1247 LALFree( mdPhi );
1248
1249 return;
1250
1251} /* XLALDestroyMultiPhaseDerivs() */
1252
1253/* ================================================================================*/
1254/* taken from Numerical recipes:
1255 * function to compute roots and weights for order-N Gauss-Legendre integration
1256 * modified to use standard C-conventions for arrays (indexed 0... N-1)
1257 */
1258#define EPS 3.0e-11
1259
1260/* Given the lower and upper limits of integration x1 and x2, and given n, this routine returns
1261 * arrays x[0..n-1] and w[0..n-1] of length n, containing the abscissas and weights of the Gauss-
1262 * Legendre n-point quadrature formula.
1263 */
1264void
1265gauleg( double x1, double x2, double x[], double w[], int n )
1266{
1267 int m, j, i;
1268 /* High precision is a good idea for this routine. */
1269 double z1, z, xm, xl, pp, p3, p2, p1;
1270
1271 /* The roots are symmetric in the interval, so
1272 * we only have to find half of them. */
1273 m = ( n + 1 ) / 2;
1274
1275 xm = 0.5 * ( x2 + x1 );
1276 xl = 0.5 * ( x2 - x1 );
1277 /* Loop over the desired roots. */
1278 for ( i = 1; i <= m; i++ ) {
1279 z = cos( LAL_PI * ( i - 0.25 ) / ( n + 0.5 ) );
1280 /* Starting with the above approximation to the ith root,
1281 * we enter the main loop of refinement by Newton's method.
1282 */
1283 do {
1284 p1 = 1.0;
1285 p2 = 0.0;
1286 /* Loop up the recurrence relation to get the
1287 * Legendre polynomial evaluated at z.
1288 */
1289 for ( j = 1; j <= n; j++ ) {
1290
1291 p3 = p2;
1292 p2 = p1;
1293 p1 = ( ( 2.0 * j - 1.0 ) * z * p2 - ( j - 1.0 ) * p3 ) / j;
1294 }
1295 /* p1 is now the desired Legendre polynomial. We next compute pp, its derivative,
1296 * by a standard relation involving also p2, the polynomial of one lower order.
1297 */
1298 pp = n * ( z * p1 - p2 ) / ( z * z - 1.0 );
1299 z1 = z;
1300 /* Newton's method. */
1301 z = z1 - p1 / pp;
1302 } while ( fabs( z - z1 ) > EPS );
1303 /* Scale the root to the desired interval, and put in its symmetric counterpart. */
1304 x[i - 1] = xm - xl * z; /*RP: changed to C-convention */
1305
1306 x[n + 1 - i - 1] = xm + xl * z; /*RP: changed to C-convention */
1307
1308 /* Compute the weight and its symmetric counterpart. */
1309 w[i - 1] = 2.0 * xl / ( ( 1.0 - z * z ) * pp * pp ); /*RP: changed to C-convention */
1310
1311 w[n + 1 - i - 1] = w[i - 1]; /*RP: changed to C-convention */
1312 }
1313
1314} /* gauleg() */
#define __func__
log an I/O error, i.e.
int j
#define LALFree(p)
const double b2
#define c
#define D(j)
UINT2 A
Definition: SFTnaming.c:46
UINT2 B
Definition: SFTnaming.c:47
const double scale
multiplicative scaling factor of the coordinate
const double pp
const double a2
const double w
void XLALDestroyMultiDetectorStateSeries(MultiDetectorStateSeries *mdetStates)
Helper function to get rid of a multi-IFO DetectorStateSeries Note, this is "NULL-robust" in the sens...
DetectorStateSeries * XLALGetDetectorStates(const LIGOTimeGPSVector *timestamps, const LALDetector *detector, const EphemerisData *edat, REAL8 tOffset)
Get the 'detector state' (ie detector-tensor, position, velocity, etc) for the given vector of timest...
int XLALGetEarthTimes(const LIGOTimeGPS *tepoch, REAL8 *tMidnight, REAL8 *tAutumn)
This function takes a GPS time from tepoch and uses it to assign tAutumn and tMidnight,...
Definition: GetEarthTimes.c:76
void XLALDestroyMultiAMCoeffs(MultiAMCoeffs *multiAMcoef)
Destroy a MultiAMCoeffs structure.
Definition: LALComputeAM.c:469
MultiAMCoeffs * XLALComputeMultiAMCoeffs(const MultiDetectorStateSeries *multiDetStates, const MultiNoiseWeights *multiWeights, SkyPosition skypos)
Multi-IFO version of XLALComputeAMCoeffs().
Definition: LALComputeAM.c:379
#define LAL_IEARTH
#define LAL_PI
#define LAL_YRSID_SI
#define LAL_TWOPI
double REAL8
#define XLAL_INIT_DECL(var,...)
uint32_t UINT4
void * XLALCalloc(size_t m, size_t n)
void XLALFree(void *p)
static const INT4 m
static const INT4 a
LIGOTimeGPSVector * XLALCreateTimestampVector(UINT4 len)
Allocate a LIGOTimeGPSVector.
Definition: SFTtimestamps.c:47
void XLALDestroyTimestampVector(LIGOTimeGPSVector *vect)
De-allocate a LIGOTimeGPSVector.
Definition: SFTtimestamps.c:69
int XLALSegListIsInitialized(const LALSegList *seglist)
COORDINATESYSTEM_EQUATORIAL
@ DOPPLERCOORD_DELTA
Declination [Units: radians].
@ DOPPLERCOORD_F1DOT
First spindown [Units: Hz/s].
@ DOPPLERCOORD_ALPHA
Right ascension [Units: radians].
@ DOPPLERCOORD_FREQ
Frequency [Units: Hz].
@ DETMOTION_SPIN
Full spin motion.
@ DETMOTION_PTOLEORBIT
Ptolemaic (circular) orbital motion.
@ DETMOTION_ORBIT
Ephemeris-based orbital motion.
REAL8Vector * XLALCreateREAL8Vector(UINT4 length)
void XLALDestroyREAL8Vector(REAL8Vector *vector)
#define XLAL_ERROR_VOID(...)
#define XLAL_ERROR_NULL(...)
#define XLAL_ERROR(...)
#define XLAL_CHECK(assertion,...)
#define XLAL_CHECK_NULL(assertion,...)
XLAL_ENOMEM
XLAL_SUCCESS
XLAL_EFUNC
XLAL_EDOM
XLAL_EINVAL
XLAL_EFAILED
LIGOTimeGPS * XLALGPSSetREAL8(LIGOTimeGPS *epoch, REAL8 t)
REAL8 XLALGPSGetREAL8(const LIGOTimeGPS *epoch)
REAL8 XLALGPSDiff(const LIGOTimeGPS *t1, const LIGOTimeGPS *t0)
pos
m2
m1
n
int symmetrize(gsl_matrix *mat)
int outer_product(gsl_matrix *ret_ij, const gsl_vector *u_i, const gsl_vector *v_j)
Calculate the outer product ret_ij of vectors u_i and v_j, given by ret_ij = u_i v_j The output-matri...
#define COPY_VECT(dst, src)
copy 3 components of Euklidean vector
void gauleg(double x1, double x2, double x[], double w[], int n)
OldDopplerMetric * XLALOldDopplerFstatMetric(const OldMetricType_t metricType, const DopplerMetricParams *metricParams, const EphemerisData *edat)
The only purpose of this function is to serve as a backwards-comparison check for XLALDopplerFstatMet...
int XLALScaleOldDopplerMetric(OldDopplerMetric *m, REAL8 scale)
Scale all (existing) matrices, error-estimates and 'rho2' by 'scale'.
void XLALDestroyMultiPhaseDerivs(MultiPhaseDerivs *mdPhi)
PhaseType_t
@ PHASE_PTOLE
@ PHASE_NONE
@ PHASE_SPIN
@ PHASE_ORBITAL
@ PHASE_LAST
@ PHASE_FULL
#define EPS
int computePhaseMetric(gsl_matrix *g_ij, const PhaseDerivs *dphi, const REAL8Vector *GLweights)
#define METRIC_DIM
int computeFstatMetric(gsl_matrix *gF_ij, gsl_matrix *gFav_ij, gsl_matrix *m1_ij, gsl_matrix *m2_ij, gsl_matrix *m3_ij, ConfigVariables *cfg)
int InitCode(ConfigVariables *cfg, const DopplerMetricParams *metricParams, const EphemerisData *edat)
basic initializations: set-up 'ConfigVariables' Taken from FstatMetric where it parsed user-input int...
REAL8 quad_form(const gsl_matrix *mat, const gsl_vector *vec)
int XLALAddOldDopplerMetric(OldDopplerMetric **metric1, const OldDopplerMetric *metric2)
Add 'metric2' to 'metric1', by adding the matrixes and 'rho2', and adding error-estimates in quadratu...
MultiPhaseDerivs * getMultiPhaseDerivs(const MultiDetectorStateSeries *detStates, const DopplerPoint *dopplerPoint, PhaseType_t type)
calculate the phase-derivatives for the time-series detStates and the given doppler-point.
#define NUM_SPINS
void XLALDestroyOldDopplerMetric(OldDopplerMetric *metric)
Free a OldDopplerMetric structure.
#define SCALAR(u, v)
Simple Euklidean scalar product for two 3-dim vectors in cartesian coords.
int project_metric(gsl_matrix *ret_ij, gsl_matrix *g_ij, const UINT4 coordinate)
Calculate the projected metric onto the subspace of 'c' given by ret_ij = g_ij - ( g_ic * g_jc / g_cc...
#define SQ(x)
void getPtolePosVel(PosVel_t *posvel, REAL8 tGPS, REAL8 tAutumn)
Get Ptolemaic position and velocity at time tGPS cut-down version of LALDTBaryPtolemaic()
OldMetricType_t
@ OLDMETRIC_TYPE_LAST
@ OLDMETRIC_TYPE_PHASE
compute phase metric only
@ OLDMETRIC_TYPE_FSTAT
compute full F-metric only
@ OLDMETRIC_TYPE_ALL
compute both F-metric and phase-metric
This structure contains the per-SFT (weighted) antenna-pattern functions , with the SFT-index,...
Definition: LALComputeAM.h:63
REAL4Vector * b
(weighted) per-SFT antenna-pattern function
Definition: LALComputeAM.h:65
REAL4Vector * a
(weighted) per-SFT antenna-pattern function
Definition: LALComputeAM.h:64
Configuration settings required for and defining a coherent pulsar search.
MultiPhaseDerivs * multidPhi
Phase-derivatives d_i phi(t)
REAL8Vector * GLweights
Gauss-Legendre Integration-weights.
REAL8 Al3
amplitude factors alpha1, alpha2, alpha3
REAL8 refTime
reference time for pulsar phase definition
DopplerPoint dopplerPoint
sky-position and spins
MultiAMCoeffs * multiAMcoe
Amplitude Modulation coefficients a,b(t)
LIGOTimeGPS refTime
reference time for spin-parameters
MultiDetectorStateSeries * multiDetStates
multi-detector state series covering observation time
const EphemerisData * edat
ephemeris data (from XLALInitBarycenter())
MultiNoiseWeights * multiNoiseWeights
per-detector noise weights SX^-1/S^-1, no per-SFT variation (can be NULL for unit weights)
LIGOTimeGPS startTime
starting timestamp of SFTs
PhaseType_t phaseType
EphemerisData * edat
ephemeris data
EarthState earthState
EarthState information.
REAL8 rDetector[3]
Cartesian coords of detector position in ICRS J2000.
LIGOTimeGPS tGPS
GPS timestamps corresponding to this entry.
Timeseries of DetectorState's, representing the detector-info at different timestamps.
DetectorState * data
array of DetectorState entries
UINT4 length
total number of entries
type describing a Doppler coordinate system: lists the number of dimensions and the symbolic names of...
DopplerCoordinateID coordIDs[DOPPLERMETRIC_MAX_DIM]
coordinate 'names'
UINT4 dim
number of dimensions covered
meta-info specifying a Doppler-metric
MultiLALDetector multiIFO
detectors to compute metric for
DetectorMotionType detMotionType
the type of detector-motion assumed: full spin+orbit, pure orbital, Ptole, ...
PulsarParams signalParams
parameter-space point to compute metric for (doppler + amplitudes)
LALSegList segmentList
segment list: Nseg segments of the form (startGPS endGPS numSFTs)
MultiNoiseFloor multiNoiseFloor
and associated per-detector noise-floors to be used for weighting.
DopplerCoordinateSystem coordSys
number of dimensions and coordinate-IDs of Doppler-metric
a 'point' in the "Doppler parameter space" {alpha, delta, fkdot }
REAL8Vector * fkdot
SkyPosition skypos
REAL8 posNow[3]
Cartesian coords of Earth's center at tgps, extrapolated from JPL DE405 ephemeris; units= sec.
This structure contains all information about the center-of-mass positions of the Earth and Sun,...
LIGOTimeGPS end
LIGOTimeGPS start
UINT4 length
LALSeg * segs
A vector of 'timestamps' of type LIGOTimeGPS.
Definition: SFTfileIO.h:188
LIGOTimeGPS * data
array of timestamps
Definition: SFTfileIO.h:193
Multi-IFO container for antenna-pattern coefficients and atenna-pattern matrix .
Definition: LALComputeAM.h:137
UINT4 length
number of IFOs
Definition: LALComputeAM.h:141
AMCoeffs ** data
noise-weighted AM-coeffs , and
Definition: LALComputeAM.h:142
Multi-IFO time-series of DetectorStates.
UINT4 length
number of detectors
DetectorStateSeries ** data
vector of pointers to DetectorStateSeries
UINT4 length
number of detectors
LALDetector sites[PULSAR_MAX_DETECTORS]
array of site information
REAL8 sqrtSn[PULSAR_MAX_DETECTORS]
per-IFO sqrt(PSD) values , where
One noise-weight (number) per SFT (therefore indexed over IFOs and SFTs.
Definition: PSDutils.h:71
UINT4 length
number of detectors
Definition: PSDutils.h:75
REAL8Vector ** data
weights-vector for each detector
Definition: PSDutils.h:76
PhaseDerivs ** data
phase-derivs array
UINT4 length
number of IFOs
double maxrelerr_gPh
estimate for largest relative error in phase-metric component integrations
gsl_matrix * g_ij
symmetric matrix holding the phase-metric, averaged over segments
DopplerMetricParams meta
"meta-info" describing/specifying the type of Doppler metric
gsl_matrix * g_ij_seg
the phase-metric for each segment, concatenated by column: [g_ij_1, g_ij_2, ...]
gsl_matrix * gFav_ij
'average' Fstat-metric
gsl_matrix * gF_ij
full F-statistic metric gF_ij, including antenna-pattern effects (see )
double maxrelerr_gF
estimate for largest relative error in Fmetric component integrations
gsl_matrix * Fisher_ab
Full 4+n dimensional Fisher matrix, ie amplitude + Doppler space.
gsl_matrix * m1_ij
REAL8 rho2
signal SNR rho^2 = A^mu M_mu_nu A^nu
REAL8Vector * df1dot
REAL8Vector * dDelta
REAL8Vector * dFreq
REAL8Vector * dAlpha
REAL8 vel[3]
REAL8 pos[3]
REAL8 aCross
Signal amplitude (cross)
REAL8 psi
polarization angle psi
REAL8 aPlus
Signal amplitude (plus)
PulsarSpins fkdot
Intrinsic spins: [Freq, f1dot, f2dot, ... ] where fkdot = d^kFreq/dt^k.
REAL8 Delta
Sky position: DEC (latitude) in equatorial coords and radians.
LIGOTimeGPS refTime
Reference time of pulsar parameters (in SSB!)
REAL8 Alpha
Sky position: RA (longitude) in equatorial coords and radians.
PulsarAmplitudeParams Amp
'Amplitude-parameters': h0, cosi, phi0, psi
PulsarDopplerParams Doppler
'Phase-evolution parameters': {skypos, fkdot, orbital params }
REAL4 * data
REAL8 * data
REAL8 longitude
REAL8 latitude
CoordinateSystem system