35#define LALGENERATEINSPIRALWAVEFORMC_ENORM 0
36#define LALGENERATEINSPIRALWAVEFORMC_ESUB 1
37#define LALGENERATEINSPIRALWAVEFORMC_EARG 2
38#define LALGENERATEINSPIRALWAVEFORMC_EVAL 3
39#define LALGENERATEINSPIRALWAVEFORMC_EFILE 4
40#define LALGENERATEINSPIRALWAVEFORMC_EMEM 5
42#define LALGENERATEINSPIRALWAVEFORMC_MSGENORM "Normal exit"
43#define LALGENERATEINSPIRALWAVEFORMC_MSGESUB "Subroutine failed"
44#define LALGENERATEINSPIRALWAVEFORMC_MSGEARG "Error parsing arguments"
45#define LALGENERATEINSPIRALWAVEFORMC_MSGEVAL "Input argument out of valid range"
46#define LALGENERATEINSPIRALWAVEFORMC_MSGEFILE "Could not open file"
47#define LALGENERATEINSPIRALWAVEFORMC_MSGEMEM "Out of memory"
49#define INSPIRALTEMPLATE_APPROXIMANT TaylorT4
50#define INSPIRALTEMPLATE_ORDER LAL_PNORDER_THREE_POINT_FIVE
51#define INSPIRALTEMPLATE_AMPORDER LAL_PNORDER_NEWTONIAN
52#define INSPIRALTEMPLATE_MASS1 10.
53#define INSPIRALTEMPLATE_MASS2 10.
54#define INSPIRALTEMPLATE_FCUTOFF 1000.
55#define INSPIRALTEMPLATE_FLOWER 40.
56#define INSPIRALTEMPLATE_TSAMPLING 2048.
57#define INSPIRALTEMPLATE_DISTANCE 1.
58#define INSPIRALTEMPLATE_SIGNALAMPLITUDE 1.
59#define INSPIRALTEMPLATE_STARTPHASE 0.
60#define INSPIRALTEMPLATE_STARTTIME 0.
62#define INSPIRALTEMPLATE_THETA 0.
63#define INSPIRALTEMPLATE_ZETA2 0.
64#define INSPIRALTEMPLATE_OMEGAS 0.
66#define INSPIRALTEMPLATE_ALPHA 0.
67#define INSPIRALTEMPLATE_PSI0 100000.
68#define INSPIRALTEMPLATE_PSI3 -1000.
70#define INSPIRALTEMPLATE_ALPHA1 0.
71#define INSPIRALTEMPLATE_ALPHA2 0.
72#define INSPIRALTEMPLATE_ALPHA3 0.
73#define INSPIRALTEMPLATE_ALPHA4 0.
74#define INSPIRALTEMPLATE_ALPHA5 0.
75#define INSPIRALTEMPLATE_ALPHA6 0.
76#define INSPIRALTEMPLATE_BETA 0.
78#define INSPIRALTEMPLATE_INCLINATION 0.1
79#define INSPIRALTEMPLATE_ECCENTRICITY 0.
80#define INSPIRALTEMPLATE_ORBITTHETA0 0.0
81#define INSPIRALTEMPLATE_ORBITPHI0 0.0
82#define INSPIRALTEMPLATE_SPIN1X 0.0
83#define INSPIRALTEMPLATE_SPIN1Y 0.0
84#define INSPIRALTEMPLATE_SPIN1Z 0.0
85#define INSPIRALTEMPLATE_SPIN2X 0.0
86#define INSPIRALTEMPLATE_SPIN2Y 0.0
87#define INSPIRALTEMPLATE_SPIN2Z 0.0
89#define INSPIRALTEMPLATE_CHI 0.
90#define INSPIRALTEMPLATE_KAPPA 0.
92#define INSPIRALTEMPLATE_SOURCETHETA 0.
93#define INSPIRALTEMPLATE_SOURCEPHI 0.
94#define INSPIRALTEMPLATE_POLARISATIONANGLE 0.
96#define INSPIRALTEMPLATE_INTERACTION LAL_INSPIRAL_INTERACTION_ALL_SPIN
97#define INSPIRALTEMPLATE_AXISCHOICE LAL_SIM_INSPIRAL_FRAME_AXIS_VIEW
98#define INSPIRALTEMPLATE_FIXEDSTEP 0
99#define INSPIRALTEMPLATE_INSPIRALONLY 0
102#include <lal/LALInspiral.h>
103#include <lal/LALNoiseModels.h>
104#include <lal/RealFFT.h>
105#include <lal/AVFactories.h>
106#include <lal/Random.h>
107#include <lal/GenerateInspiral.h>
108#include <lal/StringInput.h>
110#define ERROR( code, msg, statement ) \
112if ( lalDebugLevel & LALERROR ) \
114 LALPrintError( "Error[0] %d: program %s, file %s, line %d, %s\n" \
115 " %s %s\n", (code), program, __FILE__, \
116 __LINE__, "$Id$", statement ? statement : \
121#define WARNING( statement ) \
123if ( lalDebugLevel & LALWARNING ) \
125 LALPrintError( "Warning[0]: program %s, file %s, line %d, %s\n" \
126 " %s\n", program, __FILE__, __LINE__, \
127 "$Id$", (statement) ); \
131#define INFO( statement ) \
133if ( lalDebugLevel & LALINFO ) \
135 LALPrintError( "Info[0]: program %s, file %s, line %d, %s\n" \
136 " %s\n", program, __FILE__, __LINE__, \
137 "$Id$", (statement) ); \
141#define SUB( func, statusptr ) \
143if ( (func), (statusptr)->statusCode ) \
145 ERROR( LALGENERATEINSPIRALWAVEFORMC_ESUB, LALGENERATEINSPIRALWAVEFORMC_MSGESUB, \
146 "Function call \"" #func "\" failed:" ); \
147 exit( LALGENERATEINSPIRALWAVEFORMC_ESUB ); \
185 if (strcmp(argv[
i],
"--approximant")==0)
188 if (strcmp(argv[++
i],
"AmpCorPPN")==0){
190 else if (strcmp(argv[
i],
"GeneratePPN")==0){
192 else if (strcmp(argv[
i],
"TaylorN")==0){
194 else if (strcmp(argv[
i],
"TaylorEt")==0){
196 else if (strcmp(argv[
i],
"TaylorT4")==0){
198 else if (strcmp(argv[
i],
"TaylorT1")==0){
200 else if (strcmp(argv[
i],
"TaylorT2")==0){
202 else if (strcmp(argv[
i],
"TaylorT3")==0){
204 else if (strcmp(argv[
i],
"TaylorF1")==0){
206 else if (strcmp(argv[
i],
"TaylorF2")==0){
208 else if (strcmp(argv[
i],
"TaylorF2RedSpin")==0){
210 else if (strcmp(argv[
i],
"PadeT1")==0){
212 else if (strcmp(argv[
i],
"PadeF1")==0){
214 else if (strcmp(argv[
i],
"EOB")==0){
216 else if (strcmp(argv[
i],
"EOBNR")==0){
218 else if (strcmp(argv[
i],
"EOBNRv2")==0){
220 else if (strcmp(argv[
i],
"EOBNRv2HM")==0){
222 else if (strcmp(argv[
i],
"IMRPhenomA")==0){
224 else if (strcmp(argv[
i],
"IMRPhenomB")==0){
226 else if (strcmp(argv[
i],
"IMRPhenomFA")==0){
228 else if (strcmp(argv[
i],
"IMRPhenomFB")==0){
230 else if (strcmp(argv[
i],
"SpinTaylor")==0){
232 else if (strcmp(argv[
i],
"SpinTaylorFrameless")==0){
234 else if (strcmp(argv[
i],
"SpinTaylorT3")==0){
236 else if (strcmp(argv[
i],
"SpinTaylorT4")==0){
238 else if (strcmp(argv[
i],
"SpinQuadTaylor")==0){
240 else if (strcmp(argv[
i],
"PhenSpinTaylorRD")==0){
242 else if (strcmp(argv[
i],
"FindChirpSP")==0){
244 else if (strcmp(argv[
i],
"FindChirpPTF")==0){
246 else if (strcmp(argv[
i],
"BCV")==0){
250 else if (strcmp(argv[
i],
"BCVSpin")==0){
254 else if (strcmp(argv[
i],
"BCVC")==0){
258 else if (strcmp(argv[
i],
"Eccentricity")==0){
260 else if (strcmp(argv[
i],
"NumRel")==0){
262 else if (strcmp(argv[
i],
"FrameFile")==0){
264 else {
fprintf(stderr,
"Approximant not found in ParseParameter function\n");}
266 else if (strcmp(argv[
i],
"--order")==0){
268 else if (strcmp(argv[
i],
"--amp-order")==0){
270 else if (strcmp(argv[
i],
"--mass1")==0){
271 params->mass1 = atof(argv[++
i]);}
272 else if (strcmp(argv[
i],
"--mass2")==0){
273 params->mass2 = atof(argv[++
i]);}
274 else if (strcmp(argv[
i],
"--massChoice")==0){
275 if (strcmp(argv[++
i],
"masses")==0){
277 else if (strcmp(argv[
i],
"psi")==0){
280 else if (strcmp(argv[
i],
"--fLower")==0){
281 params->fLower = atof(argv[++
i]);}
282 else if (strcmp(argv[
i],
"--fcutoff")==0){
283 params->fCutoff = atof(argv[++
i]);}
284 else if (strcmp(argv[
i],
"--fFinal")==0){
285 params->fFinal = atof(argv[++
i]);}
286 else if (strcmp(argv[
i],
"--distance")==0){
288 else if (strcmp(argv[
i],
"--startPhase")==0){
289 params->startPhase = atof(argv[++
i]); }
290 else if (strcmp(argv[
i],
"--startTime")==0){
291 params->startTime = atof(argv[++
i]); }
292 else if (strcmp(argv[
i],
"--inclination")==0){
294 else if (strcmp(argv[
i],
"--sourceTheta")==0){
295 params->sourceTheta = atof(argv[++
i]); }
296 else if (strcmp(argv[
i],
"--sourcePhi")==0){
297 params->sourcePhi = atof(argv[++
i]); }
298 else if (strcmp(argv[
i],
"--polarisationAngle")==0){
299 params->polarisationAngle = atof(argv[++
i]); }
300 else if (strcmp(argv[
i],
"--spin1x")==0){
301 params->spin1[0]= atof(argv[++
i]);}
302 else if (strcmp(argv[
i],
"--spin1y")==0){
303 params->spin1[1]= atof(argv[++
i]); }
304 else if (strcmp(argv[
i],
"--spin1z")==0){
305 params->spin1[2]= atof(argv[++
i]); }
306 else if (strcmp(argv[
i],
"--spin2x")==0){
307 params->spin2[0]= atof(argv[++
i]);}
308 else if (strcmp(argv[
i],
"--spin2y")==0){
309 params->spin2[1]= atof(argv[++
i]);}
310 else if (strcmp(argv[
i],
"--spin2z")==0){
311 params->spin2[2]= atof(argv[++
i]);}
312 else if (strcmp(argv[
i],
"--tSampling")==0){
313 params->tSampling = atof(argv[++
i]); }
314 else if (strcmp(argv[
i],
"--nStartPad")==0){
315 params->nStartPad = atoi(argv[++
i]);}
316 else if (strcmp(argv[
i],
"--nEndPad")==0){
317 params->nEndPad = atoi(argv[++
i]);}
318 else if (strcmp(argv[
i],
"--eccentricity")==0){
320 else if (strcmp(argv[
i],
"--ieta")==0){
321 params->ieta = atof(argv[++
i]); }
322 else if (strcmp(argv[
i],
"--Theta")==0){
323 params->Theta = atof(argv[++
i]); }
324 else if (strcmp(argv[
i],
"--Zeta2")==0){
325 params->Zeta2 = atof(argv[++
i]); }
326 else if (strcmp(argv[
i],
"--OmegaS")==0){
327 params->OmegaS = atof(argv[++
i]); }
328 else if (strcmp(argv[
i],
"--alpha")==0){
329 params->alpha = atof(argv[++
i]); }
330 else if (strcmp(argv[
i],
"--psi0")==0){
331 params->psi0 = atof(argv[++
i]); }
332 else if (strcmp(argv[
i],
"--psi3")==0){
333 params->psi3 = atof(argv[++
i]); }
334 else if (strcmp(argv[
i],
"--alpha1")==0){
335 params->alpha1 = atof(argv[++
i]); }
336 else if (strcmp(argv[
i],
"--alpha2")==0){
337 params->alpha2 = atof(argv[++
i]); }
338 else if (strcmp(argv[
i],
"--alpha3")==0){
339 params->alpha3 = atof(argv[++
i]); }
340 else if (strcmp(argv[
i],
"--alpha4")==0){
341 params->alpha4 = atof(argv[++
i]); }
342 else if (strcmp(argv[
i],
"--alpha5")==0){
343 params->alpha5 = atof(argv[++
i]); }
344 else if (strcmp(argv[
i],
"--alpha6")==0){
345 params->alpha6 = atof(argv[++
i]); }
346 else if (strcmp(argv[
i],
"--beta")==0){
347 params->beta = atof(argv[++
i]); }
348 else if (strcmp(argv[
i],
"--orbitTheta0")==0){
349 params->orbitTheta0 = atof(argv[++
i]); }
350 else if (strcmp(argv[
i],
"--orbitPhi0")==0){
351 params->orbitPhi0 = atof(argv[++
i]); }
352 else if (strcmp(argv[
i],
"--chi")==0){
353 params->chi = atof(argv[++
i]); }
354 else if (strcmp(argv[
i],
"--kappa")==0){
355 params->kappa = atof(argv[++
i]); }
356 else if (strcmp(argv[
i],
"--interaction")==0)
358 if (strcmp(argv[++
i],
"NO")==0){
360 else if (strcmp(argv[
i],
"SO15")==0){
362 else if (strcmp(argv[
i],
"SS")==0){
364 else if (strcmp(argv[
i],
"SSself")==0){
366 else if (strcmp(argv[
i],
"QM")==0){
368 else if (strcmp(argv[
i],
"SO25")==0){
370 else if (strcmp(argv[
i],
"SO30")==0){
372 else if (strcmp(argv[
i],
"AllSpin")==0){
374 else if (strcmp(argv[
i],
"Tidal")==0){
376 else if (strcmp(argv[
i],
"Tidal6")==0){
378 else if (strcmp(argv[
i],
"All")==0){
381 fprintf(stderr,
"Invalid choice of --interaction\n");
383 else if (strcmp(argv[
i],
"--axisChoice")==0)
385 if (strcmp(argv[++
i],
"TotalJ")==0){
387 else if (strcmp(argv[
i],
"View")==0){
389 else if (strcmp(argv[
i],
"OrbitalL")==0){
392 fprintf(stderr,
"Invalid choice of --axisChoice\n");
394 else if (strcmp(argv[
i],
"--fixedStep")==0){
395 params->fixedStep = atoi(argv[++
i]); }
396 else if (strcmp(argv[
i],
"--inspiralOnly")==0){
397 params->inspiralOnly = atoi(argv[++
i]); }
413 printf(
"# approximant = %-15.12d\n",
params.approximant);
414 printf(
"# order = %-15.12d\n",
params.order);
415 printf(
"# ampOrder = %-15.12d\n",
params.ampOrder);
416 printf(
"# mass1 = %-15.12f\n",
params.mass1);
417 printf(
"# mass2 = %-15.12f\n",
params.mass2);
418 printf(
"# fLower = %-15.12f\n",
params.fLower);
419 printf(
"# fCutoff = %-15.12f\n",
params.fCutoff);
421 printf(
"# startPhase = %-15.12f\n",
params.startPhase);
422 printf(
"# startTime = %-15.12f\n",
params.startTime);
424 printf(
"# sourceTheta = %-15.12f\n",
params.sourceTheta);
425 printf(
"# sourcePhi = %-15.12f\n",
params.sourcePhi);
426 printf(
"# polarisationAngle = %-15.12f\n",
params.polarisationAngle);
427 printf(
"# spin1 x = %-15.12f\n",
params.spin1[0]);
428 printf(
"# spin1 y = %-15.12f\n",
params.spin1[1]);
429 printf(
"# spin1 z = %-15.12f\n",
params.spin1[2]);
430 printf(
"# spin2 x = %-15.12f\n",
params.spin2[0]);
431 printf(
"# spin2 y = %-15.12f\n",
params.spin2[1]);
432 printf(
"# spin2 z = %-15.12f\n",
params.spin2[2]);
433 printf(
"# tSampling = %-15.12f\n",
params.tSampling);
434 printf(
"# nStartPad = %-15.12d\n",
params.nStartPad);
435 printf(
"# nEndPad = %-15.12d\n",
params.nStartPad);
437 printf(
"# ieta = %-15.12d\n",
params.ieta);
438 printf(
"# Theta = %-15.12f\n",
params.Theta);
439 printf(
"# Zeta2 = %-15.12f\n",
params.Zeta2);
440 printf(
"# OmegaS = %-15.12f\n",
params.OmegaS);
441 printf(
"# alpha = %-15.12f\n",
params.alpha);
442 printf(
"# psi0 = %-15.12f\n",
params.psi0);
443 printf(
"# psi3 = %-15.12f\n",
params.psi3);
444 printf(
"# alpha1 = %-15.12f\n",
params.alpha1);
445 printf(
"# alpha2 = %-15.12f\n",
params.alpha2);
446 printf(
"# alpha3 = %-15.12f\n",
params.alpha3);
447 printf(
"# alpha4 = %-15.12f\n",
params.alpha4);
448 printf(
"# alpha5 = %-15.12f\n",
params.alpha5);
449 printf(
"# alpha6 = %-15.12f\n",
params.alpha6);
450 printf(
"# beta = %-15.12f\n",
params.beta);
451 printf(
"# chi = %-15.12f\n",
params.chi);
452 printf(
"# kappa = %-15.12f\n",
params.kappa);
453 printf(
"# orbitTheta0 = %-15.12f\n",
params.orbitTheta0);
454 printf(
"# orbitPhi0 = %-15.12f\n",
params.orbitPhi0);
455 printf(
"# interaction = %-15.12d\n",
params.interaction);
456 printf(
"# axisChoice = %-15.12d\n",
params.axisChoice);
457 printf(
"# fixedStep = %-15.12d\n",
params.fixedStep);
458 printf(
"# inspiralOnly = %-15.12d\n",
params.inspiralOnly);
462 printf(
"# chirpMass = %-15.12f\n",
params.chirpMass);
463 printf(
"# eta = %-15.12f\n",
params.eta);
464 printf(
"# totalMass = %-15.12f\n",
params.totalMass);
465 printf(
"# mu = %-15.12f\n",
params.mu);
466 printf(
"# fFinal = %-15.12f\n",
params.fFinal);
467 printf(
"# t0 = %-15.12f\n",
params.t0);
468 printf(
"# t2 = %-15.12f\n",
params.t2);
469 printf(
"# t3 = %-15.12f\n",
params.t3);
470 printf(
"# t4 = %-15.12f\n",
params.t4);
471 printf(
"# t5 = %-15.12f\n",
params.t5);
472 printf(
"# t6 = %-15.12f\n",
params.t6);
473 printf(
"# t7 = %-15.12f\n",
params.t7);
474 printf(
"# tC = %-15.12f\n",
params.tC);
475 printf(
"# signalAmplitude = %-15.12f\n",
params.signalAmplitude);
476 printf(
"# vFinal = %-15.12f\n",
params.vFinal);
477 printf(
"# end_time (s) = %-15.12d\n",
params.end_time.gpsSeconds);
478 printf(
"# end_time (ns) = %-15.12d\n",
params.end_time.gpsNanoSeconds);
479 printf(
"# massChoice = %-15.12d\n",
params.massChoice);
551 fprintf(stderr,
"InspiralTemplate Structure; parsing arguments\n");
552 fprintf(stderr,
"--approximant (TaylorT1, TaylorT2, TaylorT3, TaylorT4,\n");
553 fprintf(stderr,
"\t\tTaylorF1, TaylorF2, TaylorF2RedSpin, PadeT1, PadeF1, BCV, BCVSpin\n");
554 fprintf(stderr,
"\t\tBCVC, SpinTaylorT3, SpinTaylorFrameless, SpinTaylor,\n");
555 fprintf(stderr,
"\t\tSpinQuadTaylor, PhenSpinTaylorRD,\n");
556 fprintf(stderr,
"\t\tFindChirpSP, FindChirpPTF, GeneratePPN, AmpCorPPN,\n");
557 fprintf(stderr,
"\t\tFrameFile, NumRel, Eccentricity, EOB, EOBNR,\n");
558 fprintf(stderr,
"\t\tIMRPhenomA, IMRPhenomB, IMRPhenomFA, IMRPhenomFB,\n");
559 fprintf(stderr,
"\t\tTaylorEt, TaylorN)\n");
560 fprintf(stderr,
"--order (0, 1, 2, 3, 4, 5, 6, 7, 8 (i.e. 4==twoPN)\n");
561 fprintf(stderr,
"--ampOrder (0, 1, 2, 3, 4, 5 (i.e. 4==twoPN)\n");
562 fprintf(stderr,
"--mass1 (in solar mass)\n");
563 fprintf(stderr,
"--mass2 (in solar mass)\n");
564 fprintf(stderr,
"--massChoice ('psi' for BCV(Spin) or 'masses' otherwise)\n");
565 fprintf(stderr,
"--fLower (in Hz)\n");
566 fprintf(stderr,
"--fCutoff (in Hz)\n");
567 fprintf(stderr,
"--fFinal (in Hz - not usually needed)\n");
568 fprintf(stderr,
"--distance (in Mpc)\n");
569 fprintf(stderr,
"--startPhase \n");
570 fprintf(stderr,
"--startTime \n");
571 fprintf(stderr,
"--inclination (angle between L and line of sight in rad.)\n");
572 fprintf(stderr,
"--sourceTheta (source sky position zenith angle)\n");
573 fprintf(stderr,
"--sourcePhi (source sky position azimuth angle)\n");
574 fprintf(stderr,
"--polarisationAngle (i.e. 'psi' in antenna patterns)\n");
575 fprintf(stderr,
"--spin1x (Vector components for spin for mass1)\n");
576 fprintf(stderr,
"--spin1y (Only used by spinning waveforms)\n");
577 fprintf(stderr,
"--spin1z (Kerr limit: s1x^2 + s1y^2 + s1z^2 <= 1)\n");
578 fprintf(stderr,
"--spin2x (Vector components for spin for mass2)\n");
579 fprintf(stderr,
"--spin2y (Only used by spinning waveforms)\n");
580 fprintf(stderr,
"--spin2z (Kerr limit: s1x^2 + s1y^2 + s1z^2 <= 1)\n");
581 fprintf(stderr,
"--tSampling (sample rate in Hz)\n");
582 fprintf(stderr,
"--nStartPad (# samples of zero padding at start)\n");
583 fprintf(stderr,
"--nEndPad (# samples of zero padding at end)\n");
584 fprintf(stderr,
"--eccentricity \n");
585 fprintf(stderr,
"--ieta (set to 0 to turn off eta dependence)\n");
586 fprintf(stderr,
"--Theta (EOB 3PN - not used anymore)\n");
587 fprintf(stderr,
"--Zeta2 (EOB 3PN - not used anymore)\n");
588 fprintf(stderr,
"--OmegaS (EOB 3PN - not used anymore)\n");
589 fprintf(stderr,
"--alpha (BCV must be > 0)\n");
590 fprintf(stderr,
"--psi0 (BCV must be > 0)\n");
591 fprintf(stderr,
"--psi3 (BCV must be < 0)\n");
592 fprintf(stderr,
"--alpha1 (BCVSpin)\n");
593 fprintf(stderr,
"--alpha2 (BCVSpin)\n");
594 fprintf(stderr,
"--alpha3 (BCVSpin)\n");
595 fprintf(stderr,
"--alpha4 (BCVSpin)\n");
596 fprintf(stderr,
"--alpha5 (BCVSpin)\n");
597 fprintf(stderr,
"--alpha6 (BCVSpin)\n");
598 fprintf(stderr,
"--beta (BCVSpin)\n");
599 fprintf(stderr,
"--chi (PTF spin magnitude)\n");
600 fprintf(stderr,
"--kappa (PTF spin angle cosine)\n");
601 fprintf(stderr,
"--orbitTheta0 (initial orientation of L - not used)\n");
602 fprintf(stderr,
"--orbitPhi0 (initial orientation of L - not used)\n");
603 fprintf(stderr,
"--interaction (used by PhenSpinTaylorRD to control spin effects included)\n");
604 fprintf(stderr,
" NO - no spin effects\n");
605 fprintf(stderr,
" SO - spin-orbit effects (default)\n");
606 fprintf(stderr,
" SS - spin-spin effects\n");
607 fprintf(stderr,
" SSself - self spin-spin effects\n");
608 fprintf(stderr,
" QM - quadrupole-monopole effects\n");
609 fprintf(stderr,
" Allspin - all of the above effects\n");
610 fprintf(stderr,
"--inputAxis (used by PhenSpinTaylorRD to set frame z-axis)\n");
611 fprintf(stderr,
" TotalJ - z-axis along initial total angular momentum\n");
612 fprintf(stderr,
" View - z-axis along line of sight\n");
613 fprintf(stderr,
" OrbitalL - z-axis along initial orbital angular momentum\n");
614 fprintf(stderr,
"--fixedStep (used by PhenSpinTaylorRD to set integrator)\n");
615 fprintf(stderr,
" 1 - use fixed step integrator\n");
616 fprintf(stderr,
" other - use adaptive step integrator (default)\n");
617 fprintf(stderr,
"--inspiralOnly (used by PhenSpinTaylorRD to attach RD or not)\n");
618 fprintf(stderr,
" 1 - inspiral-only waveform\n");
619 fprintf(stderr,
" other - attach ringdown for IMR waveform (default)\n");
626int main (
int argc ,
char **argv) {
633 REAL8 dt, cosI, ampFac, plusFac, crossFac, dist;
644 FILE *f1=NULL, *f2=NULL, *f3=NULL, *f4=NULL;
652 strncpy(otherIn.
tag,
"1",
sizeof(otherIn.
tag));
677 fprintf(stderr,
"Length is not enough\n");
685 sprintf(name1,
"wave-TD-%s.dat", otherIn.
tag); f1 = fopen(name1,
"w");
686 sprintf(name1,
"wave-OT-%s.dat", otherIn.
tag); f2 = fopen(name1,
"w");
687 sprintf(name1,
"wave-NW-%s.dat", otherIn.
tag); f3 = fopen(name1,
"w");
688 sprintf(name1,
"wave-FD-%s.dat", otherIn.
tag); f4 = fopen(name1,
"w");
695 fprintf(stderr,
"the inspiral structure (your parameters) before the call to the waveform generation:\n");
706 n *= pow(1./(1.+
params.ampOrder/2.), -8./3.);
711 fprintf(stderr,
"#Testing Inspiral Signal Generation Codes:\n");
712 fprintf(stderr,
"#Signal n=%d, t0=%e, t2=%e, t3=%e\n",
714 fprintf(stderr,
"#size in bins %d\n",
n);
730 switch (
params.approximant)
751 plusFac = ampFac * (1.0 + cosI*cosI);
752 params.signalAmplitude = plusFac;
760 crossFac = ampFac * 2.0 * cosI;
761 params.signalAmplitude = crossFac;
776 fprintf(stderr,
"Warning! approximant appears to be unknown\n");
808 plusFac = ampFac * (1.0 + cosI*cosI);
809 params.signalAmplitude = plusFac;
816 crossFac = ampFac * 2.0 * cosI;
817 params.signalAmplitude = crossFac;
838 REAL8 df, f, hSq, sSq, hMag, sMag, sRe, sIm, rho, rhosq=0, rhoDet=8.;
850 for (
i=1;
i<nby2;
i++)
857 sIm = signal2->
data[j] *
dt;
858 hSq = sRe*sRe + sIm*sIm;
860 sSq = hSq / (psd->
data[
i]) ;
861 sMag = hMag / (psd->
data[
i]) ;
871 signal2->
data[j] = sIm / sqrt(psd->
data[
i]);
881 f, sMag, psd->
data[
i]);
887 signal2->
data[
i] = 0.;
888 signal2->
data[j] = 0.;
896 rho = sqrt(4. * rhosq *
df);
901 fprintf(stderr,
"mass1: %e, mass2: %e, # samples: %d,\nSNR: %e, "
902 "distance at which SNR=8: %e\n",
params.mass1,
params.mass2,
903 signal2->
length, rho, dist);
905 signal2->
data[0] = 0.;
906 signal2->
data[nby2] = 0.;
919 fprintf(stderr,
"fFinal = %f Hz tFinal = %f seconds\n" ,
921 fprintf(stderr,
"the inspiral structure after the call "
922 "to the waveform generation:\n");
949 if ( strcmp(argv[
i],
"--verbose") == 0 )
953 else if ( strcmp(argv[
i],
"--output") == 0 )
955 otherIn->
output = atoi(argv[++
i]);
957 else if ( strcmp(argv[
i],
"--taper") == 0 )
959 otherIn->
taper = atoi(argv[++
i]);
961 else if ( strcmp(argv[
i],
"--psd-data-file") == 0 )
965 else if( strcmp(argv[
i],
"--h") == 0 )
969 else if( strcmp(argv[
i],
"-h") == 0 )
973 else if( strcmp(argv[
i],
"-help") == 0 )
977 else if( strcmp(argv[
i],
"--help") == 0 )
981 else if( strcmp(argv[
i],
"--tag") == 0 )
983 strncpy(otherIn->
tag, argv[++
i],
sizeof(otherIn->
tag) - 1);
985 else if( strcmp(argv[
i],
"--approximant") == 0 )
989 else if( strcmp(argv[
i],
"--order") == 0 )
991 order = atoi(argv[++
i]);
993 else if( strcmp(argv[
i],
"--real-imag") == 0 )
999 if( otherIn->
output == 3 )
1029 printf(
" WARNING: you have chose Newtonian order\n");
1033 printf(
"Invalid PN order requested, using 3.5PN\n");
1044 fprintf(stderr,
"GenerateInspiralWaveform Help\n");
1045 fprintf(stderr,
"---------------------------------------------------------\n");
1046 fprintf(stderr,
"All unspecified parameters use default values.\n");
1047 fprintf(stderr,
"If you don't know what a parameter does it's");
1048 fprintf(stderr,
" (probably) safe to omit it.\n");
1049 fprintf(stderr,
"---------------------------------------------------------\n");
1050 fprintf(stderr,
"--h for help\n");
1051 fprintf(stderr,
"--verbose to print Inspiral Template parameters\n");
1052 fprintf(stderr,
"--tag TAG adds 'TAG' identifier to file names\n");
1053 fprintf(stderr,
"--psd-data-file file.dat reads noise curve from file.dat (NOT WORKING YET!)\n");
1054 fprintf(stderr,
"\t Initial LIGO design PSD used if no PSD file is given\n");
1055 fprintf(stderr,
"--output=N to generate time and freq. domain waveforms:\n");
1056 fprintf(stderr,
" N = 0 - do not output any files (default)\n");
1057 fprintf(stderr,
" N = 1 - output plus polarization h+\n");
1058 fprintf(stderr,
" N = 2 - output cross polarization hx\n");
1059 fprintf(stderr,
" N = 3 - output measured strain h = F+ h+ + Fx hx\n");
1060 fprintf(stderr,
"For N != 0, the waveform will be written to these files:\n");
1061 fprintf(stderr,
" wave-TD-TAG.dat (time domain)\n");
1062 fprintf(stderr,
" wave-OT-TAG.dat (TD (Wiener) optimal template)\n");
1063 fprintf(stderr,
" wave-FD-TAG.dat (frequency domain)\n");
1064 fprintf(stderr,
" wave-NW-TAG.dat (noise-weighted FD)\n");
1065 fprintf(stderr,
"Note: Not all approximants support all types of output\n");
1066 fprintf(stderr,
" N = 1 calls LALInspiralWave()\n");
1067 fprintf(stderr,
" N = 2 calls LALInspiralWaveTemplates()\n");
1068 fprintf(stderr,
" N = 3 calls LALInspiralWaveForInjection() via LALGenerateInspiral()\n");
1069 fprintf(stderr,
"If the approximant you want fails, make it callable from these functions\n");
1070 fprintf(stderr,
"--real-imag=N controls output of complex FD and NW waveforms:\n");
1071 fprintf(stderr,
" N = 0 - output | h(f) | (default)\n");
1072 fprintf(stderr,
" N = 1 - output Re(h(f)) and Im(h(f))\n");
1073 fprintf(stderr,
"---------------------------------------------------------\n");
1106 outfile1=fopen(
"wave2.dat",
"w");
1126 f1 = fopen(
"lho4k_070318_strain.txt",
"r");
1128 if (
fscanf(f1,
"%e %e", &f, &
x) == EOF)
1130 fprintf(stderr,
"Problem reading file lho4k_070318_strain.txt stopping\n");
1135 fprintf(stderr,
"Incompatible frequency resolution, exiting\n");
1141 while(
fscanf(f1,
"%e %e", &f, &
x) != EOF &&
i<length)
1147 for (j=
i; j<length; j++)
1159 REAL4 Fp, Fc, hp, hc, A1, A2, cosshift, sinshift;
1168 ppnParams.
ppn = NULL;
1178 if (strstr(simTable.
waveform,
"PhenSpinTaylorRD")) {
1180 strcat(simTable.
waveform,
"OrbitalL");}
1182 strcat(simTable.
waveform,
"TotalJ");
1184 if (
params->inspiralOnly==1) {
1185 strcat(simTable.
waveform,
"inspiralOnly");
1187 if (
params->fixedStep==1) {
1188 strcat(simTable.
waveform,
"fixedStep");
1191 switch (
params->interaction) {
1196 strcat(simTable.
waveform,
"SO15PN");
1199 strcat(simTable.
waveform,
"SO25PN");
1214 strcat(simTable.
waveform,
"ALL_SPIN");
1217 strcat(simTable.
waveform,
"TIDAL5PN");
1259 sprintf(simTable.
taper,
"TAPER_NONE");
1264 psi =
params->polarisationAngle;
1265 Fp = 0.5 * (1. + cos(
theta)*cos(
theta) ) * cos(2.*phi) * cos(2.*psi)
1266 - cos(
theta) * sin(2.*phi) * sin(2.*psi);
1267 Fc = 0.5 * (1. + cos(
theta)*cos(
theta) ) * cos(2.*phi) * sin(2.*psi)
1268 + cos(
theta) * sin(2.*phi) * cos(2.*psi);
1274 if( waveform.
h == NULL )
1279 if( waveform.
shift == NULL )
1281 for(
i = 0;
i < len;
i++)
1289 hp = A1 * cosshift * cosphi - A2 * sinshift * sinphi;
1290 hc = A1 * sinshift * cosphi + A2 * cosshift * sinphi;
1291 wave->
data[
i] = Fp * hp + Fc * hc;
1296 for(
i = 0;
i < len;
i++)
1304 hp = A1 * cosshift * cosphi - A2 * sinshift * sinphi;
1305 hc = A1 * sinshift * cosphi + A2 * cosshift * sinphi;
1306 wave->
data[
i] = Fp * hp + Fc * hc;
1313 for(
i = 0;
i < len;
i++)
void LALInspiralWaveTemplates(LALStatus *status, REAL4Vector *filter1, REAL4Vector *filter2, InspiralTemplate *params)
void LALInspiralSetup(LALStatus *status, expnCoeffs *ak, InspiralTemplate *params)
void LALInspiralInit(LALStatus *status, InspiralTemplate *params, InspiralInit *paramsInit)
void LALInspiralWave(LALStatus *status, REAL4Vector *signalvec, InspiralTemplate *params)
static double double delta
#define ATTATCHSTATUSPTR(statusptr)
#define DETATCHSTATUSPTR(statusptr)
#define INITSTATUS(statusptr)
#define RETURN(statusptr)
void LALGenerateInspiral(LALStatus *status, CoherentGW *waveform, SimInspiralTable *thisEvent, PPNParamStruc *ppnParams)
@ psi0Andpsi3
BCV parameters and .
@ m1Andm2
component masses
@ LAL_INSPIRAL_INTERACTION_TIDAL_5PN
Leading-order tidal interaction.
@ LAL_INSPIRAL_INTERACTION_ALL
all spin and tidal interactions
@ LAL_INSPIRAL_INTERACTION_TIDAL_6PN
Next-to-leading-order tidal interaction.
@ LAL_INSPIRAL_INTERACTION_SPIN_ORBIT_25PN
Next-to-leading-order spin-orbit interaction.
@ LAL_INSPIRAL_INTERACTION_QUAD_MONO_2PN
Quadrupole-monopole interaction.
@ LAL_INSPIRAL_INTERACTION_SPIN_ORBIT_3PN
Spin-spin interaction.
@ LAL_INSPIRAL_INTERACTION_NONE
No spin, tidal or other interactions.
@ LAL_INSPIRAL_INTERACTION_SPIN_SPIN_2PN
Spin-spin interaction.
@ LAL_INSPIRAL_INTERACTION_SPIN_ORBIT_15PN
Leading order spin-orbit interaction.
@ LAL_INSPIRAL_INTERACTION_ALL_SPIN
all spin interactions, no tidal interactions
@ LAL_INSPIRAL_INTERACTION_SPIN_SPIN_SELF_2PN
Spin-spin-self interaction.
void LALNoiseSpectralDensity(LALStatus *status, REAL8Vector *psd, void(*NoisePsd)(LALStatus *status, REAL8 *shf, REAL8 f), REAL8 df)
void LALLIGOIPsd(LALStatus UNUSED *status, REAL8 *psd, REAL8 f)
LAL_SIM_INSPIRAL_TAPER_START
LAL_SIM_INSPIRAL_TAPER_STARTEND
LAL_SIM_INSPIRAL_TAPER_END
LAL_SIM_INSPIRAL_FRAME_AXIS_VIEW
LAL_SIM_INSPIRAL_FRAME_AXIS_TOTAL_J
LAL_SIM_INSPIRAL_FRAME_AXIS_ORBITAL_L
REAL4FFTPlan * XLALCreateReverseREAL4FFTPlan(UINT4 size, int measurelvl)
REAL4FFTPlan * XLALCreateForwardREAL4FFTPlan(UINT4 size, int measurelvl)
void XLALDestroyREAL4FFTPlan(REAL4FFTPlan *plan)
int XLALREAL4VectorFFT(REAL4Vector *_LAL_RESTRICT_ output, const REAL4Vector *_LAL_RESTRICT_ input, const REAL4FFTPlan *plan)
void LALDCreateVector(LALStatus *, REAL8Vector **, UINT4)
void LALDDestroyVector(LALStatus *, REAL8Vector **)
void LALSDestroyVector(LALStatus *, REAL4Vector **)
void LALSCreateVector(LALStatus *, REAL4Vector **, UINT4)
REAL4TimeVectorSeries * a
REAL4TimeVectorSeries * h
The inspiral waveform parameter structure containing information about the waveform to be generated.
char waveformString[LIGOMETA_WAVEFORM_MAX]
This structure stores the parameters for constructing a restricted post-Newtonian waveform.
REAL4Vector * ppn
The parameters selecting the type of post-Newtonian expansion; If ppn=NULL, a "normal" (physical) ex...
REAL8 deltaT
The requested sampling interval of the waveform, in s.
UINT4 lengthIn
The maximum number of samples in the generated waveform; If zero, the waveforms can be arbitrarily lo...
REAL4VectorSequence * data
CHAR taper[LIGOMETA_INSPIRALTAPER_MAX]
CHAR waveform[LIGOMETA_WAVEFORM_MAX]
This structure contains various post-Newtonian and P-approximant expansion coefficients; the meanings...