LALPulsar  6.1.0.1-89842e6
SynthesizeCWDraws.c
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2010 Reinhard Prix
3  * Copyright (C) 2011, 2014 David Keitel
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 /*---------- INCLUDES ----------*/
22 
23 /* GSL includes */
24 #include <gsl/gsl_blas.h>
25 #include <gsl/gsl_linalg.h>
26 
27 #include <lal/SynthesizeCWDraws.h>
28 
29 #include <lal/FstatisticTools.h>
30 
31 /*---------- DEFINES ----------*/
32 #define SQ(x) ((x)*(x))
33 
34 /*----- SWITCHES -----*/
35 /*---------- internal types ----------*/
36 
37 /*---------- Global variables ----------*/
38 
39 /*---------- internal prototypes ----------*/
40 
41 /*==================== FUNCTION DEFINITIONS ====================*/
42 
43 /// \addtogroup SynthesizeCWDraws_h
44 /// @{
45 
46 /**
47  * Generate 4 random-noise draws n_mu = {n_1, n_2, n_3, n_4} with correlations according to
48  * the matrix M = L L^T, which is passed in as input.
49  *
50  * Note: you need to pass a pre-allocated 4-vector n_mu.
51  * Note2: this function is meant as a lower-level noise-generation utility, called
52  * from a higher-level function to translate the antenna-pattern functions into pre-factorized Lcor
53  */
54 int
55 XLALDrawCorrelatedNoise( PulsarAmplitudeVect n_mu, /**< [out] 4d vector of noise-components {n_mu}, with correlation L * L^T */
56  const gsl_matrix *L, /**< [in] correlator matrix to get n_mu = L_mu_nu * norm_nu from 4 uncorr. unit variates norm_nu */
57  gsl_rng *rng /**< gsl random-number generator */
58  )
59 {
60  int gslstat;
61 
62  /* ----- check input arguments ----- */
63  if ( !L || ( L->size1 != 4 ) || ( L->size2 != 4 ) ) {
64  XLALPrintError( "%s: Invalid correlator matrix, n_mu must be pre-allocate 4x4 matrix", __func__ );
66  }
67  if ( !rng ) {
68  XLALPrintError( "%s: invalid NULL input as gsl random-number generator!\n", __func__ );
70  }
71 
72  /* ----- generate 4 normal-distributed, uncorrelated random numbers ----- */
74 
75  n[0] = gsl_ran_gaussian( rng, 1.0 );
76  n[1] = gsl_ran_gaussian( rng, 1.0 );
77  n[2] = gsl_ran_gaussian( rng, 1.0 );
78  n[3] = gsl_ran_gaussian( rng, 1.0 );
79 
80  /* use four normal-variates {norm_nu} with correlator matrix L to get: n_mu = L_{mu nu} norm_nu
81  * which gives {n_\mu} satisfying cov(n_mu,n_nu) = (L L^T)_{mu nu} = M_{mu nu}
82  */
83  gsl_vector_view n_view = gsl_vector_view_array( n, 4 );
84  gsl_vector_view n_mu_view = gsl_vector_view_array( n_mu, 4 );
85 
86  /* int gsl_blas_dgemv (CBLAS_TRANSPOSE_t TransA, double alpha, const gsl_matrix * A, const gsl_vector * x, double beta, gsl_vector * y)
87  * compute the matrix-vector product and sum y = \alpha op(A) x + \beta y, where op(A) = A, A^T, A^H
88  * for TransA = CblasNoTrans, CblasTrans, CblasConjTrans.
89  */
90  if ( ( gslstat = gsl_blas_dgemv( CblasNoTrans, 1.0, L, &n_view.vector, 0.0, &n_mu_view.vector ) ) != 0 ) {
91  XLALPrintError( "%s: gsl_blas_dgemv(L * norm) failed: %s\n", __func__, gsl_strerror( gslstat ) );
93  }
94 
95  return XLAL_SUCCESS;
96 
97 } /* XLALDrawCorrelatedNoise() */
98 
99 /**
100  * Generate an FstatAtomVector for given antenna-pattern functions.
101  * Simply creates FstatAtomVector and initializes with antenna-pattern function.
102  */
104 XLALGenerateFstatAtomVector( const DetectorStateSeries *detStates, /**< input detector-state series, only used for timestamps */
105  const AMCoeffs *amcoeffs /**< input antenna-pattern functions {a_i, b_i} */
106  )
107 {
108  /* check input consistency */
109  if ( !detStates || !detStates->data ) {
110  XLALPrintError( "%s: invalid NULL input in detStates=%p or detStates->data=%p\n", __func__, detStates, detStates->data );
112  }
113  if ( !amcoeffs || !amcoeffs->a || !amcoeffs->b ) {
114  XLALPrintError( "%s: invalid NULL input in amcoeffs=%p or amcoeffs->a=%p, amcoeffs->b=%p\n", __func__, amcoeffs, amcoeffs->a, amcoeffs->b );
116  }
117  UINT4 numAtoms = detStates->length;
118  if ( numAtoms != amcoeffs->a->length || numAtoms != amcoeffs->b->length ) {
119  XLALPrintError( "%s: inconsistent lengths numAtoms=%d amcoeffs->a = %d, amecoeffs->b = %d\n", __func__, numAtoms, amcoeffs->a->length, amcoeffs->b->length );
121  }
122 
123  /* prepare output vector */
124  FstatAtomVector *atoms;
125  if ( ( atoms = XLALCreateFstatAtomVector( numAtoms ) ) == NULL ) {
126  XLALPrintError( "%s: XLALCreateFstatAtomVector(%d) failed.\n", __func__, numAtoms );
128  }
129 
130  atoms->TAtom = detStates->deltaT;
131  UINT4 alpha;
132  for ( alpha = 0; alpha < numAtoms; alpha ++ ) {
133  REAL8 a = amcoeffs->a->data[alpha];
134  REAL8 b = amcoeffs->b->data[alpha];
135 
136  atoms->data[alpha].timestamp = detStates->data[alpha].tGPS.gpsSeconds - 0.5 * detStates->deltaT; /* shift back to SFT start-time */
137  atoms->data[alpha].a2_alpha = a * a;
138  atoms->data[alpha].b2_alpha = b * b;
139  atoms->data[alpha].ab_alpha = a * b;
140 
141  /* Fa,Fb are zero-initialized from XLALCreateFstatAtomVector() */
142 
143  } /* for alpha < numAtoms */
144 
145  /* return result */
146  return atoms;
147 
148 } /* XLALGenerateFstatAtomVector() */
149 
150 
151 /**
152  * Generate a multi-FstatAtomVector for given antenna-pattern functions.
153  * Simply creates MultiFstatAtomVector and initializes with antenna-pattern function.
154  */
156 XLALGenerateMultiFstatAtomVector( const MultiDetectorStateSeries *multiDetStates, /**< [in] multi-detector state series, only used for timestamps */
157  const MultiAMCoeffs *multiAM /**< input antenna-pattern functions {a_i, b_i} */
158  )
159 {
160  /* check input consistency */
161  if ( !multiDetStates || !multiDetStates->data ) {
162  XLALPrintError( "%s: invalid NULL input in 'multiDetStates'\n", __func__ );
164  }
165  if ( !multiAM || !multiAM->data || !multiAM->data[0] ) {
166  XLALPrintError( "%s: invalid NULL input in 'mutiAM'\n", __func__ );
168  }
169 
170  UINT4 numDet = multiDetStates->length;
171  if ( numDet != multiAM->length ) {
172  XLALPrintError( "%s: inconsistent number of detectors in multiDetStates (%d) and multiAM (%d)\n", __func__, multiDetStates->length, multiAM->length );
174  }
175 
176  /* create multi-atoms vector */
177  MultiFstatAtomVector *multiAtoms;
178  if ( ( multiAtoms = XLALCalloc( 1, sizeof( *multiAtoms ) ) ) == NULL ) {
179  XLALPrintError( "%s: XLALCalloc ( 1, %zu) failed.\n", __func__, sizeof( *multiAtoms ) );
181  }
182  multiAtoms->length = numDet;
183  if ( ( multiAtoms->data = XLALCalloc( numDet, sizeof( *multiAtoms->data ) ) ) == NULL ) {
184  XLALPrintError( "%s: XLALCalloc ( %d, %zu) failed.\n", __func__, numDet, sizeof( *multiAtoms->data ) );
185  XLALFree( multiAtoms );
187  }
188 
189  /* loop over detectors and generate each atoms-vector individually */
190  UINT4 X;
191  for ( X = 0; X < numDet; X ++ ) {
192  if ( ( multiAtoms->data[X] = XLALGenerateFstatAtomVector( multiDetStates->data[X], multiAM->data[X] ) ) == NULL ) {
193  XLALPrintError( "%s: XLALGenerateFstatAtomVector() failed.\n", __func__ );
194  XLALDestroyMultiFstatAtomVector( multiAtoms );
196  }
197 
198  } /* for X < numDet */
199 
200  /* return result */
201  return multiAtoms;
202 
203 } /* XLALGenerateMultiFstatAtomVector() */
204 
205 /**
206  * Add Gaussian-noise components to given FstatAtomVector
207  */
208 int
209 XLALAddNoiseToFstatAtomVector( FstatAtomVector *atoms, /**< input atoms-vector, noise will be added to this */
210  gsl_rng *rng /**< random-number generator */
211  )
212 {
213  /* check input consistency */
214  if ( !atoms || !rng ) {
215  XLALPrintError( "%s: invalid NULL input for 'atoms'=%p or random-number generator 'rng'=%p\n", __func__, atoms, rng );
217  }
218  UINT4 numAtoms = atoms->length;
219 
220  /* prepare gsl-matrix for correlator L = 1/2 * [ a, a ; b , b ] */
221  gsl_matrix *Lcor;
222  if ( ( Lcor = gsl_matrix_calloc( 4, 4 ) ) == NULL ) {
223  XLALPrintError( "%s: gsl_matrix_calloc ( 4, 4 ) failed.\n", __func__ );
225  }
226  /* prepare placeholder for 4 n_mu noise draws */
227  PulsarAmplitudeVect n_mu;
228 
229  /* ----- step through atoms and synthesize noise ----- */
230  UINT4 alpha;
231  for ( alpha = 0; alpha < numAtoms; alpha ++ ) {
232  /* unfortunately we need {a,b} here, but
233  * the atoms only store {a^2, b^2, ab }
234  * so we need to invert this [module arbitrary relative sign)
235  */
236  REAL8 a2 = atoms->data[alpha].a2_alpha;
237  REAL8 b2 = atoms->data[alpha].b2_alpha;
238  REAL8 ab = atoms->data[alpha].ab_alpha;
239 
240  REAL8 a_by_2 = 0.5 * sqrt( a2 );
241  REAL8 b_by_2 = 0.5 * sqrt( b2 );
242  /* convention: always set sign on b */
243  if ( ab < 0 ) {
244  b_by_2 = - b_by_2;
245  }
246 
247  /* upper-left block */
248  gsl_matrix_set( Lcor, 0, 0, a_by_2 );
249  gsl_matrix_set( Lcor, 0, 1, a_by_2 );
250  gsl_matrix_set( Lcor, 1, 0, b_by_2 );
251  gsl_matrix_set( Lcor, 1, 1, b_by_2 );
252  /* lower-right block: +2 on all components */
253  gsl_matrix_set( Lcor, 2, 2, a_by_2 );
254  gsl_matrix_set( Lcor, 2, 3, a_by_2 );
255  gsl_matrix_set( Lcor, 3, 2, b_by_2 );
256  gsl_matrix_set( Lcor, 3, 3, b_by_2 );
257 
258  if ( XLALDrawCorrelatedNoise( n_mu, Lcor, rng ) != XLAL_SUCCESS ) {
259  XLALPrintError( "%s: failed to XLALDrawCorrelatedNoise().\n", __func__ );
261  }
262  REAL8 x1, x2, x3, x4;
263  x1 = n_mu[0];
264  x2 = n_mu[1];
265  x3 = n_mu[2];
266  x4 = n_mu[3];
267 
268  /* add this to Fstat-atom */
269  /* relation Fa,Fb <--> x_mu: see Eq.(72) in CFSv2-LIGO-T0900149-v2.pdf */
270  atoms->data[alpha].Fa_alpha += crectf( x1, - x3 );
271  atoms->data[alpha].Fb_alpha += crectf( x2, - x4 );
272 
273  } /* for i < numAtoms */
274 
275  /* free internal memory */
276  gsl_matrix_free( Lcor );
277 
278  return XLAL_SUCCESS;
279 
280 } /* XLALAddNoiseToFstatAtomVector() */
281 
282 
283 /**
284  * Add Gaussian-noise components to given multi-FstatAtomVector
285  */
286 int
287 XLALAddNoiseToMultiFstatAtomVector( MultiFstatAtomVector *multiAtoms, /**< input multi atoms-vector, noise will be added to this */
288  gsl_rng *rng /**< random-number generator */
289  )
290 {
291  /* check input consistency */
292  if ( !multiAtoms || !multiAtoms->data ) {
293  XLALPrintError( "%s: invalid NULL input in 'multiAtoms'\n", __func__ );
295  }
296  if ( !rng ) {
297  XLALPrintError( "%s: invalid NULL input for random-number generator 'rng'\n", __func__ );
299  }
300 
301  UINT4 numDetectors = multiAtoms->length;
302 
303  UINT4 X;
304  for ( X = 0; X < numDetectors; X ++ ) {
305  if ( XLALAddNoiseToFstatAtomVector( multiAtoms->data[X], rng ) != XLAL_SUCCESS ) {
306  XLALPrintError( "%s: XLALAddNoiseToFstatAtomVector() failed.\n", __func__ );
308  }
309 
310  } /* for X < numDetectors */
311 
312  return XLAL_SUCCESS;
313 
314 } /* XLALSynthesizeMultiFstatAtomVector4Noise() */
315 
316 
317 /**
318  * Add signal s_mu = M_mu_nu A^nu within the given transient-window
319  * to given atoms.
320  *
321  * RETURN: SNR^2 of the injected signal
322  * and the effective AntennaPatternMatrix M_mu_nu for this signal.
323  */
324 REAL8
325 XLALAddSignalToFstatAtomVector( FstatAtomVector *atoms, /**< [in/out] atoms vectors containing antenna-functions and possibly noise {Fa,Fb} */
326  AntennaPatternMatrix *M_mu_nu, /**< [out] effective antenna-pattern matrix for the injected signal */
327  const PulsarAmplitudeVect A_Mu, /**< [in] input canonical amplitude vector A^mu = {A1,A2,A3,A4} */
328  transientWindow_t transientWindow /**< transient signal window */
329  )
330 {
331  int gslstat;
332 
333  /* check input consistency */
334  if ( !atoms || !atoms->data ) {
335  XLALPrintError( "%s: Invalid NULL input 'atoms'\n", __func__ );
337  }
338  if ( !M_mu_nu ) {
339  XLALPrintError( "%s: Invalid NULL input 'M_mu_nu'\n", __func__ );
341  }
342 
343  /* prepare transient-window support */
344  UINT4 t0, t1;
345  if ( XLALGetTransientWindowTimespan( &t0, &t1, transientWindow ) != XLAL_SUCCESS ) {
346  XLALPrintError( "%s: XLALGetTransientWindowTimespan() failed.\n", __func__ );
348  }
349 
350  /* prepare gsl-matrix for Mh_mu_nu = [ a^2, a*b ; a*b , b^2 ] */
351  gsl_matrix *Mh_mu_nu;
352  if ( ( Mh_mu_nu = gsl_matrix_calloc( 4, 4 ) ) == NULL ) {
353  XLALPrintError( "%s: gsl_matrix_calloc ( 4, 4 ) failed.\n", __func__ );
355  }
356 
357  gsl_vector_const_view A_Mu_view = gsl_vector_const_view_array( A_Mu, 4 );
358 
359  REAL8 TAtom = atoms->TAtom;
360  UINT4 numAtoms = atoms->length;
361  UINT4 alpha;
362  REAL8 Ap = 0, Bp = 0, Cp = 0; // "effective" transient-CW antenna-pattern matrix M'_mu_nu
363 
364  for ( alpha = 0; alpha < numAtoms; alpha ++ ) {
365  UINT4 ti = atoms->data[alpha].timestamp;
366  REAL8 win = XLALGetTransientWindowValue( ti, t0, t1, transientWindow.tau, transientWindow.type );
367 
368  if ( win == 0 ) {
369  continue;
370  }
371 
372  /* compute sh_mu = sqrt(gamma/2) * Mh_mu_nu A^nu * win, where Mh_mu_nu is now just
373  * the per-atom block matrix [a^2, ab; ab, b^2 ]
374  * where Sn=1, so gamma = Sinv*TAtom = TAtom
375  */
376  // NOTE: for sh_mu: only LINEAR in window-function, NOT quadratic! -> see notes
377  REAL8 a2 = win * atoms->data[alpha].a2_alpha;
378  REAL8 b2 = win * atoms->data[alpha].b2_alpha;
379  REAL8 ab = win * atoms->data[alpha].ab_alpha;
380 
381  // we also compute M'_mu_nu, which will be used to estimate optimal SNR
382  // NOTE: M'_mu_nu is QUADRATIC in window-function!, so we multiply by win again
383  Ap += win * a2;
384  Bp += win * b2;
385  Cp += win * ab;
386 
387  /* upper-left block */
388  gsl_matrix_set( Mh_mu_nu, 0, 0, a2 );
389  gsl_matrix_set( Mh_mu_nu, 1, 1, b2 );
390  gsl_matrix_set( Mh_mu_nu, 0, 1, ab );
391  gsl_matrix_set( Mh_mu_nu, 1, 0, ab );
392  /* lower-right block: +2 on all components */
393  gsl_matrix_set( Mh_mu_nu, 2, 2, a2 );
394  gsl_matrix_set( Mh_mu_nu, 3, 3, b2 );
395  gsl_matrix_set( Mh_mu_nu, 2, 3, ab );
396  gsl_matrix_set( Mh_mu_nu, 3, 2, ab );
397 
398  /* placeholder for 4-vector sh_mu */
399  PulsarAmplitudeVect sh_mu = {0, 0, 0, 0};
400  gsl_vector_view sh_mu_view = gsl_vector_view_array( sh_mu, 4 );
401 
402  /* int gsl_blas_dgemv (CBLAS_TRANSPOSE_t TransA, double alpha, const gsl_matrix * A, const gsl_vector * x, double beta, gsl_vector * y)
403  * compute the matrix-vector product and sum y = \alpha op(A) x + \beta y, where op(A) = A, A^T, A^H
404  * for TransA = CblasNoTrans, CblasTrans, CblasConjTrans.
405  *
406  * sh_mu = sqrt(gamma/2) * Mh_mu_nu A^nu, where here gamma = TAtom, as Sinv=1 for multi-IFO value, and weights for SinvX!=1 have already been absorbed in atoms through XLALComputeMultiAMCoeffs()
407  */
408  REAL8 norm_s = sqrt( TAtom / 2.0 );
409  if ( ( gslstat = gsl_blas_dgemv( CblasNoTrans, norm_s, Mh_mu_nu, &A_Mu_view.vector, 0.0, &sh_mu_view.vector ) ) != 0 ) {
410  XLALPrintError( "%s: gsl_blas_dgemv(L * norm) failed: %s\n", __func__, gsl_strerror( gslstat ) );
412  }
413 
414  /* add this signal to the atoms, using the relation Fa,Fb <--> x_mu: see Eq.(72) in CFSv2-LIGO-T0900149-v2.pdf */
415  REAL8 s1, s2, s3, s4;
416  s1 = sh_mu[0];
417  s2 = sh_mu[1];
418  s3 = sh_mu[2];
419  s4 = sh_mu[3];
420 
421  atoms->data[alpha].Fa_alpha += crectf( s1, - s3 );
422  atoms->data[alpha].Fb_alpha += crectf( s2, - s4 );
423 
424  } /* for alpha < numAtoms */
425 
426  /* compute optimal SNR^2 expected for this signal,
427  * using rho2 = A^mu M'_mu_nu A^nu = T/Sn( A' [A1^2+A3^2] + 2C' [A1A2 +A3A4] + B' [A2^2+A4^2])
428  * NOTE: here we use the "effective" transient-CW antenna-pattern matrix M'_mu_nu
429  */
430  REAL8 A1 = A_Mu[0];
431  REAL8 A2 = A_Mu[1];
432  REAL8 A3 = A_Mu[2];
433  REAL8 A4 = A_Mu[3];
434 
435  REAL8 rho2 = TAtom * ( Ap * ( SQ( A1 ) + SQ( A3 ) ) + 2.0 * Cp * ( A1 * A2 + A3 * A4 ) + Bp * ( SQ( A2 ) + SQ( A4 ) ) );
436 
437  /* return "effective" transient antenna-pattern matrix */
438  M_mu_nu->Sinv_Tsft = TAtom; /* everything here in units of Sn, so effectively Sn=1 */
439  M_mu_nu->Ad = Ap;
440  M_mu_nu->Bd = Bp;
441  M_mu_nu->Cd = Cp;
442  M_mu_nu->Dd = Ap * Bp - Cp * Cp;
443 
444  /* free memory */
445  gsl_matrix_free( Mh_mu_nu );
446 
447  /* return SNR^2 */
448  return rho2;
449 
450 } /* XLALAddSignalToFstatAtomVector() */
451 
452 
453 /**
454  * Add given signal s_mu = M_mu_nu A^nu within the given transient-window
455  * to multi-IFO noise-atoms.
456  *
457  * RETURN: SNR^2 of the injected signal
458  * and the effective AntennaPatternMatrix M_mu_nu for this signal.
459  */
460 REAL8
461 XLALAddSignalToMultiFstatAtomVector( MultiFstatAtomVector *multiAtoms, /**< [in/out] multi atoms vectors containing antenna-functions and possibly noise {Fa,Fb} */
462  AntennaPatternMatrix *M_mu_nu, /**< [out] effective multi-IFO antenna-pattern matrix for the injected signal */
463  const PulsarAmplitudeVect A_Mu, /**< [in] input canonical amplitude vector A^mu = {A1,A2,A3,A4} */
464  transientWindow_t transientWindow, /**< [in] transient signal window */
465  INT4 lineX /**< [in] if >= 0: generate signal only for detector 'lineX': must be within 0,...(Ndet-1) */
466  )
467 {
468  /* check input consistency */
469  if ( !multiAtoms || !multiAtoms->data ) {
470  XLALPrintError( "%s: Invalid NULL input 'multiAtoms'\n", __func__ );
472  }
473  if ( !M_mu_nu ) {
474  XLALPrintError( "%s: Invalid NULL input 'M_mu_nu'\n", __func__ );
476  }
477 
478  UINT4 numDet = multiAtoms->length;
479  XLAL_CHECK( ( lineX < 0 ) || ( ( UINT4 )lineX < numDet ), XLAL_EINVAL, "Inconsistent input of lineX = %d, not within 0 ... Ndet-1 (= %d)\n", lineX, numDet );
480 
481  UINT4 X;
482  REAL8 rho2 = 0;
483  XLAL_INIT_MEM( ( *M_mu_nu ) );
484 
485  for ( X = 0; X < numDet; X ++ ) {
486  REAL8 rho2X;
487  AntennaPatternMatrix M_mu_nu_X;
488  PulsarAmplitudeVect A0_Mu = {0, 0, 0, 0}; // zero amplitude signal for simulating single-IFO line
489 
490  if ( ( lineX >= 0 ) && ( ( UINT4 )lineX != X ) ) {
491  rho2X = XLALAddSignalToFstatAtomVector( multiAtoms->data[X], &M_mu_nu_X, A0_Mu, transientWindow ); // zero-signal injection
492  } else {
493  rho2X = XLALAddSignalToFstatAtomVector( multiAtoms->data[X], &M_mu_nu_X, A_Mu, transientWindow ); // actual signal injection
494  }
496 
497  rho2 += rho2X; /* multi-IFO SNR^2 = sum_X SNR_X^2 */
498  M_mu_nu->Ad += M_mu_nu_X.Ad; /* multi-IFO M_mu_nu = sum_X M_mu_nu_X */
499  M_mu_nu->Bd += M_mu_nu_X.Bd;
500  M_mu_nu->Cd += M_mu_nu_X.Cd;
501 
502  M_mu_nu->Sinv_Tsft += M_mu_nu_X.Sinv_Tsft; /* noise adds harmonically 1/S = sum_X (1/S_X) */
503 
504  } /* for X < numDet */
505 
506  /* update sub-determinant */
507  M_mu_nu->Dd = M_mu_nu->Ad * M_mu_nu->Bd - SQ( M_mu_nu->Cd );
508 
509  /* return SNR^2 */
510  return rho2;
511 
512 } /* XLALAddSignalToMultiFstatAtomVector() */
513 
514 /**
515  * Generates a multi-Fstat atoms vector for given parameters, drawing random parameters wherever required.
516  *
517  * Input: detector states, signal sky-pos (or allsky), amplitudes (or range), transient window range
518  *
519  */
521 XLALSynthesizeTransientAtoms( InjParams_t *injParamsOut, /**< [out] return summary of injected signal parameters (can be NULL) */
522  SkyPosition skypos, /**< (Alpha,Delta,system). Use Alpha < 0 to signal 'allsky' */
523  AmplitudePrior_t AmpPrior, /**< [in] amplitude-parameter priors to draw signals from */
524  transientWindowRange_t transientInjectRange, /**< transient-window range for injections (flat priors) */
525  const MultiDetectorStateSeries *multiDetStates, /**< [in] multi-detector state series covering observation time */
526  BOOLEAN SignalOnly, /**< [in] switch to generate signal draws without noise */
527  multiAMBuffer_t *multiAMBuffer, /**< [in/out] buffer for AM-coefficients if re-using same skyposition (must be !=NULL) */
528  gsl_rng *rng, /**< [in/out] gsl random-number generator */
529  INT4 lineX, /**< [in] if >= 0: generate signal only for detector 'lineX': must be within 0,...(Ndet-1) */
530  const MultiNoiseWeights *multiNoiseWeights /** [in] per-detector noise weights SX^-1/S^-1, no per-SFT variation (can be NULL for unit weights) */
531  )
532 {
533  REAL8 h0, cosi;
534 
535  /* check input */
536  XLAL_CHECK_NULL( rng && multiAMBuffer && multiDetStates, XLAL_EINVAL, "Invalid NULL input!\n" );
537  XLAL_CHECK_NULL( !multiNoiseWeights || multiNoiseWeights->data, XLAL_EINVAL, "Invalid NULL input for multiNoiseWeights->data!\n" );
538 
539  /* ----- if Alpha < 0 ==> draw skyposition isotropically from all-sky */
540  if ( skypos.longitude < 0 ) {
541  skypos.longitude = gsl_ran_flat( rng, 0, LAL_TWOPI ); /* alpha uniform in [ 0, 2pi ] */
542  skypos.latitude = acos( gsl_ran_flat( rng, -1, 1 ) ) - LAL_PI_2; /* cos(delta) uniform in [ -1, 1 ] */
544  /* never re-using buffered AM-coeffs here, as we randomly draw new skypositions */
545  if ( multiAMBuffer->multiAM ) {
546  XLALDestroyMultiAMCoeffs( multiAMBuffer->multiAM );
547  }
548  multiAMBuffer->multiAM = NULL;
549  } /* if random skypos to draw */
550  else { /* otherwise: re-use AM-coeffs if already computed, or initialize them if for the first time */
551  if ( multiAMBuffer->multiAM )
552  if ( multiAMBuffer->skypos.longitude != skypos.longitude ||
553  multiAMBuffer->skypos.latitude != skypos.latitude ||
554  multiAMBuffer->skypos.system != skypos.system ) {
555  XLALDestroyMultiAMCoeffs( multiAMBuffer->multiAM );
556  multiAMBuffer->multiAM = NULL;
557  }
558  } /* if single skypos given */
559 
560  /* ----- generate antenna-pattern functions for this sky-position */
561  if ( !multiAMBuffer->multiAM && ( multiAMBuffer->multiAM = XLALComputeMultiAMCoeffs( multiDetStates, multiNoiseWeights, skypos ) ) == NULL ) {
562  XLALPrintError( "%s: XLALComputeMultiAMCoeffs() failed with xlalErrno = %d\n", __func__, xlalErrno );
564  }
565  multiAMBuffer->skypos = skypos; /* store buffered skyposition */
566 
567  /* ----- generate a pre-initialized F-stat atom vector containing only the antenna-pattern coefficients */
568  MultiFstatAtomVector *multiAtoms;
569  if ( ( multiAtoms = XLALGenerateMultiFstatAtomVector( multiDetStates, multiAMBuffer->multiAM ) ) == NULL ) {
570  XLALPrintError( "%s: XLALGenerateMultiFstatAtomVector() failed with xlalErrno = %d\n", __func__, xlalErrno );
572  }
573 
574  /* ----- draw amplitude vector A^mu from given ranges in {h0, cosi, psi, phi0} */
576  if ( AmpPrior.fixedSNR > 0 ) { /* special treatment of fixed-SNR: use h0=1, later rescale signal */
577  h0 = 1.0;
578  } else if ( AmpPrior.fixedSNR == 0 ) { /* same as setting h0 = 0 */
579  h0 = 0;
580  } else { /* otherwise, draw from h0-prior */
581  h0 = XLALDrawFromPDF1D( AmpPrior.pdf_h0Nat, rng );
582  }
583 
584  cosi = XLALDrawFromPDF1D( AmpPrior.pdf_cosi, rng );
585  Amp.aPlus = 0.5 * h0 * ( 1.0 + SQ( cosi ) );
586  Amp.aCross = h0 * cosi;
587  Amp.psi = XLALDrawFromPDF1D( AmpPrior.pdf_psi, rng );
588  Amp.phi0 = XLALDrawFromPDF1D( AmpPrior.pdf_phi0, rng );
589 
590  /* convert amplitude params to 'canonical' vector coordinates */
591  PulsarAmplitudeVect A_Mu;
592  if ( XLALAmplitudeParams2Vect( A_Mu, Amp ) != XLAL_SUCCESS ) {
593  XLALPrintError( "%s: XLALAmplitudeParams2Vect() failed with xlalErrno = %d\n", __func__, xlalErrno );
595  }
596 
597  /* ----- draw transient-window parameters from given ranges using flat priors */
598  transientWindow_t XLAL_INIT_DECL( injectWindow );
599  injectWindow.type = transientInjectRange.type;
600  if ( injectWindow.type != TRANSIENT_NONE ) { /* nothing to be done if no window */
601  injectWindow.t0 = ( UINT4 ) gsl_ran_flat( rng, transientInjectRange.t0, transientInjectRange.t0 + transientInjectRange.t0Band );
602  injectWindow.tau = ( UINT4 ) gsl_ran_flat( rng, transientInjectRange.tau, transientInjectRange.tau + transientInjectRange.tauBand );
603  }
604 
605  /* ----- add transient signal to the Fstat atoms */
606  AntennaPatternMatrix M_mu_nu;
607  REAL8 rho2 = XLALAddSignalToMultiFstatAtomVector( multiAtoms, &M_mu_nu, A_Mu, injectWindow, lineX );
608  if ( xlalErrno ) {
609  XLALPrintError( "%s: XLALAddSignalToMultiFstatAtomVector() failed with xlalErrno = %d\n", __func__, xlalErrno );
611  }
612 
613  /* ----- special signal rescaling if 1) fixedSNR OR 2) fixed rhohMax */
614  REAL8 detM1o8 = sqrt( M_mu_nu.Sinv_Tsft ) * pow( M_mu_nu.Dd, 0.25 ); // (detM)^(1/8) = sqrt(Tsft/Sn) * (Dp)^(1/4)
615 
616  /* 1) if fixedSNR signal is requested: rescale everything to the desired SNR now */
617  if ( ( AmpPrior.fixedSNR > 0 ) || AmpPrior.fixRhohMax ) {
618  if ( ( AmpPrior.fixedSNR > 0 ) && AmpPrior.fixRhohMax ) { /* double-check consistency: only one is allowed */
619  XLALPrintError( "%s: Something went wrong: both [fixedSNR = %f > 0] and [fixedRhohMax==true] are not allowed!\n", __func__, AmpPrior.fixedSNR );
621  }
622 
623  REAL8 rescale = 1.0;
624 
625  if ( AmpPrior.fixedSNR > 0 ) {
626  rescale = AmpPrior.fixedSNR / sqrt( rho2 ); // rescale atoms by this factor, such that SNR = fixedSNR
627  }
628  if ( AmpPrior.fixRhohMax ) {
629  rescale = 1.0 / detM1o8; // we drew h0 in [0, rhohMax], so we now need to rescale as h0Max = rhohMax/(detM)^(1/8)
630  }
631 
632  if ( XLALRescaleMultiFstatAtomVector( multiAtoms, rescale ) != XLAL_SUCCESS ) { /* rescale atoms */
633  XLALPrintError( "%s: XLALRescaleMultiFstatAtomVector() failed with xlalErrno = %d\n", __func__, xlalErrno );
635  }
636 
637  Amp.aPlus *= rescale; /* rescale amplitude-params for consistency */
638  Amp.aCross *= rescale;
639  UINT4 i;
640  for ( i = 0; i < 4; i ++ ) {
641  A_Mu[i] *= rescale;
642  }
643 
644  rho2 *= SQ( rescale ); /* rescale reported optimal SNR */
645 
646  } /* if fixedSNR > 0 OR fixedRhohMax */
647 
648  /* ----- add noise to the Fstat atoms, unless --SignalOnly was specified */
649  if ( !SignalOnly )
650  if ( XLALAddNoiseToMultiFstatAtomVector( multiAtoms, rng ) != XLAL_SUCCESS ) {
651  XLALPrintError( "%s: XLALAddNoiseToMultiFstatAtomVector() failed with xlalErrno = %d\n", __func__, xlalErrno );
653  }
654 
655  /* ----- if requested: return all inject signal parameters */
656  if ( injParamsOut ) {
657  injParamsOut->skypos = skypos;
658  injParamsOut->ampParams = Amp;
659  UINT4 i;
660  for ( i = 0; i < 4; i ++ ) {
661  injParamsOut->ampVect[i] = A_Mu[i];
662  }
663  injParamsOut->multiAM = *multiAMBuffer->multiAM;
664  injParamsOut->transientWindow = injectWindow;
665  injParamsOut->SNR = sqrt( rho2 );
666  injParamsOut->detM1o8 = detM1o8;
667  } /* if injParamsOut */
668 
669 
670  return multiAtoms;
671 
672 } /* XLALSynthesizeTransientAtoms() */
673 
674 /**
675  * Rescale a given multi-Fstat atoms vector {Fa,Fb} by given scalar factor.
676  * This is used to rescale signal atoms to desired fixed SNR.
677  */
678 int
679 XLALRescaleMultiFstatAtomVector( MultiFstatAtomVector *multiAtoms, /**< [in/out] multi atoms vectors containing a signal in {Fa,Fb} to be rescaled */
680  REAL8 rescale /**< rescale factor: Fa' = rescale * Fa, and Fb'= rescale * Fb */
681  )
682 {
683  /* check input */
684  if ( !multiAtoms ) {
685  XLALPrintError( "%s: invalid NULL input 'multiAtoms'\n", __func__ );
687  }
688 
689  UINT4 numDet = multiAtoms->length;
690  UINT4 X;
691 
692  for ( X = 0; X < numDet; X ++ ) {
693  FstatAtomVector *atoms = multiAtoms->data[X];
694  UINT4 numAtoms = atoms->length;
695  UINT4 i;
696  for ( i = 0; i < numAtoms; i ++ ) {
697  FstatAtom *thisAtom = &atoms->data[i];
698 
699  thisAtom->Fa_alpha *= ( ( REAL4 ) rescale );
700 
701  thisAtom->Fb_alpha *= ( ( REAL4 ) rescale );
702 
703  } /* for i < numAtoms */
704 
705  } /* for X < numDet */
706 
707  return XLAL_SUCCESS;
708 
709 } /* XLALRescaleMultiFstatAtomVector() */
710 
711 
712 /**
713  * Write an injection-parameters structure to the given file-pointer,
714  * adding one line with the injection parameters
715  */
716 int
717 write_InjParams_to_fp( FILE *fp, /**< [in] file-pointer to output file */
718  const InjParams_t *par, /**< [in] injection params to write. NULL means write header-comment line */
719  const UINT4 dataStartGPS, /**< [in] data start-time in GPS seconds (used to turn window 't0' into offset from dataStartGPS) */
720  const BOOLEAN outputMmunuX, /**< [in] write per-IFO antenna pattern matrices? */
721  const UINT4 numDetectors /**< [in] number of detectors, only needed to construct M_mu_nu_X_header_string */
722  )
723 {
724  /* input consistency */
725  if ( ! fp ) {
726  XLALPrintError( "%s: invalid NULL input 'fp'\n", __func__ );
728  }
729 
730  int ret;
731  /* if requested, write header-comment line */
732  if ( par == NULL ) {
733  char M_mu_nu_X_header_string[256] = "";
734  if ( outputMmunuX ) {
735  char buf0[256];
736  for ( UINT4 X = 0; X < numDetectors ; X ++ ) {
737  snprintf( buf0, sizeof( buf0 ), " AdX[%d] BdX[%d] CdX[%d] DdX[%d]", X, X, X, X );
738  strcat( M_mu_nu_X_header_string, buf0 );
739  }
740  }
741  ret = fprintf( fp, "%%%%Alpha Delta SNR h0 cosi psi phi0 A1 A2 A3 A4 Ad Bd Cd Dd t0[d] tau[d] type (detMp)^(1/8)%s\n", M_mu_nu_X_header_string );
742  if ( ret < 0 ) {
743  XLALPrintError( "%s: failed to fprintf() to given file-pointer 'fp'.\n", __func__ );
744  XLAL_ERROR( XLAL_EIO );
745  }
746 
747  return XLAL_SUCCESS; /* we're done here */
748 
749  } /* if par == NULL */
750 
751  REAL8 t0_d = 1.0 * ( par->transientWindow.t0 - dataStartGPS ) / DAY24;
752  REAL8 tau_d = 1.0 * par->transientWindow.tau / DAY24;
753 
754  char M_mu_nu_X_string[256] = "";
755  if ( outputMmunuX ) {
756  if ( par->multiAM.length != numDetectors ) {
757  XLALPrintError( "%s: length of multiAM different than numDetectors (%d!=%d).\n", __func__, par->multiAM.length, numDetectors );
759  }
760  strcat( M_mu_nu_X_string, " " );
761  char buf0[256];
762  for ( UINT4 X = 0; X < numDetectors ; X ++ ) {
763  snprintf( buf0, sizeof( buf0 ), " %10.5g %10.5g %10.5g %10.5g", par->multiAM.data[X]->A, par->multiAM.data[X]->B, par->multiAM.data[X]->C, par->multiAM.data[X]->D );
764  strcat( M_mu_nu_X_string, buf0 );
765  }
766  }
767 
768  /* since the user inputs for codes using this module are typically in (h0,cosi),
769  * write out parameters in the same variables
770  */
771  REAL8 h0, cosi;
772  h0 = par->ampParams.aPlus + sqrt( SQ( par->ampParams.aPlus ) - SQ( par->ampParams.aCross ) );
773  if ( h0 > 0 ) {
774  cosi = par->ampParams.aCross / h0;
775  } else {
776  cosi = 0;
777  }
778 
779  /* if injParams given, output them to the file */
780  ret = fprintf( fp, " %5.3f %6.3f %6.3f %7.3g %6.3f %6.3f %6.3f % 9.3g % 9.3g % 9.3g % 9.3g %10.5g %10.5g %10.5g %10.5g %9.3f %9.3f %1d %9.3g%s\n",
781  par->skypos.longitude, par->skypos.latitude, /* skypos */
782  par->SNR, /* SNR */
783  h0, cosi, par->ampParams.psi, par->ampParams.phi0, /* amplitude params {h0,cosi,psi,phi0} */
784  par->ampVect[0], par->ampVect[1], par->ampVect[2], par->ampVect[3], /* ampltiude vector A^mu */
785  par->multiAM.Mmunu.Ad, par->multiAM.Mmunu.Bd, par->multiAM.Mmunu.Cd, par->multiAM.Mmunu.Dd, /* antenna-pattern matrix components */
786  t0_d, tau_d, par->transientWindow.type, /* transient-window params */
787  par->detM1o8, /* rescale parameter (detMp)^(1/8) */
788  M_mu_nu_X_string /* optional output string for per-IFO antenna pattern matrices */
789  );
790  if ( ret < 0 ) {
791  XLALPrintError( "%s: failed to fprintf() to given file-pointer 'fp'.\n", __func__ );
792  XLAL_ERROR( XLAL_EIO );
793  }
794 
795  return XLAL_SUCCESS;
796 
797 } /* write_InjParams_to_fp() */
798 
799 /// @}
#define __func__
log an I/O error, i.e.
const double b2
#define L(i, j)
REAL8 XLALDrawFromPDF1D(pdf1D_t *pdf, const gsl_rng *rng)
Function to generate random samples drawn from the given pdf(x) NOTE: if the 'sampling' field is NULL...
#define fprintf
#define SQ(x)
const double s3
const double a2
const double rho2
FstatAtomVector * XLALCreateFstatAtomVector(const UINT4 length)
Create a FstatAtomVector of the given length.
Definition: ComputeFstat.c:276
void XLALDestroyMultiFstatAtomVector(MultiFstatAtomVector *multiAtoms)
Free all memory associated with a MultiFstatAtomVector structure.
Definition: ComputeFstat.c:338
int XLALAmplitudeParams2Vect(PulsarAmplitudeVect A_Mu, const PulsarAmplitudeParams Amp)
Convert amplitude params from 'physical' coordinates into 'canonical' coordinates .
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_PI_2
#define LAL_TWOPI
unsigned char BOOLEAN
#define XLAL_INIT_MEM(x)
double REAL8
#define XLAL_INIT_DECL(var,...)
#define crectf(re, im)
uint32_t UINT4
int32_t INT4
float REAL4
void * XLALCalloc(size_t m, size_t n)
void XLALFree(void *p)
REAL8 PulsarAmplitudeVect[4]
Struct for 'canonical' coordinates in amplitude-params space A^mu = {A1, A2, A3, A4}.
@ TRANSIENT_NONE
Note: in this case the window-parameters will be ignored, and treated as rect={data},...
static const INT4 a
COORDINATESYSTEM_EQUATORIAL
FstatAtomVector * XLALGenerateFstatAtomVector(const DetectorStateSeries *detStates, const AMCoeffs *amcoeffs)
Generate an FstatAtomVector for given antenna-pattern functions.
int XLALAddNoiseToMultiFstatAtomVector(MultiFstatAtomVector *multiAtoms, gsl_rng *rng)
Add Gaussian-noise components to given multi-FstatAtomVector.
REAL8 XLALAddSignalToMultiFstatAtomVector(MultiFstatAtomVector *multiAtoms, AntennaPatternMatrix *M_mu_nu, const PulsarAmplitudeVect A_Mu, transientWindow_t transientWindow, INT4 lineX)
Add given signal s_mu = M_mu_nu A^nu within the given transient-window to multi-IFO noise-atoms.
int write_InjParams_to_fp(FILE *fp, const InjParams_t *par, const UINT4 dataStartGPS, const BOOLEAN outputMmunuX, const UINT4 numDetectors)
Write an injection-parameters structure to the given file-pointer, adding one line with the injection...
MultiFstatAtomVector * XLALGenerateMultiFstatAtomVector(const MultiDetectorStateSeries *multiDetStates, const MultiAMCoeffs *multiAM)
Generate a multi-FstatAtomVector for given antenna-pattern functions.
MultiFstatAtomVector * XLALSynthesizeTransientAtoms(InjParams_t *injParamsOut, SkyPosition skypos, AmplitudePrior_t AmpPrior, transientWindowRange_t transientInjectRange, const MultiDetectorStateSeries *multiDetStates, BOOLEAN SignalOnly, multiAMBuffer_t *multiAMBuffer, gsl_rng *rng, INT4 lineX, const MultiNoiseWeights *multiNoiseWeights)
Generates a multi-Fstat atoms vector for given parameters, drawing random parameters wherever require...
int XLALRescaleMultiFstatAtomVector(MultiFstatAtomVector *multiAtoms, REAL8 rescale)
Rescale a given multi-Fstat atoms vector {Fa,Fb} by given scalar factor.
int XLALAddNoiseToFstatAtomVector(FstatAtomVector *atoms, gsl_rng *rng)
Add Gaussian-noise components to given FstatAtomVector.
int XLALDrawCorrelatedNoise(PulsarAmplitudeVect n_mu, const gsl_matrix *L, gsl_rng *rng)
Generate 4 random-noise draws n_mu = {n_1, n_2, n_3, n_4} with correlations according to the matrix M...
REAL8 XLALAddSignalToFstatAtomVector(FstatAtomVector *atoms, AntennaPatternMatrix *M_mu_nu, const PulsarAmplitudeVect A_Mu, transientWindow_t transientWindow)
Add signal s_mu = M_mu_nu A^nu within the given transient-window to given atoms.
int XLALGetTransientWindowTimespan(UINT4 *t0, UINT4 *t1, transientWindow_t transientWindow)
Helper-function to determine the total timespan of a transient CW window, ie.
#define DAY24
standard 24h day = 86400 seconds ==> this is what's used in the definition of 'tauDays'
static REAL8 XLALGetTransientWindowValue(UINT4 timestamp, UINT4 t0, UINT4 t1, UINT4 tau, transientWindowType_t type)
Function to compute the value of a given transient-window function at a given timestamp.
#define XLAL_ERROR_REAL8(...)
#define XLAL_ERROR_NULL(...)
#define xlalErrno
#define XLAL_ERROR(...)
#define XLAL_CHECK(assertion,...)
int XLALPrintError(const char *fmt,...) _LAL_GCC_PRINTF_FORMAT_(1
#define XLAL_CHECK_REAL8(assertion,...)
#define XLAL_CHECK_NULL(assertion,...)
XLAL_ENOMEM
XLAL_SUCCESS
XLAL_EFUNC
XLAL_EDOM
XLAL_EIO
XLAL_EINVAL
XLAL_EFAILED
n
double alpha
size_t numDetectors
double t0
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
Signal (amplitude) parameter ranges.
pdf1D_t * pdf_h0Nat
pdf for h0/sqrt{Sn}
REAL8 fixedSNR
alternative 1: adjust h0 to fix the optimal SNR of the signal
BOOLEAN fixRhohMax
alternative 2: draw h0 with fixed rhohMax = h0Max * (detM)^(1/8) <==> canonical Fstat prior
pdf1D_t * pdf_phi0
pdf(phi0)
pdf1D_t * pdf_cosi
pdf(cosi)
pdf1D_t * pdf_psi
pdf(psi)
Struct holding the "antenna-pattern" matrix , in terms of the multi-detector scalar product.
Definition: LALComputeAM.h:127
REAL8 Sinv_Tsft
normalization-factor (using single-sided PSD!)
Definition: LALComputeAM.h:133
REAL4 Dd
determinant factor , such that
Definition: LALComputeAM.h:132
LIGOTimeGPS tGPS
GPS timestamps corresponding to this entry.
Timeseries of DetectorState's, representing the detector-info at different timestamps.
REAL8 deltaT
timespan centered on each timestamp (e.g.
DetectorState * data
array of DetectorState entries
UINT4 length
total number of entries
An -statistic 'atom', i.e.
Definition: ComputeFstat.h:161
COMPLEX8 Fa_alpha
.
Definition: ComputeFstat.h:166
REAL4 b2_alpha
Antenna-pattern factor .
Definition: ComputeFstat.h:164
UINT4 timestamp
SFT GPS timestamp in seconds.
Definition: ComputeFstat.h:162
REAL4 ab_alpha
Antenna-pattern factor .
Definition: ComputeFstat.h:165
COMPLEX8 Fb_alpha
.
Definition: ComputeFstat.h:167
REAL4 a2_alpha
Antenna-pattern factor .
Definition: ComputeFstat.h:163
A vector of -statistic 'atoms', i.e.
Definition: ComputeFstat.h:174
UINT4 TAtom
Time-baseline of 'atoms', typically .
Definition: ComputeFstat.h:180
FstatAtom * data
Array of FstatAtom pointers of given length.
Definition: ComputeFstat.h:179
UINT4 length
Number of per-SFT 'atoms'.
Definition: ComputeFstat.h:178
Hold all (generally) randomly drawn injection parameters: skypos, amplitude-params,...
SkyPosition skypos
transientWindow_t transientWindow
PulsarAmplitudeParams ampParams
MultiAMCoeffs multiAM
PulsarAmplitudeVect ampVect
Multi-IFO container for antenna-pattern coefficients and atenna-pattern matrix .
Definition: LALComputeAM.h:137
UINT4 length
number of IFOs
Definition: LALComputeAM.h:138
AMCoeffs ** data
noise-weighted AM-coeffs , and
Definition: LALComputeAM.h:139
Multi-IFO time-series of DetectorStates.
UINT4 length
number of detectors
DetectorStateSeries ** data
vector of pointers to DetectorStateSeries
A multi-detector vector of FstatAtomVector.
Definition: ComputeFstat.h:186
FstatAtomVector ** data
Array of FstatAtomVector pointers, one for each detector X.
Definition: ComputeFstat.h:191
UINT4 length
Number of detectors.
Definition: ComputeFstat.h:190
One noise-weight (number) per SFT (therefore indexed over IFOs and SFTs.
Definition: PSDutils.h:71
REAL8Vector ** data
weights-vector for each detector
Definition: PSDutils.h:76
Type containing the JKS 'amplitude parameters' {h0, cosi, phi0, psi}.
REAL8 aCross
Signal amplitude (cross)
REAL8 psi
polarization angle psi
REAL8 aPlus
Signal amplitude (plus)
REAL8 phi0
initial signal-phase (at some reference time)
REAL4 * data
REAL8 longitude
REAL8 latitude
CoordinateSystem system
struct for buffering of AM-coeffs, if signal for same sky-position is injected
MultiAMCoeffs * multiAM
SkyPosition skypos
sky-position for which we have AM-coeffs computed already
Struct defining one transient window instance.
UINT4 tau
transient timescale tau in seconds
transientWindowType_t type
window-type: none, rectangular, exponential, ....
Struct defining a range of transient windows.
UINT4 tauBand
range of transient timescales tau to search, in seconds
UINT4 tau
shortest transient timescale tau in seconds
UINT4 t0
earliest GPS start-time 't0' in seconds
transientWindowType_t type
window-type: none, rectangular, exponential, ....
UINT4 t0Band
range of start-times 't0' to search, in seconds