Loading [MathJax]/extensions/TeX/AMSsymbols.js
LALPulsar 7.1.1.1-8a6b96f
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
GeneratePulsarSignalTest.c
Go to the documentation of this file.
1/*
2* Copyright (C) 2007 Gregory Mendell, Jolien Creighton, 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/* NOTES: */
21/* 10/08/04 gam; fix indexing into trig lookup tables (LUTs) by having table go from -2*pi to 2*pi */
22/* 10/12/04 gam; include INCLUDE_SEQUENTIAL_MISMATCH to make make pulsar parameters more varied. */
23/* 10/12/04 gam; update error conditions. */
24/* 02/02/05 gam; if NOT pSFTandSignalParams->resTrig > 0 should not create trigArg etc... */
25/* 02/02/05 gam; fix warnings about setting ephemeris files pointers equal to constant strings and unused variables. */
26/* 09/07/05 gam; Add Dterms parameter to LALFastGeneratePulsarSFTs; use this to fill in SFT bins with fake data as per LALDemod else fill in bin with zero */
27
28/**
29 * \author Mendell, G.
30 * \file
31 * \ingroup GeneratePulsarSignal_h
32 *
33 * ### Usage ###
34 *
35 * \code
36 * GeneratePulsarSignalTest
37 * \endcode
38 *
39 * No command line options are currently supported. However, preprocessor flags
40 * can be set to print output for debugging purposes.
41 *
42 * ### Description ###
43 *
44 * This test program calls and compares the output from LALGeneratePulsarSignal()
45 * and LALSignalToSFTs() with the output from LALComputeSkyAndZeroPsiAMResponse()
46 * and LALFastGeneratePulsarSFTs() for a variety of signal parameters.
47 *
48 * The current code only compares the modulus of the output SFTs,
49 * not the phases.
50 *
51 * ### Notes ###
52 *
53 * See the pulsar search code in lalpulsar/bin for more
54 * example uses of the functions tested by this code.
55 *
56 */
57
58/** \name Error Codes */
59/** @{ */
60#define GENERATEPULSARSIGNALTESTC_ENORM 0 /**< Normal exit */
61#define GENERATEPULSARSIGNALTESTC_EIFO 1 /**< IFO not supported */
62#define GENERATEPULSARSIGNALTESTC_EMOD 2 /**< SFT max power from LALSignalToSFTs and LALFastGeneratePulsarSFTs differs */
63#define GENERATEPULSARSIGNALTESTC_EBIN 3 /**< SFT freq with max power from LALSignalToSFTs and LALFastGeneratePulsarSFTs differs by more than 1 bin */
64#define GENERATEPULSARSIGNALTESTC_EBINS 4 /**< SFTs freq with max power from LALSignalToSFTs and LALFastGeneratePulsarSFTs differs too often */
65/** @} */
66
67/** \cond DONT_DOXYGEN */
68#define GENERATEPULSARSIGNALTESTC_MSGENORM "Normal exit"
69#define GENERATEPULSARSIGNALTESTC_MSGEIFO "IFO not supported"
70#define GENERATEPULSARSIGNALTESTC_MSGEMOD "SFT max power from LALSignalToSFTs and LALFastGeneratePulsarSFTs differs"
71#define GENERATEPULSARSIGNALTESTC_MSGEBIN "SFT freq with max power from LALSignalToSFTs and LALFastGeneratePulsarSFTs differs by more than 1 bin"
72#define GENERATEPULSARSIGNALTESTC_MSGEBINS "SFTs freq with max power from LALSignalToSFTs and LALFastGeneratePulsarSFTs differs too often"
73
74
75/* preprocessor flags that control output */
76/* First two are used with PRINT_OUTPUTSFT
77 and PRINT_FASTOUTPUTSFT to specify which
78 SFT from which test to print to stdout */
79#define TESTNUMBER_TO_PRINT 1
80#define SFTINDEX_TO_PRINT 0
81/* #define PRINT_OUTPUTSFT */
82/* #define PRINT_FASTOUTPUTSFT */
83/* #define PRINT_MAXSFTPOWER */
84/* #define PRINT_MAXDIFFSFTPOWER */
85/* #define PRINT_DIFFATMAXPOWER */
86/* #define PRINT_ERRORATMAXPOWER */
87/* #define PRINT_OVERALLMAXDIFFSFTPOWER */
88#define INCLUDE_SEQUENTIAL_MISMATCH
89/* #define INCLUDE_RANDVAL_MISMATCH */
90
91
92#include <stdio.h>
93#include <string.h>
94#include <stdlib.h>
95#include <math.h>
96#include <lal/LALStdio.h>
97#include <lal/LALStdlib.h>
98#include <lal/LALConstants.h>
99#include <lal/StreamInput.h>
100#include <lal/AVFactories.h>
101#include <lal/SeqFactories.h>
102#include <lal/VectorOps.h>
103#include <lal/DetectorSite.h>
104#include <lal/Units.h>
105#include <lal/LALDatatypes.h>
106#include <lal/LALBarycenter.h>
107#include <lal/LALInitBarycenter.h>
108#include <lal/Date.h>
109#include <lal/GeneratePulsarSignal.h>
110#include <lal/Random.h>
111
112#ifdef __GNUC__
113#define UNUSED __attribute__ ((unused))
114#else
115#define UNUSED
116#endif
117
118/* prototype for function that runs the tests */
119/* void RunGeneratePulsarSignalTest(LALStatus *status, int argc, char **argv); */ /* 02/02/05 gam */
120void RunGeneratePulsarSignalTest( LALStatus *status );
121
122/* ********************************************************/
123/* */
124/* START FUNCTION: main */
125/* */
126/* ********************************************************/
127int main( int UNUSED argc, char **argv )
128{
129
130 static LALStatus status; /* status structure */
131
132
133 /* initialize status */
134 status.statusCode = 0;
135 status.statusPtr = NULL;
136 status.statusDescription = NULL;
137
138 /* Actual test are performed by this function */
139 /* RunGeneratePulsarSignalTest(&status,argc,argv); */ /* 02/02/05 gam */
140 RunGeneratePulsarSignalTest( &status );
141
142 if ( status.statusCode ) {
143 fprintf( stderr, "Error: statusCode = %i statusDescription = %s \n", status.statusCode, status.statusDescription );
144 return 1;
145 }
146
148
149 if ( lalDebugLevel & LALINFO ) {
150 XLALPrintError( "Info[0]: program %s, file %s, line %d, %s\n"
151 " %s\n", *argv, __FILE__, __LINE__,
152 "$Id$", ( GENERATEPULSARSIGNALTESTC_MSGENORM ) );
153 }
154
156}
157/* ********************************************************/
158/* */
159/* END FUNCTION: main */
160/* */
161/* ********************************************************/
162
163/* ********************************************************/
164/* */
165/* START FUNCTION: RunGeneratePulsarSignalTest */
166/* */
167/* ********************************************************/
168/* void RunGeneratePulsarSignalTest(LALStatus *status, int argc, char **argv) */ /* 02/02/05 gam */
169void RunGeneratePulsarSignalTest( LALStatus *status )
170{
171 INT4 i, j, k; /* all purpose indices */
172 INT4 iSky = 0; /* for loop over sky positions */
173 INT4 jDeriv = 0; /* for loop over spindowns */
174 INT4 testNumber = 0; /* which test is being run */
175
176 /* The input and output structs used by the functions being tested */
177 PulsarSignalParams *pPulsarSignalParams = NULL;
178 REAL4TimeSeries *signalvec = NULL;
179 SFTParams *pSFTParams = NULL;
180 SkyConstAndZeroPsiAMResponse *pSkyConstAndZeroPsiAMResponse;
181 SFTandSignalParams *pSFTandSignalParams;
182 SFTVector *outputSFTs = NULL;
183 SFTVector *fastOutputSFTs = NULL;
184 REAL4 renorm; /* to renormalize SFTs to account for different effective sample rates */
185
186 /* containers for detector and ephemeris data */
187 LALDetector cachedDetector;
188 CHAR IFO[6] = "LHO";
189 EphemerisData *edat = NULL;
190
191 char earthFile[] = TEST_PKG_DATA_DIR "earth00-40-DE405.dat.gz";
192 char sunFile[] = TEST_PKG_DATA_DIR "sun00-40-DE405.dat.gz";
193
194 /* containers for sky position and spindown data */
195 REAL8 **skyPosData;
196 REAL8 **freqDerivData;
197 INT4 numSkyPosTotal = 8;
198 INT4 numSpinDown = 1;
199 INT4 numFreqDerivTotal = 2;
200 INT4 numFreqDerivIncludingNoSpinDown; /* set below */
201 INT4 iFreq = 0;
202 REAL8 cosTmpDEC;
203 REAL8 tmpDeltaRA;
204 REAL8 DeltaRA = 0.01;
205 REAL8 DeltaDec = 0.01;
206 REAL8 DeltaFDeriv1 = -1.0e-10;
207 REAL8 DeltaFDeriv2 = 0.0;
208 REAL8 DeltaFDeriv3 = 0.0;
209 REAL8 DeltaFDeriv4 = 0.0;
210 REAL8 DeltaFDeriv5 = 0.0;
211
212 /* containers for number of SFTs, times to generate SFTs, reference time, and gap */
213 INT4 numSFTs = 4;
214 REAL8 f0SFT = 943.12;
215 REAL8 bandSFT = 0.5;
216 UINT4 gpsStartTimeSec = 765432109; /* GPS start time of data requested seconds; example = Apr 08 2004 04:01:36 UTC */
217 UINT4 gpsStartTimeNan = 0; /* GPS start time of data requested nanoseconds */
218 LIGOTimeGPSVector *timeStamps;
219 LIGOTimeGPS GPSin; /* holder for reference-time for pulsar parameters at the detector; will convert to SSB! */
220 REAL8 sftGap = 73.0; /* extra artificial gap between SFTs */
221 REAL8 tSFT = 1800.0;
222 REAL8 duration = tSFT + ( numSFTs - 1 ) * ( tSFT + sftGap );
223 INT4 nBinsSFT = ( INT4 )( bandSFT * tSFT + 0.5 );
224
225 /* additional parameters that determine what signals to test; note f0SGNL and bandSGNL must be compatible with f0SFT and bandSFT */
226 REAL8 f0SGNL = f0SFT + bandSFT / 2.0;
227 REAL8 dfSGNL = 1.0 / tSFT;
228 REAL8 bandSGNL = 0.005;
229 INT4 nBinsSGNL = ( INT4 )( bandSGNL * tSFT + 0.5 );
230 INT4 nsamples = 18000; /* nsamples from SFT header; 2 x this would be the effective number of time samples used to create an SFT from raw data */
231 INT4 Dterms = 3; /* 09/07/05 gam; use Dterms to fill in SFT bins with fake data as per LALDemod else fill in bin with zero */
232 REAL8 h_0 = 7.0e-22; /* Source amplitude; use arbitrary small number for default */
233 REAL8 cosIota; /* cosine of inclination angle iota of the source */
234
235 /* variables for comparing differences */
236 REAL4 maxDiffSFTMod, diffAtMaxPower;
237 REAL4 overallMaxDiffSFTMod;
238 REAL4 maxMod, fastMaxMod;
239 INT4 jMaxMod, jFastMaxMod;
240 REAL4 tmpDiffSFTMod, sftMod, fastSFTMod;
241 REAL4 smallMod = 1.e-30;
242 REAL4 epsDiffMod;
243 REAL4 epsBinErrorRate; /* 10/12/04 gam; Allowed bin error rate */
244 INT4 binErrorCount = 0; /* 10/12/04 gam; Count number of bin errors */
245
246 /* randval is always set to a default value or given a random value to generate certain signal parameters or mismatch */
247 REAL4 randval;
248#ifdef INCLUDE_RANDVAL_MISMATCH
249 INT4 seed = 0;
250 INT4 rndCount;
251 RandomParams *randPar = NULL;
252 FILE *fpRandom;
253#endif
254
257
258 /* generate timeStamps */
259 timeStamps = ( LIGOTimeGPSVector * )LALMalloc( sizeof( LIGOTimeGPSVector ) );
260 timeStamps->data = ( LIGOTimeGPS * )LALMalloc( numSFTs * sizeof( LIGOTimeGPS ) );
261 timeStamps->length = numSFTs;
262 for ( i = 0; i < numSFTs; i++ ) {
263 timeStamps->data[i].gpsSeconds = gpsStartTimeSec + ( UINT4 )( i * ( tSFT + sftGap ) );
264 timeStamps->data[i].gpsNanoSeconds = 0;
265 } /* for i < numSFTs */
266
267 /* generate skyPosData */
268 skyPosData = ( REAL8 ** )LALMalloc( numSkyPosTotal * sizeof( REAL8 * ) );
269 for ( iSky = 0; iSky < numSkyPosTotal; iSky++ ) {
270 skyPosData[iSky] = ( REAL8 * )LALMalloc( 2 * sizeof( REAL8 ) );
271 /* Try fairly random sky positions skyPosData[iSky][0] = RA, skyPosData[iSky][1] = DEC */
272 if ( iSky == 0 ) {
273 skyPosData[iSky][0] = 0.02 * LAL_TWOPI;
274 skyPosData[iSky][1] = 0.03 * LAL_PI / 2.0;
275 } else if ( iSky == 1 ) {
276 skyPosData[iSky][0] = 0.23 * LAL_TWOPI;
277 skyPosData[iSky][1] = -0.57 * LAL_PI / 2.0;
278 } else if ( iSky == 2 ) {
279 skyPosData[iSky][0] = 0.47 * LAL_TWOPI;
280 skyPosData[iSky][1] = 0.86 * LAL_PI / 2.0;
281 } else if ( iSky == 3 ) {
282 skyPosData[iSky][0] = 0.38 * LAL_TWOPI;
283 skyPosData[iSky][1] = -0.07 * LAL_PI / 2.0;
284 } else if ( iSky == 4 ) {
285 skyPosData[iSky][0] = 0.65 * LAL_TWOPI;
286 skyPosData[iSky][1] = 0.99 * LAL_PI / 2.0;
287 } else if ( iSky == 5 ) {
288 skyPosData[iSky][0] = 0.72 * LAL_TWOPI;
289 skyPosData[iSky][1] = -0.99 * LAL_PI / 2.0;
290 } else if ( iSky == 6 ) {
291 skyPosData[iSky][0] = 0.81 * LAL_TWOPI;
292 skyPosData[iSky][1] = 0.19 * LAL_PI / 2.0;
293 } else if ( iSky == 7 ) {
294 skyPosData[iSky][0] = 0.99 * LAL_TWOPI;
295 skyPosData[iSky][1] = 0.01 * LAL_PI / 2.0;
296 } else {
297 skyPosData[iSky][0] = 0.0;
298 skyPosData[iSky][1] = 0.0;
299 } /* END if (k == 0) ELSE ... */
300 } /* END for(iSky=0;iSky<numSkyPosTotal;iSky++) */
301
302 freqDerivData = NULL; /* 02/02/05 gam */
303 if ( numSpinDown > 0 ) {
304 freqDerivData = ( REAL8 ** )LALMalloc( numFreqDerivTotal * sizeof( REAL8 * ) );
305 for ( jDeriv = 0; jDeriv < numFreqDerivTotal; jDeriv++ ) {
306 freqDerivData[jDeriv] = ( REAL8 * )LALMalloc( numSpinDown * sizeof( REAL8 ) );
307 if ( jDeriv == 0 ) {
308 for ( k = 0; k < numSpinDown; k++ ) {
309 freqDerivData[jDeriv][k] = 0.0;
310 }
311 } else if ( jDeriv == 1 ) {
312 for ( k = 0; k < numSpinDown; k++ ) {
313 freqDerivData[jDeriv][k] = 1.e-9; /* REALLY THIS IS ONLY GOOD FOR numSpinDown = 1; */
314 }
315 } else {
316 for ( k = 0; k < numSpinDown; k++ ) {
317 freqDerivData[jDeriv][k] = 0.0;
318 }
319 } /* END if (k == 0) ELSE ... */
320 } /* END for(jDeriv=0;jDeriv<numFreqDerivTotal;jDeriv++) */
321 numFreqDerivIncludingNoSpinDown = numFreqDerivTotal;
322 } else {
323 numFreqDerivIncludingNoSpinDown = 1; /* Even if numSpinDown = 0 still need to count case of zero spindown. */
324 } /* END if (numSpinDown > 0) ELSE ... */
325
326 /* Initialize ephemeris data */
327 XLAL_CHECK_LAL( status, ( edat = XLALInitBarycenter( earthFile, sunFile ) ) != NULL, XLAL_EFUNC );
328
329 /* Allocate memory for PulsarSignalParams and initialize */
330 pPulsarSignalParams = ( PulsarSignalParams * )LALCalloc( 1, sizeof( PulsarSignalParams ) );
331 pPulsarSignalParams->pulsar.position.system = COORDINATESYSTEM_EQUATORIAL;
332 pPulsarSignalParams->pulsar.spindown = NULL;
333 if ( numSpinDown > 0 ) {
334 LALDCreateVector( status->statusPtr, &( pPulsarSignalParams->pulsar.spindown ), ( ( UINT4 )numSpinDown ) );
336 }
337 pPulsarSignalParams->orbit.asini = 0 /* isolated pulsar */;
338 pPulsarSignalParams->transfer = NULL;
339 pPulsarSignalParams->dtDelayBy2 = 0;
340 pPulsarSignalParams->dtPolBy2 = 0;
341 /* Set up pulsar site */
342 if ( strstr( IFO, "LHO" ) ) {
344 } else if ( strstr( IFO, "LLO" ) ) {
346 } else if ( strstr( IFO, "GEO" ) ) {
348 } else if ( strstr( IFO, "VIRGO" ) ) {
350 } else if ( strstr( IFO, "TAMA" ) ) {
352 } else {
353 /* "Invalid or null IFO" */
354 ABORT( status, GENERATEPULSARSIGNALTESTC_EIFO, GENERATEPULSARSIGNALTESTC_MSGEIFO );
355 }
356 pPulsarSignalParams->site = &cachedDetector;
357 pPulsarSignalParams->ephemerides = edat;
358 pPulsarSignalParams->startTimeGPS.gpsSeconds = ( INT4 )gpsStartTimeSec;
359 pPulsarSignalParams->startTimeGPS.gpsNanoSeconds = ( INT4 )gpsStartTimeNan;
360 pPulsarSignalParams->duration = ( UINT4 )duration;
361 pPulsarSignalParams->samplingRate = ( REAL8 )ceil( 2.0 * bandSFT ); /* Make sampleRate an integer so that T*samplingRate = integer for integer T */
362 pPulsarSignalParams->fHeterodyne = f0SFT;
363
364 GPSin.gpsSeconds = timeStamps->data[0].gpsSeconds;
365 GPSin.gpsNanoSeconds = timeStamps->data[0].gpsNanoSeconds;
366
367 /* Allocate memory for SFTParams and initialize */
368 pSFTParams = ( SFTParams * )LALCalloc( 1, sizeof( SFTParams ) );
369 pSFTParams->Tsft = tSFT;
370 pSFTParams->timestamps = timeStamps;
371 pSFTParams->noiseSFTs = NULL;
372
373#ifdef INCLUDE_RANDVAL_MISMATCH
374 /* Initial seed and randPar to use LALUniformDeviate to generate random mismatch during Monte Carlo. */
375 fpRandom = fopen( "/dev/urandom", "r" );
376 rndCount = fread( &seed, sizeof( INT4 ), 1, fpRandom );
377 fclose( fpRandom );
378 /* seed = 1234; */ /* Test value */
379 LALCreateRandomParams( status->statusPtr, &randPar, seed );
381#endif
382
383 /* allocate memory for structs needed by LALComputeSkyAndZeroPsiAMResponse and LALFastGeneratePulsarSFTs */
384 pSkyConstAndZeroPsiAMResponse = ( SkyConstAndZeroPsiAMResponse * )LALMalloc( sizeof( SkyConstAndZeroPsiAMResponse ) );
385 pSkyConstAndZeroPsiAMResponse->skyConst = ( REAL8 * )LALMalloc( ( 2 * numSpinDown * ( numSFTs + 1 ) + 2 * numSFTs + 3 ) * sizeof( REAL8 ) );
386 pSkyConstAndZeroPsiAMResponse->fPlusZeroPsi = ( REAL4 * )LALMalloc( numSFTs * sizeof( REAL4 ) );
387 pSkyConstAndZeroPsiAMResponse->fCrossZeroPsi = ( REAL4 * )LALMalloc( numSFTs * sizeof( REAL4 ) );
388 pSFTandSignalParams = ( SFTandSignalParams * )LALMalloc( sizeof( SFTandSignalParams ) );
389 /* create lookup table (LUT) values for doing trig */
390 /* pSFTandSignalParams->resTrig = 64; */ /* length sinVal and cosVal; resolution of trig functions = 2pi/resTrig */
391 /* pSFTandSignalParams->resTrig = 128; */ /* 10/08/04 gam; length sinVal and cosVal; domain = -2pi to 2pi inclusive; resolution = 4pi/resTrig */
392 pSFTandSignalParams->resTrig = 0; /* 10/12/04 gam; turn off using LUTs since this is more typical. */
393 /* 02/02/05 gam; if NOT pSFTandSignalParams->resTrig > 0 should not create trigArg etc... */
394 if ( pSFTandSignalParams->resTrig > 0 ) {
395 pSFTandSignalParams->trigArg = ( REAL8 * )LALMalloc( ( pSFTandSignalParams->resTrig + 1 ) * sizeof( REAL8 ) );
396 pSFTandSignalParams->sinVal = ( REAL8 * )LALMalloc( ( pSFTandSignalParams->resTrig + 1 ) * sizeof( REAL8 ) );
397 pSFTandSignalParams->cosVal = ( REAL8 * )LALMalloc( ( pSFTandSignalParams->resTrig + 1 ) * sizeof( REAL8 ) );
398 for ( k = 0; k <= pSFTandSignalParams->resTrig; k++ ) {
399 /* pSFTandSignalParams->trigArg[k]= ((REAL8)LAL_TWOPI) * ((REAL8)k) / ((REAL8)pSFTandSignalParams->resTrig); */ /* 10/08/04 gam */
400 pSFTandSignalParams->trigArg[k] = -1.0 * ( ( REAL8 )LAL_TWOPI ) + 2.0 * ( ( REAL8 )LAL_TWOPI ) * ( ( REAL8 )k ) / ( ( REAL8 )pSFTandSignalParams->resTrig );
401 pSFTandSignalParams->sinVal[k] = sin( pSFTandSignalParams->trigArg[k] );
402 pSFTandSignalParams->cosVal[k] = cos( pSFTandSignalParams->trigArg[k] );
403 }
404 }
405 pSFTandSignalParams->pSigParams = pPulsarSignalParams;
406 pSFTandSignalParams->pSFTParams = pSFTParams;
407 pSFTandSignalParams->nSamples = nsamples;
408 pSFTandSignalParams->Dterms = Dterms; /* 09/07/05 gam */
409
410 /* ********************************************************/
411 /* */
412 /* START SECTION: LOOP OVER SKY POSITIONS */
413 /* */
414 /* ********************************************************/
415 for ( iSky = 0; iSky < numSkyPosTotal; iSky++ ) {
416
417 /* set source sky position declination (DEC) */
418 randval = 0.5; /* Gives default value */
419#ifdef INCLUDE_SEQUENTIAL_MISMATCH
420 randval = ( ( REAL4 )( iSky ) ) / ( ( REAL4 )( numSkyPosTotal ) );
421#endif
422#ifdef INCLUDE_RANDVAL_MISMATCH
423 LALUniformDeviate( status->statusPtr, &randval, randPar );
425#endif
426 pPulsarSignalParams->pulsar.position.latitude = skyPosData[iSky][1] + ( ( ( REAL8 )randval ) - 0.5 ) * DeltaDec;
427 cosTmpDEC = cos( skyPosData[iSky][1] );
428 if ( cosTmpDEC != 0.0 ) {
429 tmpDeltaRA = DeltaRA / cosTmpDEC;
430 } else {
431 tmpDeltaRA = 0.0; /* We are at a celestial pole */
432 }
433
434 /* set source sky position right ascension (RA) */
435 randval = 0.5; /* Gives default value */
436#ifdef INCLUDE_SEQUENTIAL_MISMATCH
437 randval = ( ( REAL4 )( iSky ) ) / ( ( REAL4 )( numSkyPosTotal ) );
438#endif
439#ifdef INCLUDE_RANDVAL_MISMATCH
440 LALUniformDeviate( status->statusPtr, &randval, randPar );
442#endif
443 pPulsarSignalParams->pulsar.position.longitude = skyPosData[iSky][0] + ( ( ( REAL8 )randval ) - 0.5 ) * tmpDeltaRA;
444
445 /* Find reference time in SSB for this sky positions */
446 int ret = XLALConvertGPS2SSB( &( pPulsarSignalParams->pulsar.refTime ), GPSin, pPulsarSignalParams );
447 if ( ret != XLAL_SUCCESS ) {
448 XLALPrintError( "XLALConvertGPS2SSB() failed with xlalErrno = %d\n", xlalErrno );
449 ABORTXLAL( status );
450 }
451
452 /* one per sky position fill in SkyConstAndZeroPsiAMResponse for use with LALFastGeneratePulsarSFTs */
453 LALComputeSkyAndZeroPsiAMResponse( status->statusPtr, pSkyConstAndZeroPsiAMResponse, pSFTandSignalParams );
455
456 /* ********************************************************/
457 /* */
458 /* START SECTION: LOOP OVER SPINDOWN */
459 /* */
460 /* ********************************************************/
461 for ( jDeriv = 0; jDeriv < numFreqDerivIncludingNoSpinDown; jDeriv++ ) {
462 /* source spindown parameters */
463 if ( numSpinDown > 0 ) {
464 for ( k = 0; k < numSpinDown; k++ ) {
465 randval = 0.5; /* Gives default value */
466#ifdef INCLUDE_SEQUENTIAL_MISMATCH
467 if ( freqDerivData[jDeriv][k] < 0.0 ) {
468 randval = ( ( REAL4 )( iSky ) ) / ( ( REAL4 )( numSkyPosTotal ) );
469 } else {
470 randval = 0.5; /* If derivative is not negative (i.e., it is zero) then do not add in mismatch; keep it zero. */
471 }
472#endif
473#ifdef INCLUDE_RANDVAL_MISMATCH
474 LALUniformDeviate( status->statusPtr, &randval, randPar );
476#endif
477 if ( k == 0 ) {
478 pPulsarSignalParams->pulsar.spindown->data[k] = freqDerivData[jDeriv][k] + ( ( ( REAL8 )randval ) - 0.5 ) * DeltaFDeriv1;
479 } else if ( k == 1 ) {
480 pPulsarSignalParams->pulsar.spindown->data[k] = freqDerivData[jDeriv][k] + ( ( ( REAL8 )randval ) - 0.5 ) * DeltaFDeriv2;
481 } else if ( k == 2 ) {
482 pPulsarSignalParams->pulsar.spindown->data[k] = freqDerivData[jDeriv][k] + ( ( ( REAL8 )randval ) - 0.5 ) * DeltaFDeriv3;
483 } else if ( k == 3 ) {
484 pPulsarSignalParams->pulsar.spindown->data[k] = freqDerivData[jDeriv][k] + ( ( ( REAL8 )randval ) - 0.5 ) * DeltaFDeriv4;
485 } else if ( k == 4 ) {
486 pPulsarSignalParams->pulsar.spindown->data[k] = freqDerivData[jDeriv][k] + ( ( ( REAL8 )randval ) - 0.5 ) * DeltaFDeriv5;
487 } /* END if (k == 0) ELSE ... */
488 }
489 }
490
491 /* ***************************************************/
492 /* */
493 /* START SECTION: LOOP OVER FREQUENCIES */
494 /* */
495 /* ***************************************************/
496 for ( iFreq = 0; iFreq < nBinsSGNL; iFreq++ ) {
497
498 /* set source orientation psi */
499 randval = 0.5; /* Gives default value */
500#ifdef INCLUDE_SEQUENTIAL_MISMATCH
501 randval = ( ( REAL4 )( iFreq ) ) / ( ( REAL4 )( nBinsSGNL ) );
502#endif
503#ifdef INCLUDE_RANDVAL_MISMATCH
504 LALUniformDeviate( status->statusPtr, &randval, randPar );
506#endif
507 pPulsarSignalParams->pulsar.psi = ( randval - 0.5 ) * ( ( REAL4 )LAL_PI_2 );
508
509 /* set angle between source spin axis and direction from source to SSB, cosIota */
510 randval = 1.0; /* Gives default value */
511#ifdef INCLUDE_SEQUENTIAL_MISMATCH
512 randval = ( ( REAL4 )( iFreq ) ) / ( ( REAL4 )( nBinsSGNL ) );
513#endif
514#ifdef INCLUDE_RANDVAL_MISMATCH
515 LALUniformDeviate( status->statusPtr, &randval, randPar );
517#endif
518 cosIota = 2.0 * ( ( REAL8 )randval ) - 1.0;
519
520 /* h_0 is fixed above; get A_+ and A_x from h_0 and cosIota */
521 pPulsarSignalParams->pulsar.aPlus = ( REAL4 )( 0.5 * h_0 * ( 1.0 + cosIota * cosIota ) );
522 pPulsarSignalParams->pulsar.aCross = ( REAL4 )( h_0 * cosIota );
523
524 /* get random value for phi0 */
525 randval = 0.125; /* Gives default value pi/4*/
526#ifdef INCLUDE_SEQUENTIAL_MISMATCH
527 randval = ( ( REAL4 )( iFreq ) ) / ( ( REAL4 )( nBinsSGNL ) );
528#endif
529#ifdef INCLUDE_RANDVAL_MISMATCH
530 LALUniformDeviate( status->statusPtr, &randval, randPar );
532#endif
533 pPulsarSignalParams->pulsar.phi0 = ( ( REAL8 )randval ) * ( ( REAL8 )LAL_TWOPI );
534
535 /* randval steps through various mismatches to frequencies centered on a bin */
536 /* Note that iFreq = nBinsSGNL/2 gives randval = 0.5 gives no mismatch from frequency centered on a bin */
537 randval = ( ( REAL4 )( iFreq ) ) / ( ( REAL4 )( nBinsSGNL ) );
538#ifdef INCLUDE_RANDVAL_MISMATCH
539 LALUniformDeviate( status->statusPtr, &randval, randPar );
541#endif
542 pPulsarSignalParams->pulsar.f0 = f0SGNL + iFreq * dfSGNL + ( ( ( REAL8 )randval ) - 0.5 ) * dfSGNL;
543
544 testNumber++; /* Update count of which test we about to do. */
545
546 /* FIRST: Use LALGeneratePulsarSignal and LALSignalToSFTs to generate outputSFTs */
547 signalvec = NULL;
548 LALGeneratePulsarSignal( status->statusPtr, &signalvec, pPulsarSignalParams );
550 outputSFTs = NULL;
551 LALSignalToSFTs( status->statusPtr, &outputSFTs, signalvec, pSFTParams );
553
554#ifdef PRINT_OUTPUTSFT
555 if ( testNumber == TESTNUMBER_TO_PRINT ) {
556 i = SFTINDEX_TO_PRINT; /* index of which outputSFT to output */
557 fprintf( stdout, "iFreq = %i, inject h_0 = %23.10e \n", iFreq, h_0 );
558 fprintf( stdout, "iFreq = %i, inject cosIota = %23.10e, A_+ = %23.10e, A_x = %23.10e \n", iFreq, cosIota, pPulsarSignalParams->pulsar.aPlus, pPulsarSignalParams->pulsar.aCross );
559 fprintf( stdout, "iFreq = %i, inject psi = %23.10e \n", iFreq, pPulsarSignalParams->pulsar.psi );
560 fprintf( stdout, "iFreq = %i, inject phi0 = %23.10e \n", iFreq, pPulsarSignalParams->pulsar.phi0 );
561 fprintf( stdout, "iFreq = %i, search f0 = %23.10e, inject f0 = %23.10e \n", iFreq, f0SGNL + iFreq * dfSGNL, pPulsarSignalParams->pulsar.f0 );
562 fprintf( stdout, "outputSFTs->data[%i].data->length = %i \n", i, outputSFTs->data[i].data->length );
563 renorm = ( ( REAL4 )nsamples ) / ( ( REAL4 )( outputSFTs->data[i].data->length - 1 ) );
564 for ( j = 0; j < nBinsSFT; j++ ) {
565 /* fprintf(stdout,"%i %g %g \n", j, renorm*outputSFTs->data[i].data->data[j].re, renorm*outputSFTs->data[i].data->data[j].im); */
566 fprintf( stdout, "%i %g \n", j, renorm * renorm * outputSFTs->data[i].data->data[j].re * outputSFTs->data[i].data->data[j].re + renorm * renorm * outputSFTs->data[i].data->data[j].im * outputSFTs->data[i].data->data[j].im );
567 fflush( stdout );
568 }
569 }
570#endif
571
572 /* SECOND: Use LALComputeSkyAndZeroPsiAMResponse and LALFastGeneratePulsarSFTs to generate outputSFTs */
573 LALFastGeneratePulsarSFTs( status->statusPtr, &fastOutputSFTs, pSkyConstAndZeroPsiAMResponse, pSFTandSignalParams );
575
576#ifdef PRINT_FASTOUTPUTSFT
577 if ( testNumber == TESTNUMBER_TO_PRINT ) {
578 REAL4 fPlus;
579 REAL4 fCross;
580 i = SFTINDEX_TO_PRINT; /* index of which outputSFT to output */
581 fPlus = pSkyConstAndZeroPsiAMResponse->fPlusZeroPsi[i] * cos( 2.0 * pPulsarSignalParams->pulsar.psi ) + pSkyConstAndZeroPsiAMResponse->fCrossZeroPsi[i] * sin( 2.0 * pPulsarSignalParams->pulsar.psi );
582 fCross = pSkyConstAndZeroPsiAMResponse->fCrossZeroPsi[i] * cos( 2.0 * pPulsarSignalParams->pulsar.psi ) - pSkyConstAndZeroPsiAMResponse->fPlusZeroPsi[i] * sin( 2.0 * pPulsarSignalParams->pulsar.psi );
583 fprintf( stdout, "iFreq = %i, inject h_0 = %23.10e \n", iFreq, h_0 );
584 fprintf( stdout, "iFreq = %i, inject cosIota = %23.10e, A_+ = %23.10e, A_x = %23.10e \n", iFreq, cosIota, pPulsarSignalParams->pulsar.aPlus, pPulsarSignalParams->pulsar.aCross );
585 fprintf( stdout, "iFreq = %i, inject psi = %23.10e \n", iFreq, pPulsarSignalParams->pulsar.psi );
586 fprintf( stdout, "iFreq = %i, fPlus, fCross = %23.10e, %23.10e \n", iFreq, fPlus, fCross );
587 fprintf( stdout, "iFreq = %i, inject phi0 = %23.10e \n", iFreq, pPulsarSignalParams->pulsar.phi0 );
588 fprintf( stdout, "iFreq = %i, search f0 = %23.10e, inject f0 = %23.10e \n", iFreq, f0SGNL + iFreq * dfSGNL, pPulsarSignalParams->pulsar.f0 );
589 fprintf( stdout, "fastOutputSFTs->data[%i].data->length = %i \n", i, fastOutputSFTs->data[i].data->length );
590 fflush( stdout );
591 for ( j = 0; j < nBinsSFT; j++ ) {
592 /* fprintf(stdout,"%i %g %g \n",j,fastOutputSFTs->data[i].data->data[j].re,fastOutputSFTs->data[i].data->data[j].im); */
593 fprintf( stdout, "%i %g \n", j, fastOutputSFTs->data[i].data->data[j].re * fastOutputSFTs->data[i].data->data[j].re + fastOutputSFTs->data[i].data->data[j].im * fastOutputSFTs->data[i].data->data[j].im );
594 fflush( stdout );
595 }
596 }
597#endif
598
599 /* find maximum difference in power */
600 epsDiffMod = 0.20; /* maximum allowed percent difference */ /* 10/12/04 gam */
601 overallMaxDiffSFTMod = 0.0;
602 for ( i = 0; i < numSFTs; i++ ) {
603 renorm = ( ( REAL4 )nsamples ) / ( ( REAL4 )( outputSFTs->data[i].data->length - 1 ) );
604 maxDiffSFTMod = 0.0;
605 diffAtMaxPower = 0.0;
606 maxMod = 0.0;
607 fastMaxMod = 0.0;
608 jMaxMod = -1;
609 jFastMaxMod = -1;
610 /* Since doppler shifts can move the signal by an unknown number of bins search the whole band for max modulus: */
611 for ( j = 0; j < nBinsSFT; j++ ) {
612 sftMod = renorm * renorm * crealf( outputSFTs->data[i].data->data[j] ) * crealf( outputSFTs->data[i].data->data[j] ) + renorm * renorm * cimagf( outputSFTs->data[i].data->data[j] ) * cimagf( outputSFTs->data[i].data->data[j] );
613 sftMod = sqrt( sftMod );
614 fastSFTMod = crealf( fastOutputSFTs->data[i].data->data[j] ) * crealf( fastOutputSFTs->data[i].data->data[j] ) + cimagf( fastOutputSFTs->data[i].data->data[j] ) * cimagf( fastOutputSFTs->data[i].data->data[j] );
615 fastSFTMod = sqrt( fastSFTMod );
616 if ( fabs( sftMod ) > smallMod ) {
617 tmpDiffSFTMod = fabs( ( sftMod - fastSFTMod ) / sftMod );
618 if ( tmpDiffSFTMod > maxDiffSFTMod ) {
619 maxDiffSFTMod = tmpDiffSFTMod;
620 }
621 if ( tmpDiffSFTMod > overallMaxDiffSFTMod ) {
622 overallMaxDiffSFTMod = tmpDiffSFTMod;
623 }
624 if ( sftMod > maxMod ) {
625 maxMod = sftMod;
626 jMaxMod = j;
627 }
628 if ( fastSFTMod > fastMaxMod ) {
629 fastMaxMod = fastSFTMod;
630 jFastMaxMod = j;
631 }
632 }
633 }
634 if ( fabs( maxMod ) > smallMod ) {
635 diffAtMaxPower = fabs( ( maxMod - fastMaxMod ) / maxMod );
636 }
637#ifdef PRINT_MAXSFTPOWER
638 fprintf( stdout, "maxSFTMod, testNumber %i, SFT %i, bin %i = %g \n", testNumber, i, jMaxMod, maxMod );
639 fprintf( stdout, "maxFastSFTMod, testNumber %i, SFT %i, bin %i = %g \n", testNumber, i, jFastMaxMod, fastMaxMod );
640 fflush( stdout );
641#endif
642#ifdef PRINT_MAXDIFFSFTPOWER
643 fprintf( stdout, "maxDiffSFTMod, testNumber %i, SFT %i, bin %i = %g \n", testNumber, i, jMaxDiff, maxDiffSFTMod );
644 fflush( stdout );
645#endif
646#ifdef PRINT_DIFFATMAXPOWER
647 fprintf( stdout, "diffAtMaxPower, testNumber %i, SFT %i, bins %i and %i = %g \n", testNumber, i, jMaxMod, jFastMaxMod, diffAtMaxPower );
648 fflush( stdout );
649#endif
650#ifdef PRINT_ERRORATMAXPOWER
651 if ( diffAtMaxPower > epsDiffMod ) {
652 fprintf( stdout, "diffAtMaxPower, testNumber %i, SFT %i, bins %i and %i = %g exceeded epsDiffMod = %g \n", testNumber, i, jMaxMod, jFastMaxMod, diffAtMaxPower, epsDiffMod );
653 fflush( stdout );
654 /* break; */ /* only report 1 error per test */
655 }
656 if ( jMaxMod != jFastMaxMod ) {
657 fprintf( stdout, "MaxPower occurred in different bins: testNumber %i, SFT %i, bins %i and %i\n", testNumber, i, jMaxMod, jFastMaxMod );
658 fflush( stdout );
659 /* break; */ /* only report 1 error per test */
660 }
661#endif
662 if ( jMaxMod != jFastMaxMod ) {
663 binErrorCount++; /* 10/12/04 gam; count up bin errors; if too ABORT at bottom of code */
664 }
665 if ( diffAtMaxPower > epsDiffMod ) {
666 ABORT( status, GENERATEPULSARSIGNALTESTC_EMOD, GENERATEPULSARSIGNALTESTC_MSGEMOD );
667 }
668 /* 10/12/04 gam; turn on test above and add test below */
669 if ( fabs( ( ( REAL8 )( jMaxMod - jFastMaxMod ) ) ) > 1.1 ) {
670 ABORT( status, GENERATEPULSARSIGNALTESTC_EBIN, GENERATEPULSARSIGNALTESTC_MSGEBIN );
671 }
672 } /* END for(i = 0; i < numSFTs; i++) */
673#ifdef PRINT_OVERALLMAXDIFFSFTPOWER
674 fprintf( stdout, "overallMaxDiffSFTMod, testNumber = %i, SFT %i, bin %i = %g \n", testNumber, iOverallMaxDiffSFTMod, jOverallMaxDiff, overallMaxDiffSFTMod );
675 fflush( stdout );
676#endif
677
678 /* 09/07/05 gam; Initialize fastOutputSFTs since only 2*Dterms bins are changed by LALFastGeneratePulsarSFTs */
679 for ( i = 0; i < numSFTs; i++ ) {
680 for ( j = 0; j < nBinsSFT; j++ ) {
681 fastOutputSFTs->data[i].data->data[j] = 0.0;
682 }
683 }
684
685 XLALDestroySFTVector( outputSFTs );
686
687 LALFree( signalvec->data->data );
688 LALFree( signalvec->data );
689 LALFree( signalvec );
690
691 } /* END for(iFreq=0;iFreq<nBinsSGNL;iFreq++) */
692 /* ***************************************************/
693 /* */
694 /* END SECTION: LOOP OVER FREQUENCIES */
695 /* */
696 /* ***************************************************/
697 } /* END for(jDeriv=0;jDeriv<numFreqDerivIncludingNoSpinDown;jDeriv++) */
698 /* ********************************************************/
699 /* */
700 /* END SECTION: LOOP OVER SPINDOWN */
701 /* */
702 /* ********************************************************/
703
704 } /* END for(iSky=0;iSky<numSkyPosTotal;iSky++) */
705 /* ********************************************************/
706 /* */
707 /* END SECTION: LOOP OVER SKY POSITIONS */
708 /* */
709 /* ********************************************************/
710
711 /* 10/12/04 gam; check if too many bin errors */
712 epsBinErrorRate = 0.20; /* 10/12/04 gam; maximum allowed bin errors */
713 if ( ( ( ( REAL4 )binErrorCount ) / ( ( REAL4 )testNumber ) ) > epsBinErrorRate ) {
714 ABORT( status, GENERATEPULSARSIGNALTESTC_EBINS, GENERATEPULSARSIGNALTESTC_MSGEBINS );
715 }
716
717#ifdef INCLUDE_RANDVAL_MISMATCH
718 LALDestroyRandomParams( status->statusPtr, &randPar );
720#endif
721
722 /* fprintf(stdout,"Total number of tests completed = %i. \n", testNumber);
723 fflush(stdout); */
724
725 LALFree( pSFTParams );
726 if ( numSpinDown > 0 ) {
727 LALDDestroyVector( status->statusPtr, &( pPulsarSignalParams->pulsar.spindown ) );
729 }
730 LALFree( pPulsarSignalParams );
731
732 /* deallocate memory for structs needed by LALComputeSkyAndZeroPsiAMResponse and LALFastGeneratePulsarSFTs */
733 XLALDestroySFTVector( fastOutputSFTs );
734 LALFree( pSkyConstAndZeroPsiAMResponse->fCrossZeroPsi );
735 LALFree( pSkyConstAndZeroPsiAMResponse->fPlusZeroPsi );
736 LALFree( pSkyConstAndZeroPsiAMResponse->skyConst );
737 LALFree( pSkyConstAndZeroPsiAMResponse );
738 /* 02/02/05 gam; if NOT pSFTandSignalParams->resTrig > 0 should not create trigArg etc... */
739 if ( pSFTandSignalParams->resTrig > 0 ) {
740 LALFree( pSFTandSignalParams->trigArg );
741 LALFree( pSFTandSignalParams->sinVal );
742 LALFree( pSFTandSignalParams->cosVal );
743 }
744 LALFree( pSFTandSignalParams );
745
746 /* deallocate skyPosData */
747 for ( i = 0; i < numSkyPosTotal; i++ ) {
748 LALFree( skyPosData[i] );
749 }
750 LALFree( skyPosData );
751
752 if ( numSpinDown > 0 ) {
753 /* deallocate freqDerivData */
754 for ( i = 0; i < numFreqDerivTotal; i++ ) {
755 LALFree( freqDerivData[i] );
756 }
757 LALFree( freqDerivData );
758 }
759
760 LALFree( timeStamps->data );
761 LALFree( timeStamps );
762
764
767}
768/* ********************************************************/
769/* */
770/* END FUNCTION: RunGeneratePulsarSignalTest */
771/* */
772/* ********************************************************/
773
774/** \endcond */
LALDetectorIndexLLODIFF
LALDetectorIndexGEO600DIFF
LALDetectorIndexTAMA300DIFF
LALDetectorIndexVIRGODIFF
LALDetectorIndexLHODIFF
#define GENERATEPULSARSIGNALTESTC_EMOD
SFT max power from LALSignalToSFTs and LALFastGeneratePulsarSFTs differs.
#define GENERATEPULSARSIGNALTESTC_EBIN
SFT freq with max power from LALSignalToSFTs and LALFastGeneratePulsarSFTs differs by more than 1 bin...
#define GENERATEPULSARSIGNALTESTC_EBINS
SFTs freq with max power from LALSignalToSFTs and LALFastGeneratePulsarSFTs differs too often.
#define GENERATEPULSARSIGNALTESTC_EIFO
IFO not supported.
#define GENERATEPULSARSIGNALTESTC_ENORM
Normal exit.
#define IFO
int j
int k
void LALCheckMemoryLeaks(void)
#define LALCalloc(m, n)
#define LALMalloc(n)
#define LALFree(p)
#define ABORT(statusptr, code, mesg)
#define CHECKSTATUSPTR(statusptr)
#define XLAL_CHECK_LAL(sp, assertion,...)
#define ATTATCHSTATUSPTR(statusptr)
#define DETATCHSTATUSPTR(statusptr)
#define INITSTATUS(statusptr)
#define ABORTXLAL(sp)
#define fprintf
int main(int argc, char **argv)
const LALDetector lalCachedDetectors[LAL_NUM_DETECTORS]
int XLALConvertGPS2SSB(LIGOTimeGPS *SSBout, LIGOTimeGPS GPSin, const PulsarSignalParams *params)
Convert earth-frame GPS time into barycentric-frame SSB time for given source.
void LALGeneratePulsarSignal(LALStatus *status, REAL4TimeSeries **signalvec, const PulsarSignalParams *params)
void LALFastGeneratePulsarSFTs(LALStatus *status, SFTVector **outputSFTs, const SkyConstAndZeroPsiAMResponse *input, const SFTandSignalParams *params)
Fast generation of Fake SFTs for a pure pulsar signal.
void LALSignalToSFTs(LALStatus *status, SFTVector **outputSFTs, const REAL4TimeSeries *signalvec, const SFTParams *params)
void LALComputeSkyAndZeroPsiAMResponse(LALStatus *status, SkyConstAndZeroPsiAMResponse *output, const SFTandSignalParams *params)
/deprecated Move to attic? Wrapper for LALComputeSky() and LALComputeDetAMResponse() that finds the s...
EphemerisData * XLALInitBarycenter(const CHAR *earthEphemerisFile, const CHAR *sunEphemerisFile)
XLAL interface to reading ephemeris files 'earth' and 'sun', and return ephemeris-data in old backwar...
void XLALDestroyEphemerisData(EphemerisData *edat)
Destructor for EphemerisData struct, NULL robust.
#define LAL_PI_2
#define LAL_PI
#define LAL_TWOPI
double REAL8
char CHAR
uint32_t UINT4
int32_t INT4
float REAL4
LALINFO
void LALCreateRandomParams(LALStatus *status, RandomParams **params, INT4 seed)
void LALUniformDeviate(LALStatus *status, REAL4 *deviate, RandomParams *params)
void LALDestroyRandomParams(LALStatus *status, RandomParams **params)
void XLALDestroySFTVector(SFTVector *vect)
XLAL interface to destroy an SFTVector.
Definition: SFTtypes.c:300
COORDINATESYSTEM_EQUATORIAL
void LALDCreateVector(LALStatus *, REAL8Vector **, UINT4)
void LALDDestroyVector(LALStatus *, REAL8Vector **)
int XLALPrintError(const char *fmt,...) _LAL_GCC_PRINTF_FORMAT_(1
XLAL_SUCCESS
XLAL_EFUNC
COMPLEX8Sequence * data
A vector of COMPLEX8FrequencySeries.
COMPLEX8FrequencySeries * data
Pointer to the data array.
COMPLEX8 * data
This structure contains all information about the center-of-mass positions of the Earth and Sun,...
INT4 gpsNanoSeconds
A vector of 'timestamps' of type LIGOTimeGPS.
Definition: SFTfileIO.h:188
LIGOTimeGPS * data
array of timestamps
Definition: SFTfileIO.h:193
UINT4 length
number of timestamps
Definition: SFTfileIO.h:192
Input parameters to GeneratePulsarSignal(), defining the source and the time-series.
REAL8 asini
projected, normalized orbital semi-major axis (s)
SkyPosition position
source location (in radians)
const COMPLEX8FrequencySeries * transfer
detector transfer function (NULL if not used)
const EphemerisData * ephemerides
Earth and Sun ephemerides.
UINT4 dtPolBy2
half-interval for the polarisation response look-up table for LALPulsarSimulateCoherentGW()
REAL8 fHeterodyne
heterodyning frequency for output time-series
REAL4 aPlus
plus-polarization amplitude at tRef
struct PulsarSignalParams::@4 orbit
REAL4 psi
polarization angle (radians) at tRef
struct PulsarSignalParams::@3 pulsar
REAL8 phi0
initial phase (radians) at tRef
LIGOTimeGPS startTimeGPS
start time of output time series
UINT4 dtDelayBy2
half-interval for the Doppler delay look-up table for LALPulsarSimulateCoherentGW()
const LALDetector * site
detector location and orientation
REAL8Vector * spindown
wave-frequency spindowns at tRef (NOT f0-normalized!)
LIGOTimeGPS refTime
reference time of pulsar parameters (in SSB!)
REAL8 f0
WAVE-frequency(!) at tRef (in Hz)
REAL4 aCross
cross-polarization amplitude at tRef
REAL8 samplingRate
sampling rate of time-series (= 2 * frequency-Band)
UINT4 duration
length of time series in seconds
REAL4Sequence * data
REAL4 * data
REAL8 * data
Parameters defining the SFTs to be returned from LALSignalToSFTs().
REAL8 Tsft
length of each SFT in seconds
const LIGOTimeGPSVector * timestamps
timestamps to produce SFTs for (can be NULL)
const SFTVector * noiseSFTs
noise SFTs to be added (can be NULL)
Parameters defining the pulsar signal and SFTs used by LALFastGeneratePulsarSFTs().
REAL8 * sinVal
sinVal holds lookup table (LUT) values for doing trig sin calls
INT4 nSamples
nsample from noise SFT header; 2x this equals effective number of time samples
PulsarSignalParams * pSigParams
REAL8 * cosVal
cosVal holds lookup table (LUT) values for doing trig cos calls
REAL8 * trigArg
array of arguments to hold lookup table (LUT) values for doing trig calls
INT4 Dterms
use this to fill in SFT bins with fake data as per LALDemod else fill in bin with zero
INT4 resTrig
length sinVal, cosVal; domain: -2pi to 2pi; resolution = 4pi/resTrig
Sky Constants and beam pattern response functions used by LALFastGeneratePulsarSFTs().
REAL8 * skyConst
vector of A and B sky constants
REAL4 * fPlusZeroPsi
vector of Fplus values for psi = 0 at midpoint of each SFT
REAL4 * fCrossZeroPsi
vector of Fcross values for psi = 0 at midpoint of each SFT
REAL8 longitude
REAL8 latitude
CoordinateSystem system