Loading [MathJax]/extensions/TeX/AMSmath.js
LALInspiral 5.0.3.1-5e288d3
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
LALInspiralCreateCoarseBank.c
Go to the documentation of this file.
1/*
2* Copyright (C) 2007 David Churches, Duncan Brown, Jolien Creighton, B.S. Sathyaprakash, Steven Caudill, Anand Sengupta, Craig Robinson , Thomas Cokelaer, Chris Van Den Broeck
3*
4* This program is free software; you can redistribute it and/or modify
5* it under the terms of the GNU General Public License as published by
6* the Free Software Foundation; either version 2 of the License, or
7* (at your option) any later version.
8*
9* This program is distributed in the hope that it will be useful,
10* but WITHOUT ANY WARRANTY; without even the implied warranty of
11* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12* GNU General Public License for more details.
13*
14* You should have received a copy of the GNU General Public License
15* along with with program; see the file COPYING. If not, write to the
16* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
17* MA 02110-1301 USA
18*/
19
20/**
21 * \defgroup LALInspiralCreateCoarseBank_c Module LALInspiralCreateCoarseBank.c
22 * \ingroup LALInspiralBank_h
23 * \author Churches, D. K and Sathyaprakash, B.S.
24 * \brief Functions to create a coarse grid of templates.
25 *
26 * The coarse grid algorithm works in two stages:
27 * After computing the minimum and maximum chirp-times corresponding to the
28 * search space: \f$(\tau_0^\mathrm{min}, \tau_0^\mathrm{max}),\f$
29 * \f$(\tau_2^\mathrm{min}, \tau_2^\mathrm{max})\f$ (or [Note: In what follows
30 * we will only mention \f$\tau_3\f$; however, the algorithm is itself valid,
31 * and has been implemented, in the case of \f$(\tau_0,\tau_2)\f$ too. However,
32 * we recommend that the space \f$\tau_0\f$-\f$\tau_3\f$ be used.]
33 * \f$(\tau_3^\mathrm{min}, \tau_3^\mathrm{max})\f$) the algorithm
34 * <ol>
35 * <li> chooses a lattice of templates along the equal mass curve and then</li>
36 *
37 * <li> lays a rectangular grid in the rectangular region defined by
38 * the minimum and maximum values of the chirp-times and retain only
39 * if (a) the point lies in the parameter space, OR (b) one of the
40 * vertices defined by the rectangle lies in the parameter space.</li>
41 * </ol>
42 *
43 * ### Templates along the equal mass curve ###
44 *
45 * The algorithm works in two
46 * stages: In the first stage, templates are built along the equal
47 * mass (that is, \f$\eta=1/4\f$) curve starting from the minimum value
48 * of the Newtonian chirp-time and stopping at its maximum value.
49 * Given the \f$n\f$\ th template at \f$O\f$ with parameters \f$(\tau_0^{(n)},\tau_3^{(n)}),\f$
50 * and given also the distance between templates in our preferred coordinates
51 * \f$(D\tau_0^{(n)},D\tau_3^{(n)}),\f$
52 * consider lines \f$\tau_0 = \tau_0^{(n)} + D\tau_0^{(n)}\f$
53 * (\f$QA\f$ of \ref LALInspiralBankHequalmass "this figure") and
54 * \f$\tau_3 = \tau_3^{(n)} + D\tau_3^{(n)}\f$
55 * (\f$PB\f$ of \ref LALInspiralBankHequalmass "this figure").
56 *
57 * \anchor LALInspiralBankHequalmass
58 * \image html LALInspiralBankHequalmass.png "Algorithm sketching the placement of templates along eta=1/4 curve"
59 *
60 * The template next to
61 * \f$(\tau_0^{(n)},\tau_3^{(n)}),\f$ on the equal mass curve, must lie
62 * either along \f$PB\f$ or along \f$QA\f$ (cf. \ref LALInspiralBankHequalmass "this figure" in order
63 * that all the signals that may lie on \f$OAB\f$
64 * are spanned by at least one of the two templates. Clearly, if we were
65 * to place the \f$(n+1)\f$\ th template at \f$B,\f$ some of the signals won't
66 * have the required minimal match. However, placing the \f$(n+1)\f$\ th template at
67 * \f$A\f$ suffices our requirement.
68 * (Note, however, that there is
69 * no guarantee that this will always work; it works only if the curve
70 * along which templates are being laid is a slowly varying function.)
71 * To locate the \f$(n+1)\f$\ th template we
72 * compute the following pairs of coordinates:
73 * \f{eqnarray}{
74 * \tau_0^{(n+1)} = \tau_0^{(n)} + D\tau_0^{(n)}, \ \
75 * \tau_3^{(n+1)} = 4A_3 \left ( \frac{\tau_0^{(n+1)}}{4A_0} \right )^{2/5} \\
76 * \tau_3^{(n+1)} = \tau_3^{(n)} + D\tau_3^{(n)}, \ \
77 * \tau_0^{(n+1)} = 4A_0 \left ( \frac{\tau_3^{(n+1)}}{4A_3} \right )^{5/2},
78 * \f}
79 * where
80 * \f{equation}{
81 * A_0=\frac{5}{256 (\pi f_0)^{8/3}}, \ \ A_3=\frac{\pi}{8 (\pi f_0)^{5/3}}.
82 * \f}
83 * Of the two pairs, the required pair is the one that is closer to the
84 * starting point \f$(\tau_0^{(n)},\tau_3^{(n)}).\f$
85 *
86 * ### Templates in the rest of the parameter space ###
87 *
88 * In the second stage, the algorithm begins again at the point
89 * \f$(\tau_0^\mathrm{min}, \tau_3^\mathrm{min}),\f$
90 * corresponding distance between templates
91 * \f$(D\tau_0^\mathrm{min}, D\tau_3^\mathrm{min}),\f$ and chooses a rectangular lattice
92 * of templates in the rectangular region defined by
93 * \f$(\tau_0^\mathrm{min}, \tau_3^\mathrm{min})\f$
94 * \f$(\tau_0^\mathrm{max}, \tau_3^\mathrm{min})\f$
95 * \f$(\tau_0^\mathrm{max}, \tau_3^\mathrm{max})\f$ and
96 * \f$(\tau_0^\mathrm{min}, \tau_3^\mathrm{max})\f$.
97 * The implementation of the algorithm along the equal mass curve and
98 * in a rectangular lattice in the rest of the parameter space is shown
99 * plotted in \ref LALInspiralBankHCoarse2 "this figure", where the templates
100 * chosen are represented as points.
101 *
102 * \anchor LALInspiralBankHCoarse2
103 * \image html LALInspiralBankHCoarse2.png "Algorithm sketching the construction of a rectangular lattice of templates"
104 *
105 * ### Algorithm ###
106 *
107 * The algorithm to lay templates along the equal-mass curve is as follows:
108 * <tt>
109 * <ul>
110 * <li> Begin at \f$\tau_0 = \tau_0^\mathrm{min}\f$
111 * <li> do while \f$(\tau_0 < \tau_0^\mathrm{max})\f$<br>
112 * {
113 * <ul>
114 * <li> \f$\tau_0^A = \tau_0 + D\tau_0, \ \ \tau_3^A = 4A_3 \left ( {\tau_0^A}/{4A_0} \right )^{2/5}\f$
115 * <li> \f$\tau_3^B = \tau_3 + D\tau_3, \ \ \tau_0^B = 4A_0 \left ( {\tau_3^B}/{4A_3} \right )^{5/2}\f$
116 * <li> if (\f$(\tau_0^A,\tau_3^A)\f$ is closer \f$(\tau_0,\tau_3)\f$ than \f$(\tau_0^B,\tau_3^B)\f$)<br>
117 * {<br>
118 * \f$\tau_0 = \tau_0^A, \tau_3 = \tau_3^A\f$<br>
119 * }<br>
120 * <li> else <br>
121 * {<br>
122 * \f$\tau_0 = \tau_0^B, \tau_3 = \tau_3^B\f$ <br>
123 * }<br>
124 * <li> Add \f$(\tau_0, \tau_3)\f$ to InspiralTemplateList
125 * <li> numTemplates++
126 * <li> Compute metric at \f$(\tau_0, \tau_3)\f$
127 * <li> Compute distance between templates at new point: \f$(D\tau_0, D\tau_3)\f$
128 * </ul>
129 * }
130 * </ul>
131 * </tt>
132 *
133 * The algorithm to lay templates in the rest of the parameter space
134 * is as follows:
135 * <tt>
136 * <ul>
137 * <li> Begin at \f$\tau_0 = \tau_0^\mathrm{min}, \tau_3 = \tau_3^\mathrm{min}\f$
138 * <li> Compute metric at \f$(\tau_0, \tau_3)\f$
139 * <li> Compute distance between templates at new point: \f$(D\tau_0, D\tau_3)\f$
140 * <li> Add \f$(\tau_0, \tau_3)\f$ to InspiralTemplateList
141 * <li> numTemplates++
142 * <li> do while (\f$\tau_3 <= \tau_3^\mathrm{max}\f$)<br>
143 * {<br>
144 * <ul>
145 * <li> do while (\f$\tau_0 <= \tau_0^\mathrm{max}\f$)<br>
146 * {<br>
147 * <ul>
148 * <li> if (\f$(\tau_0, \tau_3)\f$ is inside the parameter space)<br>
149 * {<br>
150 * <ul>
151 * <li> Compute metric at (\f$\tau_0, \tau_3\f$)
152 * <li> Compute distance between templates at new point: (\f$D\tau_0, D\tau_3\f$)
153 * <li> Add (\f$\tau_0, \tau_3\f$) to InspiralTemplateList
154 * <li> numTemplates++
155 * </ul>
156 * }<br>
157 * <li> Increment \f$\tau_0:\f$ \f$\tau_0 = \tau_0 + D\tau_0\f$<br>
158 * </ul>
159 * }<br>
160 * <li> Increment \f$\tau_3:\f$ \f$\tau_3 = \tau_3 + D\tau_3\f$
161 * <li> Get next template along \f$\tau_3=\mathrm{const.}\f$: \f$(\tau_0, \tau_3)\f$<br>
162 * </ul>
163 * }<br>
164 * </ul>
165 * </tt>
166 */
167/** @{ */
168
169
170#include <stdio.h>
171#include <lal/LALInspiralBank.h>
172#include <lal/AVFactories.h>
173#include <lal/SeqFactories.h>
174#include <lal/LALStdio.h>
175#include <lal/FindRoot.h>
176
177
178/** \see See \ref LALInspiralCreateCoarseBank_c for documentation */
179void
181 LALStatus *status, /**< LAL-status pointer */
182 InspiralTemplateList **list, /**< [out] an array containing the template bank parameters */
183 INT4 *nlist, /**< [out] the number of templates found by the function */
184 InspiralCoarseBankIn coarseIn /**< [in] specifies the search space, range of masses, etc */
185 )
186{
187 INT4 i;
188
191
192 ASSERT( coarseIn.shf.data, status,
193 LALINSPIRALBANKH_ENULL, LALINSPIRALBANKH_MSGENULL );
194 ASSERT( coarseIn.shf.data->data, status,
195 LALINSPIRALBANKH_ENULL, LALINSPIRALBANKH_MSGENULL );
196 ASSERT( coarseIn.mmCoarse > 0.L, status,
197 LALINSPIRALBANKH_ESIZE, LALINSPIRALBANKH_MSGESIZE );
198 ASSERT( coarseIn.mmCoarse < 1.L, status,
199 LALINSPIRALBANKH_ESIZE, LALINSPIRALBANKH_MSGESIZE );
200 ASSERT( coarseIn.fLower > 0., status,
201 LALINSPIRALBANKH_ESIZE, LALINSPIRALBANKH_MSGESIZE );
202 ASSERT( coarseIn.tSampling > 0., status,
203 LALINSPIRALBANKH_ESIZE, LALINSPIRALBANKH_MSGESIZE );
204 ASSERT( coarseIn.tSampling >= 2.*coarseIn.fUpper, status,
205 LALINSPIRALBANKH_ESIZE, LALINSPIRALBANKH_MSGESIZE );
206
207 switch( coarseIn.approximant )
208 {
209 case BCV:
210 ASSERT( coarseIn.space == Psi0Psi3, status,
211 LALINSPIRALBANKH_ECHOICE, LALINSPIRALBANKH_MSGECHOICE );
212 LALInspiralCreateBCVBank( status->statusPtr, list, nlist, coarseIn );
214 break;
215
216 case AmpCorPPN:
217 case TaylorT1:
218 case TaylorT2:
219 case TaylorT3:
220 case TaylorT4:
221 case TaylorF1:
222 case TaylorF2:
223 case Eccentricity:
224 case PadeT1:
225 case PadeF1:
226 case EOB:
227 case EOBNR:
228 case EOBNRv2:
229 case IMRPhenomA:
230 case IMRPhenomB:
231 case TaylorEt:
232 case TaylorN:
233 case FindChirpPTF:
234 ASSERT( coarseIn.space == Tau0Tau2 || coarseIn.space == Tau0Tau3, status,
235 LALINSPIRALBANKH_ECHOICE, LALINSPIRALBANKH_MSGECHOICE );
236
237 /* Thomas:: we can use either a square placement or an hexagonal
238 * placement. The hexagonal placement is along the eigenvalues but
239 * not the square one.*/
240 if (coarseIn.gridSpacing == Hexagonal){
241 LALInspiralCreatePNCoarseBankHexa( status->statusPtr, list, nlist, coarseIn );
243 }
244 else if (coarseIn.gridSpacing == HybridHexagonal){
245 LALInspiralCreatePNCoarseBankHybridHexa( status->statusPtr, list, nlist, coarseIn );
247 }
248 else if (coarseIn.gridSpacing == SquareNotOriented){
249 LALInspiralCreatePNCoarseBank( status->statusPtr, list, nlist, coarseIn );
251 }
252 else {
253 ABORT( status, LALINSPIRALBANKH_EGRIDSPACING, LALINSPIRALBANKH_MSGEGRIDSPACING );
254 }
255
256 /* Anand:: Nudge the templates only if using max-total-mass cut */
257 if ( coarseIn.massRange == MinComponentMassMaxTotalMass ||
259 {
260 LALNudgeTemplatesToConstantTotalMassLine( status->statusPtr, list, (*nlist), coarseIn);
262 }
263
264 break;
265
266 default:
267 ABORT( status, LALINSPIRALBANKH_ECHOICE, LALINSPIRALBANKH_MSGECHOICE );
268 break;
269 }
270
271 /* record the minimal match of the bank in the template and */
272 /* set up the tmplts as a linked list so that it can be */
273 /* manipulated easily by findchirp */
274 for ( i = 0; i < *nlist - 1 ; ++i )
275 {
276 (*list)[i].params.minMatch = (REAL4) coarseIn.mmCoarse;
277 (*list)[i].params.next = &((*list)[i+1].params);
278 (*list)[i].params.fine = NULL;
279 }
280 (*list)[i].params.minMatch = (REAL4) coarseIn.mmCoarse;
281 (*list)[i].params.next = NULL;
282 (*list)[i].params.fine = NULL;
283
285 RETURN (status);
286}
287
288/**
289 * Anand: 26 October 2006
290 * This function nudges the templates in the list to
291 * the (max-total-mass = constant) line.
292 * This is done only for those templates whose total
293 * mass exceeds the desired max-total-mass value. The
294 * templates are nudged along the metric eigen direction
295 * until they lie on the said line.
296 */
297void
301 INT4 nlist,
302 InspiralCoarseBankIn coarseIn
303 )
304{
305 InspiralTemplate *tempPars=NULL;
306 InspiralMetric *metric=NULL;
307 InspiralMomentsEtc moments;
308
311
312 /* If there are no templates, return now */
313 if ( nlist <= 0 )
314 {
315 LALWarning( status, "number of templates is <= 0 ! " );
316
318 RETURN (status);
319 }
320
321 /* Allocate memory (only required to calculate noise moments) */
322 tempPars = (InspiralTemplate *)
323 LALCalloc( 1, sizeof(InspiralTemplate) );
324 metric = (InspiralMetric *)
325 LALCalloc( 1, sizeof(InspiralMetric) );
326
327 /* Init the tempPars */
328 LALInspiralSetParams( status->statusPtr, tempPars, coarseIn );
330
331 tempPars->totalMass = coarseIn.MMax;
332 tempPars->eta = 0.25;
333 tempPars->ieta = 1.L;
334 tempPars->fLower = coarseIn.fLower;
335 tempPars->massChoice = totalMassAndEta;
336 LALInspiralParameterCalc( status->statusPtr, tempPars );
338
339 /* Get the moments of the PSD required in the computation of the metric */
340 LALGetInspiralMoments( status->statusPtr, &moments, &coarseIn.shf, tempPars );
342
343 /* Loop over template list and nudge the templates if required */
344 {
345 INT4 i;
346 REAL4 P, Q, M, C, ms; /*, t0, t3;*/
347
348 M = coarseIn.MMax*LAL_MTSUN_SI;
349 P = (5./256.)*pow( (LAL_PI*coarseIn.fLower), -8./3. ) ;
350 Q = (LAL_PI/8.)*pow( (LAL_PI*coarseIn.fLower), -5./3. ) ;
351
352 for (i=0; i < nlist; i++)
353 {
354 /* If the totalMass of this template exceeds max-total-mass
355 * then nudge along the metric eigen-direction.
356 */
357 if ( (*list)[i].params.totalMass > coarseIn.MMax )
358 {
359 ms = tan( LAL_PI/2. + (*list)[i].metric.theta );
360 C = (*list)[i].params.t3 - ms*((*list)[i].params.t0);
361
362 /* Calculate the new co-ordinates in tau0-tau3 space */
363 (*list)[i].params.t3 = C / ( 1. - (ms*P/(M*Q)) );
364 (*list)[i].params.t0 = P*(*list)[i].params.t3/(M*Q);
365
366 /* Calculate the other parameters */
367 LALInspiralParameterCalc( status->statusPtr, &(*list)[i].params );
369
370 /* Check that the new point has not gone down below the
371 * equal mass line. If it has, set it to m1=m2=coarseIn.MMax/2.0
372 */
373 if ( (*list)[i].params.eta > 0.25L )
374 {
375 InputMasses originalMassChoice = (*list)[i].params.massChoice;
376
377 (*list)[i].params.totalMass = coarseIn.MMax ;
378 (*list)[i].params.eta = 0.25L;
379 (*list)[i].params.massChoice = totalMassAndEta;
380
381 LALInspiralParameterCalc( status->statusPtr, &(*list)[i].params );
383
384 /* Reset the massChoice to whatever it was */
385 (*list)[i].params.massChoice = originalMassChoice;
386 }
387
388 /* Recalculate the metric at this new point */
389 LALInspiralComputeMetric( status->statusPtr, &((*list)[i].metric),
390 &((*list)[i].params), &moments );
392 }
393 }/* Loop over templates */
394 }
395
396 /* Clean up */
397 LALFree( tempPars );
398 LALFree( metric );
399
400 /* Normal exit */
402 RETURN (status);
403}
404
405/** \see See \ref LALInspiralCreateCoarseBank_c for documentation */
406void
410 INT4 *nlist,
411 InspiralCoarseBankIn coarseIn
412 )
413{
414 InspiralBankParams bankPars, bankParsOld;
415 InspiralTemplate *tempPars;
416 InspiralMetric metric;
417 InspiralMomentsEtc moments;
418 INT4 validPars;
419 REAL8 x01, x02, x11, x12, dist1, dist2, ndx1, ndx2, a25;
420
423
424 ASSERT( coarseIn.mMin > 0., status,
425 LALINSPIRALBANKH_ESIZE, LALINSPIRALBANKH_MSGESIZE );
426 ASSERT( coarseIn.mMax > 0., status,
427 LALINSPIRALBANKH_ESIZE, LALINSPIRALBANKH_MSGESIZE );
428 ASSERT( coarseIn.MMax >= 2.*coarseIn.mMin, status,
429 LALINSPIRALBANKH_ESIZE, LALINSPIRALBANKH_MSGESIZE );
430
431 ndx1 = 0.0;
432 ndx2 = 0.0;
433 a25 = 0.0;
434
435 /* Number of templates is nlist */
436 *nlist = 0;
437
438 /* Set the elements of the metric and tempPars structures in */
439 /* conformity with the coarseIn structure */
440 if ( !
441 (tempPars = (InspiralTemplate *)LALCalloc( 1, sizeof(InspiralTemplate) ))
442 )
443 {
444 ABORT( status, LALINSPIRALBANKH_EMEM, LALINSPIRALBANKH_MSGEMEM );
445 }
446 metric.space = coarseIn.space;
447 LALInspiralSetParams( status->statusPtr, tempPars, coarseIn );
449
450 /* Identify the boundary of search and parameters for the */
451 /* first lattice point */
452 LALInspiralSetSearchLimits( status->statusPtr, &bankPars, coarseIn );
454 tempPars->totalMass = coarseIn.MMax;
455 tempPars->eta = 0.25;
456 tempPars->ieta = 1.L;
457 tempPars->fLower = coarseIn.fLower;
458 tempPars->massChoice = totalMassAndEta;
459 LALInspiralParameterCalc( status->statusPtr, tempPars );
461
462 /* Get the moments of the PSD integrand and other parameters */
463 /* required in the computation of the metric */
464 LALGetInspiralMoments( status->statusPtr, &moments, &coarseIn.shf, tempPars );
466
467 /* compute the metric at this point, update bankPars and add */
468 /* the params to the list */
469 LALInspiralComputeMetric( status->statusPtr, &metric, tempPars, &moments );
471 LALInspiralUpdateParams( status->statusPtr, &bankPars, metric,
472 coarseIn.mmCoarse );
474
475 /* add the first template to the template list */
476 *list = (InspiralTemplateList*)
477 LALRealloc( *list, sizeof(InspiralTemplateList) * (*nlist + 1) );
478 if ( ! *list )
479 {
480 LALFree( tempPars );
481 ABORT( status, LALINSPIRALBANKH_EMEM, LALINSPIRALBANKH_MSGEMEM );
482 }
483 memset( *list + *nlist, 0, sizeof(InspiralTemplateList) );
484
485 (*list)[*nlist].ID = *nlist;
486 (*list)[*nlist].params = *tempPars;
487 (*list)[*nlist].metric = metric;
488 ++(*nlist);
489
490 /* First lay templates along the equal mass curve; i.e. eta=1/4. */
491 /* Choose the constant and the index converting the chirp times to */
492 /* one another along the curve depending on whether the templates */
493 /* are laid along the tau0-tau2 or tau0-tau3 space */
494 switch ( coarseIn.space )
495 {
496 case Tau0Tau2:
497 ndx1 = 0.6L;
498 ndx2 = 1.L/ndx1;
499 a25 = pow(64.L/5.L, ndx1)*(2435.L/8064.L)/pow(LAL_PI*coarseIn.fLower,.4L);
500 break;
501
502 case Tau0Tau3:
503 a25 = LAL_PI_2 * pow(64.L/5.L, .4L)/pow(LAL_PI * coarseIn.fLower, .6L);
504 ndx1 = 0.4L;
505 ndx2 = 2.5L;
506 break;
507
508 case Psi0Psi3:
509 case PTFIntrinsic:
510 case PTFFull:
511 ABORT( status, LALINSPIRALBANKH_ECHOICE, LALINSPIRALBANKH_MSGECHOICE );
512 break;
513 }
514
515 bankParsOld = bankPars;
516
517 while ( bankPars.x0 < bankPars.x0Max )
518 {
519 x01 = bankPars.x0 + bankPars.dx0;
520 x11 = a25 * pow(x01,ndx1);
521 x12 = bankPars.x1 + bankPars.dx1;
522 x02 = pow(x12/a25,ndx2);
523 dist1 = pow(bankPars.x0 - x01,2.L) + pow(bankPars.x1 - x11, 2.L);
524 dist2 = pow(bankPars.x0 - x02,2.L) + pow(bankPars.x1 - x12, 2.L);
525 if ( dist1 < dist2 )
526 {
527 bankPars.x0 = x01;
528 bankPars.x1 = x11;
529 }
530 else
531 {
532 bankPars.x0 = x02;
533 bankPars.x1 = x12;
534 }
535
536 /* If this is a valid point add it to our list */
538 &validPars, bankPars, coarseIn );
540
541 if ( validPars )
542 {
544 tempPars, bankPars, coarseIn);
547 &metric, tempPars, &moments );
550 &bankPars, metric, coarseIn.mmCoarse );
552
553 *list = (InspiralTemplateList *)
554 LALRealloc( *list, sizeof(InspiralTemplateList) * (*nlist + 1) );
555 if ( ! *list )
556 {
557 LALFree( tempPars );
558 ABORT( status, LALINSPIRALBANKH_EMEM, LALINSPIRALBANKH_MSGEMEM );
559 }
560 memset( *list + *nlist, 0, sizeof(InspiralTemplateList) );
561
562 (*list)[*nlist].ID = *nlist;
563 (*list)[*nlist].params = *tempPars;
564 (*list)[*nlist].metric = metric;
565 ++(*nlist);
566 }
567 }
568
569 /* Begin with the parameters found at the first lattice point */
570 bankPars = bankParsOld;
571
572 /* Loop along x1 and x0 coordinates until maximum values are reached */
573 while ( bankPars.x1 <= bankPars.x1Max )
574 {
575 /* step along the tau0 axis until the boundary is reached */
576 while ( bankPars.x0 <= bankPars.x0Max )
577 {
578 /* If this is a valid point add it to our list */
580 &validPars, bankPars, coarseIn );
582
583 if ( validPars )
584 {
586 tempPars, bankPars, coarseIn );
589 &metric, tempPars, &moments );
592 &bankPars, metric, coarseIn.mmCoarse );
594
595 *list = (InspiralTemplateList *)
596 LALRealloc( *list, sizeof(InspiralTemplateList) * (*nlist + 1) );
597 if ( ! *list )
598 {
599 LALFree( tempPars );
600 ABORT( status, LALINSPIRALBANKH_EMEM, LALINSPIRALBANKH_MSGEMEM );
601 }
602 memset( *list + *nlist, 0, sizeof(InspiralTemplateList) );
603
604 (*list)[*nlist].ID = *nlist;
605 (*list)[*nlist].params = *tempPars;
606 (*list)[*nlist].metric = metric;
607 ++(*nlist);
608 }
609
610 bankPars.x0 += bankPars.dx0;
611 }
612 bankPars = bankParsOld;
613 bankPars.x1 += bankPars.dx1;
614
615 /* Find the t0 coordinate of the next template close to the t2/t3 axis */
616 LALInspiralNextTemplate( status->statusPtr, &bankPars, metric );
618
619 /* Hop along t0-axis until t0 is inside the region of interest or quit */
621 &validPars, bankPars, coarseIn );
623 while ( validPars == 0 && bankPars.x0 < bankPars.x0Max )
624 {
625 bankPars.x0 += bankPars.dx0;
627 &validPars, bankPars, coarseIn );
629 }
630 bankParsOld = bankPars;
631 }
632 LALFree( tempPars );
633
635 RETURN ( status );
636}
637/** @} */
void LALInspiralParameterCalc(LALStatus *status, InspiralTemplate *params)
#define LALRealloc(p, n)
#define LALCalloc(m, n)
#define LALFree(p)
#define ABORT(statusptr, code, mesg)
#define CHECKSTATUSPTR(statusptr)
#define ATTATCHSTATUSPTR(statusptr)
#define ASSERT(assertion, statusptr, code, mesg)
#define DETATCHSTATUSPTR(statusptr)
#define INITSTATUS(statusptr)
#define RETURN(statusptr)
double i
const double Q
#define LAL_PI_2
#define LAL_PI
#define LAL_MTSUN_SI
double REAL8
int32_t INT4
float REAL4
int LALWarning(LALStatus *status, const char *warning)
InputMasses
This structure is one of the members of the InspiralTemplate structure.
Definition: LALInspiral.h:178
@ totalMassAndEta
total mass and symmetric mass ratio
Definition: LALInspiral.h:180
void LALInspiralUpdateParams(LALStatus *status, InspiralBankParams *bankParams, InspiralMetric metric, REAL8 minimalMatch)
Function to update the parameters used in creating a coarse bank based on a square lattice.
void LALInspiralNextTemplate(LALStatus *status, InspiralBankParams *bankPars, InspiralMetric metric)
Routine to compute the parameters of the template next to the current template, but in the positive ...
#define LALINSPIRALBANKH_EGRIDSPACING
Inappropriate grid spacing parameter [SquareNotOriented or Hexagonal].
void LALInspiralCreateBCVBank(LALStatus *status, InspiralTemplateList **list, INT4 *nlist, InspiralCoarseBankIn coarseIn)
Lay a flat grid of BCV templates in the user specified range of the parameters in coarseIn structure...
#define LALINSPIRALBANKH_ECHOICE
Invalid choice for an input parameter.
#define LALINSPIRALBANKH_ENULL
Null pointer.
void LALInspiralSetParams(LALStatus *status, InspiralTemplate *tempPars, InspiralCoarseBankIn coarseIn)
A routine that fills an InspiralTemplate structure based on the values in the InspiralCoarseBankIn st...
void LALInspiralSetSearchLimits(LALStatus *status, InspiralBankParams *bankParams, InspiralCoarseBankIn coarseIn)
Function which calculates the minimum and maximum values of and .
void LALInspiralCreatePNCoarseBankHexa(LALStatus *status, InspiralTemplateList **list, INT4 *nlist, InspiralCoarseBankIn coarseIn)
void LALInspiralValidTemplate(LALStatus *status, INT4 *valid, InspiralBankParams bankParams, InspiralCoarseBankIn coarseIn)
Function which checks whether or not a given template should be kept in the template list.
void LALInspiralComputeParams(LALStatus *status, InspiralTemplate *pars, InspiralBankParams bankParams, InspiralCoarseBankIn coarseIn)
This function takes as input , and (the lower frequency of the detectors sensitivity),...
void LALInspiralCreatePNCoarseBankHybridHexa(LALStatus *status, InspiralTemplateList **list, INT4 *nlist, InspiralCoarseBankIn coarseIn)
void LALGetInspiralMoments(LALStatus *status, InspiralMomentsEtc *moments, REAL8FrequencySeries *psd, InspiralTemplate *params)
#define LALINSPIRALBANKH_ESIZE
Invalid input range.
#define LALINSPIRALBANKH_EMEM
Memory allocation failure.
void LALInspiralComputeMetric(LALStatus *status, InspiralMetric *metric, InspiralTemplate *params, InspiralMomentsEtc *moments)
@ MinMaxComponentTotalMass
@ MinComponentMassMaxTotalMass
@ SquareNotOriented
UNDOCUMENTED.
@ HybridHexagonal
UNDOCUMENTED.
@ Hexagonal
UNDOCUMENTED.
@ PTFFull
PTF metric in the full parameter space (intrinsic and extrinsic parameters).
@ Tau0Tau2
space of chirptimes
@ Psi0Psi3
for BCV templates
@ Tau0Tau3
space of chirptimes
@ PTFIntrinsic
a PTF metric in only the intrinsic parameters (a matrix)
void LALInspiralCreatePNCoarseBank(LALStatus *status, InspiralTemplateList **list, INT4 *nlist, InspiralCoarseBankIn coarseIn)
void LALNudgeTemplatesToConstantTotalMassLine(LALStatus *status, InspiralTemplateList **list, INT4 nlist, InspiralCoarseBankIn coarseIn)
Anand: 26 October 2006 This function nudges the templates in the list to the (max-total-mass = consta...
void LALInspiralCreateCoarseBank(LALStatus *status, InspiralTemplateList **list, INT4 *nlist, InspiralCoarseBankIn coarseIn)
EOB
PadeT1
TaylorEt
EOBNRv2
TaylorN
Eccentricity
EOBNR
PadeF1
IMRPhenomA
AmpCorPPN
TaylorF1
TaylorT3
FindChirpPTF
TaylorT4
TaylorF2
IMRPhenomB
BCV
TaylorT1
TaylorT2
M
This is a structure needed in the inner workings of the LALInspiralCreateCoarseBank code.
REAL8 x1Max
maximum value of the second coordinate as defined by the search region
REAL8 x1
the second coordinate, chosen to be either or
REAL8 dx0
increment in the x0-direction
REAL8 dx1
increment in the x1-direction
REAL8 x0Max
maximum value of the first coordinate as defined by the search region
REAL8 x0
the first coordinate, chosen to be always
Input for choosing a template bank.
REAL8 mMin
minimum mass of components to search for
REAL8 mMax
maximum mass of components to search for
InspiralBankMassRange massRange
enum that determines whether templates should be chosen using fixed ranges for component masses or to...
REAL8 tSampling
Sampling rate.
GridSpacing gridSpacing
Type of gridspacing required.
REAL8FrequencySeries shf
Frequency series containing the PSD.
REAL8 MMax
alternatively, maximum total mass of binary to search for
REAL8 fUpper
Upper frequency cutoff.
REAL8 fLower
Lower frequency cutoff.
Approximant approximant
Approximant of the waveform.
REAL8 mmCoarse
Coarse grid minimal match.
CoordinateSpace space
enum that decides whether to use or in constructing the template bank
Structure to store metric at various points the signal manifold.
CoordinateSpace space
The enum describing the coordinate space in which the metric is computed.
REAL8 theta
Angle from tau0 to semi-major axis of the ellipse.
Parameter structure that holds the moments of the PSD and other useful constants required in the comp...
The inspiral waveform parameter structure containing information about the waveform to be generated.
Definition: LALInspiral.h:205
INT4 ieta
parameter that tells whether the symmetric mass ratio should be set to zero in the PN expansions of ...
Definition: LALInspiral.h:226
REAL8 eta
symmetric mass ratio (input/output)
Definition: LALInspiral.h:291
REAL8 totalMass
total mass of the binary in solar mass (input/output)
Definition: LALInspiral.h:292
InputMasses massChoice
The pair of (mass) parameters given (see structure defining this member for more details) (input)
Definition: LALInspiral.h:323
REAL8 fLower
lower frequency cutoff of the detector in Hz (input)
Definition: LALInspiral.h:217
A grid of inspiral templates (ie a template list).
REAL8Sequence * data
REAL8 * data