Loading [MathJax]/extensions/TeX/AMSsymbols.js
LALApps 10.1.0.1-b246709
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
ninja.c
Go to the documentation of this file.
1/*
2 * Copyright (C) 2007 Badri Krishnan, Lucia Santamaria Lara, Robert Adam Mercer, Stephen Fairhurst
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/**
22 * \file ninja.c
23 * \ingroup lalapps_inspiral
24 * \author Badri Krishnan
25 * \brief Code for parsing and selecting numerical relativity
26 * waves in frame files
27 */
28
29
30#include "config.h"
31
32#include <math.h>
33#include <stdio.h>
34#include <stdlib.h>
35#include <string.h>
36
37#include <lal/LALConfig.h>
38#include <lal/LALStdio.h>
39#include <lal/LALStdlib.h>
40#include <lal/LALError.h>
41#include <lal/LALDatatypes.h>
42#include <lal/LIGOLwXML.h>
43#include <lal/LIGOLwXMLRead.h>
44#include <lal/LIGOMetadataInspiralUtils.h>
45#include <lal/LIGOMetadataTables.h>
46#include <lal/LIGOMetadataUtils.h>
47#include <lal/AVFactories.h>
48#include <lal/NRWaveIO.h>
49#include <lal/NRWaveInject.h>
50#include <lal/FileIO.h>
51#include <lal/Units.h>
52#include <lal/FrequencySeries.h>
53#include <lal/TimeSeries.h>
54#include <lal/TimeFreqFFT.h>
55#include <lal/VectorOps.h>
56#include <lal/LALDetectors.h>
57#include <lal/LALFrameIO.h>
58#include <lal/UserInput.h>
59#include <lalappsfrutils.h>
60#include <lal/LALFrStream.h>
61#include <lal/LogPrintf.h>
62
63#include <LALAppsVCSInfo.h>
64
65#include "inspiral.h"
66
67/* program info */
68#define PROGRAM_NAME "lalapps_ninja"
69
70/* verbose flag */
71extern int vrbflg;
72
73/*
74 * structure definitions
75 */
76
77typedef struct {
96
97typedef struct
98{
99 REAL8 massRatio; /**< Mass ratio m1/m2 where we assume m1 >= m2*/
100 REAL8 spin1[3]; /**< Spin of m1 */
101 REAL8 spin2[3]; /**< Spin of m2 */
102 INT4 mode[2]; /**< l and m values */
103 REAL8 freqStart22; /**< start frequency of 22 mode */
104 CHAR filename[LALNameLength]; /**< filename where data is stored */
107
108/*
109 * local helper function prototypes
110 */
111
112static int get_nr_metadata_from_framehistory(NinjaMetaData *data, FrHistory *history, CHAR *metadata_format);
113static int get_mode_index_from_channel_name(INT4 *mode_l, INT4 *mode_m, CHAR *name);
114static int get_minmax_modes(INT4 *min, INT4 *max, FrameH *frame);
115static int get_metadata_from_string(NinjaMetaData *data, CHAR *comment, CHAR *metadata_format);
116static int metadata_in_range(NinjaMetaData *data, NrParRange *range);
117static int parse_group_list ( NrParRange *range, CHAR *list);
118
119/* main program entry */
120int main(INT4 argc, CHAR *argv[])
121{
123
124 /* frame file stuff */
125 LALCache *frGlobCache = NULL;
126 LALCache *frInCache = NULL;
127 FrameH *frame = NULL;
128 FrFile *frFile = NULL;
129
130 /* inspiral table stuff */
131 SimInspiralTable *this_inj = NULL;
134 ProcessTable *proctable;
135
136 /* nrwave stuff */
137 NinjaMetaData metaData;
139
140 /* counter */
141 UINT4 k;
142
143 /* user input variables */
144 CHAR *uvar_nrDir = NULL;
145 CHAR *uvar_pattern = NULL;
146 CHAR *uvar_nrGroup = NULL;
147 CHAR *uvar_outFile = NULL;
148 CHAR *uvar_format = NULL;
149 REAL8 uvar_minMassRatio = 1, uvar_maxMassRatio = 0;
150 REAL8 uvar_minSx1 = -1, uvar_minSx2 = -1, uvar_maxSx1 = 1, uvar_maxSx2 = 1;
151 REAL8 uvar_minSy1 = -1, uvar_minSy2 = -1, uvar_maxSy1 = 1, uvar_maxSy2 = 1;
152 REAL8 uvar_minSz1 = -1, uvar_minSz2 = -1, uvar_maxSz1 = 1, uvar_maxSz2 = 1;
153 REAL8 uvar_freqLo = 40;
154 INT4 uvar_minMode = 2, uvar_maxMode = 2;
155
156 /* default debug level */
158
159 /* set default output file */
160 uvar_outFile = (CHAR *)LALCalloc(1, FILENAME_MAX * sizeof(CHAR));
161 strcpy(uvar_outFile, "ninja_out.xml");
162
163 /* set default metadata format */
164 uvar_format = (CHAR *)LALCalloc(1, 256 * sizeof(CHAR));
165 strcpy(uvar_format, "NINJA1");
166
167 XLAL_CHECK_MAIN(XLALRegisterNamedUvar(&uvar_nrDir, "datadir", STRING, 'D', REQUIRED, "Directory with NR data") == XLAL_SUCCESS, XLAL_EFUNC);
168 XLAL_CHECK_MAIN(XLALRegisterNamedUvar(&uvar_pattern, "pattern", STRING, 0, OPTIONAL, "Filename pattern") == XLAL_SUCCESS, XLAL_EFUNC);
169
170 XLAL_CHECK_MAIN(XLALRegisterNamedUvar(&uvar_outFile, "outfile", STRING, 'o', OPTIONAL, "Output xml filename") == XLAL_SUCCESS, XLAL_EFUNC);
171 XLAL_CHECK_MAIN(XLALRegisterNamedUvar(&uvar_format, "format", STRING, 0, OPTIONAL, "Metadata format") == XLAL_SUCCESS, XLAL_EFUNC);
172
173 XLAL_CHECK_MAIN(XLALRegisterNamedUvar(&uvar_minMassRatio, "min-mass-ratio", REAL8, 0, OPTIONAL, "Min. mass ratio") == XLAL_SUCCESS, XLAL_EFUNC);
174 XLAL_CHECK_MAIN(XLALRegisterNamedUvar(&uvar_maxMassRatio, "max-mass-ratio", REAL8, 0, OPTIONAL, "Max. mass ratio") == XLAL_SUCCESS, XLAL_EFUNC);
175
176 XLAL_CHECK_MAIN(XLALRegisterNamedUvar(&uvar_minSx1, "min-sx1", REAL8, 0, OPTIONAL, "Min. x-spin of first BH") == XLAL_SUCCESS, XLAL_EFUNC);
177 XLAL_CHECK_MAIN(XLALRegisterNamedUvar(&uvar_minSx2, "min-sx2", REAL8, 0, OPTIONAL, "Min. x-Spin of second BH") == XLAL_SUCCESS, XLAL_EFUNC);
178 XLAL_CHECK_MAIN(XLALRegisterNamedUvar(&uvar_maxSx1, "max-sx1", REAL8, 0, OPTIONAL, "Max. x-spin of first BH") == XLAL_SUCCESS, XLAL_EFUNC);
179 XLAL_CHECK_MAIN(XLALRegisterNamedUvar(&uvar_maxSx2, "max-sx2", REAL8, 0, OPTIONAL, "Max. x-spin of second BH") == XLAL_SUCCESS, XLAL_EFUNC);
180
181 XLAL_CHECK_MAIN(XLALRegisterNamedUvar(&uvar_minSy1, "min-sy1", REAL8, 0, OPTIONAL, "Min. y-spin of first BH") == XLAL_SUCCESS, XLAL_EFUNC);
182 XLAL_CHECK_MAIN(XLALRegisterNamedUvar(&uvar_minSy2, "min-sy2", REAL8, 0, OPTIONAL, "Min. y-Spin of second BH") == XLAL_SUCCESS, XLAL_EFUNC);
183 XLAL_CHECK_MAIN(XLALRegisterNamedUvar(&uvar_maxSy1, "max-sy1", REAL8, 0, OPTIONAL, "Max. y-spin of first BH") == XLAL_SUCCESS, XLAL_EFUNC);
184 XLAL_CHECK_MAIN(XLALRegisterNamedUvar(&uvar_maxSy2, "max-sy2", REAL8, 0, OPTIONAL, "Max. y-spin of second BH") == XLAL_SUCCESS, XLAL_EFUNC);
185
186 XLAL_CHECK_MAIN(XLALRegisterNamedUvar(&uvar_minSz1, "min-sz1", REAL8, 0, OPTIONAL, "Min. z-spin of first BH") == XLAL_SUCCESS, XLAL_EFUNC);
187 XLAL_CHECK_MAIN(XLALRegisterNamedUvar(&uvar_minSz2, "min-sz2", REAL8, 0, OPTIONAL, "Min. z-Spin of second BH") == XLAL_SUCCESS, XLAL_EFUNC);
188 XLAL_CHECK_MAIN(XLALRegisterNamedUvar(&uvar_maxSz1, "max-sz1", REAL8, 0, OPTIONAL, "Max. z-spin of first BH") == XLAL_SUCCESS, XLAL_EFUNC);
189 XLAL_CHECK_MAIN(XLALRegisterNamedUvar(&uvar_maxSz2, "max-sz2", REAL8, 0, OPTIONAL, "Max. z-spin of second BH") == XLAL_SUCCESS, XLAL_EFUNC);
190
191 XLAL_CHECK_MAIN(XLALRegisterNamedUvar(&uvar_freqLo, "freq-lo", REAL8, 0, OPTIONAL, "Lower cutoff frequency") == XLAL_SUCCESS, XLAL_EFUNC);
192 XLAL_CHECK_MAIN(XLALRegisterNamedUvar(&uvar_minMode, "min-mode", INT4, 0, OPTIONAL, "Min mode value to be injected") == XLAL_SUCCESS, XLAL_EFUNC);
193 XLAL_CHECK_MAIN(XLALRegisterNamedUvar(&uvar_maxMode, "max-mode", INT4, 0, OPTIONAL, "Max mode value to be injected") == XLAL_SUCCESS, XLAL_EFUNC);
194
195 XLAL_CHECK_MAIN(XLALRegisterNamedUvar(&uvar_nrGroup, "nr-group", STRING, 0, OPTIONAL, "NR group list (default=all)") == XLAL_SUCCESS, XLAL_EFUNC);
196
197 /* read all command line variables */
198 BOOLEAN should_exit = 0;
200 if (should_exit)
201 exit(1);
202
203 /* check for supported metadata format */
204 if (strcmp(uvar_format, "NINJA1") == 0);
205 else if (strcmp(uvar_format, "NINJA2") == 0);
206 else
207 {
208 fprintf(stderr, "Supported metadata formats are NINJA1 and NINJA2 (%s specified)\n", uvar_format);
209 exit(1);
210 }
211
212 range.massRatioMin = uvar_minMassRatio;
213 range.massRatioMax = uvar_maxMassRatio;
214
215 range.sx1Min = uvar_minSx1;
216 range.sx1Max = uvar_maxSx1;
217
218 range.sx2Min = uvar_minSx2;
219 range.sx2Max = uvar_maxSx2;
220
221 range.sy1Min = uvar_minSy1;
222 range.sy1Max = uvar_maxSy1;
223
224 range.sy2Min = uvar_minSy2;
225 range.sy2Max = uvar_maxSy2;
226
227 range.sz1Min = uvar_minSz1;
228 range.sz1Max = uvar_maxSz1;
229
230 range.sz2Min = uvar_minSz2;
231 range.sz2Max = uvar_maxSz2;
232
233 parse_group_list(&range, uvar_nrGroup);
234
235 LogPrintf(LOG_NORMAL, "Globbing frame files...");
236
237 /* create a frame cache by globbing *.gwf in specified dir */
238 frGlobCache = XLALCacheGlob(uvar_nrDir, uvar_pattern);
239
240 frInCache = XLALCacheDuplicate(frGlobCache);
241
242 XLALDestroyCache(frGlobCache);
243
244 /* check we globbed at least one frame file */
245 if (!frInCache->length)
246 {
247 fprintf(stderr, "error: no numrel frame files found\n");
248 exit(1);
249 }
250 LogPrintfVerbatim(LOG_NORMAL, "found %d\n",frInCache->length);
251
252 /* initialize head of simInspiralTable linked list to null */
253 injections = NULL;
254
255 LogPrintf(LOG_NORMAL, "Selecting frame files with right numrel parameters...");
256
257 /* loop over frame files and select the ones with nr-params in the right range */
258 for (k = 0; k < frInCache->length; k++)
259 {
260 /* convert url to path by skipping protocol part of protocol:path */
261 char *path;
262 path = strchr(frInCache->list[k].url, ':');
263 if (path == NULL)
264 path = frInCache->list[k].url;
265 else
266 path+=strlen("://localhost"); /* skip the ':' -- now on the path */
267
268 frFile = FrFileINew(path);
269
270 frame = FrameRead(frFile);
271
272 memset(&metaData, 0, sizeof(NinjaMetaData));
273 get_nr_metadata_from_framehistory(&metaData, frame->history, uvar_format);
274
275 /* if we find parameters in range then write to the siminspiral table */
276 if (metadata_in_range(&metaData, &range))
277 {
278 REAL8 tmp;
279 INT4 minMode, maxMode;
280
281 /* alloc next element of inspiral table linked list */
282 if (injections)
283 this_inj = this_inj->next = (SimInspiralTable *)LALCalloc(1, sizeof(SimInspiralTable));
284 else
285 injections = this_inj = (SimInspiralTable *)LALCalloc(1, sizeof(SimInspiralTable));
286
287 get_minmax_modes(&minMode,&maxMode,frame);
288
289 /* eta = 1/(sqrt(mu) + 1/sqrt(mu))^2 where mu = m1/m2 */
290 tmp = sqrt(metaData.massRatio) + (1.0 / sqrt(metaData.massRatio));
291 this_inj->eta = 1.0 / (tmp * tmp);
292
293 this_inj->spin1x = metaData.spin1[0];
294 this_inj->spin1y = metaData.spin1[1];
295 this_inj->spin1z = metaData.spin1[2];
296
297 this_inj->spin2x = metaData.spin2[0];
298 this_inj->spin2y = metaData.spin2[1];
299 this_inj->spin2z = metaData.spin2[2];
300 this_inj->f_lower = metaData.freqStart22;
301
302 strcpy(this_inj->numrel_data, frInCache->list[k].url);
303
304 this_inj->numrel_mode_min = uvar_minMode;
305 this_inj->numrel_mode_max = uvar_maxMode;
306
307 } /* end if (metadata is in range) */
308
309 FrFileIEnd(frFile);
310
311 } /* end loop over framefiles */
312 LogPrintfVerbatim(LOG_NORMAL, "done\n");
313
314 /* now write the output xml file */
315 LogPrintf(LOG_NORMAL, "Writing xml output...");
316
317 /* first the process table */
318 proctable = (ProcessTable *)LALCalloc(1, sizeof(ProcessTable));
319 XLALGPSTimeNow(&(proctable->start_time));
320
323 snprintf(proctable->comment, LIGOMETA_COMMENT_MAX, " ");
324
325 xmlfp = XLALOpenLIGOLwXMLFile( uvar_outFile );
326
327 XLALGPSTimeNow(&(proctable->end_time));
329
330 /* and finally the simInspiralTable itself */
332 if (injections)
334 LogPrintfVerbatim (LOG_NORMAL, "done\n");
335
336
337 /* we are now done with the xml writing stuff */
338 /* free memory and exit */
339
340 LogPrintf(LOG_NORMAL, "Free memory and exiting...");
341
342 /* close the various xml tables */
344 XLALDestroyProcessTable( proctable );
345
346 /* close cache */
347 /* LAL_CALL(LALFrClose(&status, &frStream), &status); */
348 XLALDestroyCache(frInCache);
349
350 /* close the injection file */
352
353 /* destroy all user input variables */
354 if (range.grouplist != NULL)
355 LALFree(range.grouplist);
357
360
361 return 0;
362} /* main */
363
364
365/* metadata is stored in the history field comment
366 -- this function parses the comment to fill the metadata struct */
368 FrHistory *history,
369 CHAR *metadata_format)
370{
371 UINT4 stringlen = 128;
372 CHAR *comment = NULL; /* the comments string */
373 FrHistory *localhist;
374
375 comment = LALMalloc(stringlen * sizeof(CHAR));
376
377 localhist = history;
378 while (localhist)
379 {
380 /* get history comment string and parse it */
381 /* The author-emails list can be > 128 chars */
382 if (strlen(localhist->comment) + 1 > stringlen)
383 {
384 stringlen = strlen(localhist->comment) + 1;
385 comment = LALRealloc(comment, stringlen * sizeof(CHAR));
386 }
387
388 strcpy(comment,localhist->comment);
389 get_metadata_from_string(data, comment, metadata_format);
390 localhist = localhist->next;
391 }
392
394 return 0;
395}
396
397
399 CHAR *comment,
400 CHAR *metadata_format)
401{
402 CHAR *token;
403 CHAR *thiscomment = NULL;
404
405 thiscomment = LALCalloc(1, (strlen(comment) + 1) * sizeof(CHAR));
406 strcpy(thiscomment, comment);
407
408 token = strtok(thiscomment, ":");
409
410 if (strstr(token, "spin1x"))
411 {
412 token = strtok(NULL, ":");
413 data->spin1[0] = atof(token);
414 LALFree(thiscomment);
415 return 0;
416 }
417
418 if (strstr(token, "spin1y"))
419 {
420 token = strtok(NULL, ":");
421 data->spin1[1] = atof(token);
422 LALFree(thiscomment);
423 return 0;
424 }
425
426 if (strstr(token, "spin1z"))
427 {
428 token = strtok(NULL, ":");
429 data->spin1[2] = atof(token);
430 LALFree(thiscomment);
431 return 0;
432 }
433
434 if (strstr(token, "spin2x"))
435 {
436 token = strtok(NULL, ":");
437 data->spin2[0] = atof(token);
438 LALFree(thiscomment);
439 return 0;
440 }
441
442 if (strstr(token, "spin2y"))
443 {
444 token = strtok(NULL, ":");
445 data->spin2[1] = atof(token);
446 LALFree(thiscomment);
447 return 0;
448 }
449
450 if (strstr(token, "spin2z"))
451 {
452 token = strtok(NULL, ":");
453 data->spin2[2] = atof(token);
454 LALFree(thiscomment);
455 return 0;
456 }
457
458 if (strstr(token, "mass-ratio"))
459 {
460 token = strtok(NULL, ":");
461 data->massRatio = atof(token);
462 LALFree(thiscomment);
463 return 0;
464 }
465
466 if (strcmp(metadata_format, "NINJA1") == 0)
467 {
468 if (strstr(token, "freqStart22"))
469 {
470 token = strtok(NULL, ":");
471 data->freqStart22 = atof(token);
472 LALFree(thiscomment);
473 return 0;
474 }
475 }
476 else if (strcmp(metadata_format, "NINJA2") == 0)
477 {
478 if (strstr(token, "freq_start_22"))
479 {
480 token = strtok(NULL, ":");
481 data->freqStart22 = atof(token);
482 LALFree(thiscomment);
483 return 0;
484 }
485 }
486 else
487 {
488 fprintf(stderr, "Supported metadata formats are NINJA1 and NINJA2 (%s specified)\n", metadata_format);
489 exit(1);
490 }
491
492 if (strstr(token, "nr-group"))
493 {
494 token = strtok(NULL, ":");
495 data->group = XLALParseNumRelGroupName(token);
496 LALFree(thiscomment);
497 return 0;
498 }
499
500 /* did not match anything */
501 LALFree(thiscomment);
502 return -1;
503
504}
505
506
508{
509
510 INT4 ret, k;
511 BOOLEAN flag = 0;
512 BOOLEAN groupflag = 0;
513
514 flag = (data->massRatio >= range->massRatioMin) && (data->massRatio <= range->massRatioMax);
515 flag = flag && (data->spin1[0] >= range->sx1Min) && (data->spin1[0] <= range->sx1Max);
516 flag = flag && (data->spin2[0] >= range->sx2Min) && (data->spin2[0] <= range->sx2Max);
517 flag = flag && (data->spin1[1] >= range->sy1Min) && (data->spin1[1] <= range->sy1Max);
518 flag = flag && (data->spin2[1] >= range->sy2Min) && (data->spin2[1] <= range->sy2Max);
519 flag = flag && (data->spin1[2] >= range->sz1Min) && (data->spin1[2] <= range->sz1Max);
520 flag = flag && (data->spin2[2] >= range->sz2Min) && (data->spin2[2] <= range->sz2Max);
521
522 for (k = 0; k < range->numGroups; k++)
523 {
524 if (range->grouplist[k] == data->group)
525 groupflag = 1;
526 }
527
528 /* if numgroups == 0 then user did not enter any groups and
529 so we must select all groups */
530 if (range->numGroups == 0)
531 groupflag = 1;
532
533 flag = flag && groupflag;
534
535 if (flag)
536 ret = 1;
537 else
538 ret = 0;
539
540 return(ret);
541
542}
543
544
546 INT4 *max,
547 FrameH *frame)
548{
549 int ret = 1;
550 INT4 mode_l = -1, mode_m, locmin, locmax;
551 FrSimData *sim;
552
553 locmin = 10;
554 locmax = 0;
555 sim = frame->simData;
556 while (sim)
557 {
558 if (!get_mode_index_from_channel_name(&mode_l, &mode_m, sim->name))
559 {
560 if (locmin > mode_l)
561 locmin = mode_l;
562 if (locmax < mode_l)
563 locmax = mode_l;
564 }
565 sim = sim->next;
566 }
567
568 *min = locmin;
569 *max = locmax;
570
571 return ret;
572}
573
574/* very hackish -- need to make this better */
576 INT4 *mode_m,
577 CHAR *name)
578{
579 int ret = 1;
580 CHAR *tmp;
581 INT4 sign = 0;
582
583 tmp = strstr(name, "hcross_");
584 if (tmp)
585 {
586 tmp += strlen("hcross_") + 1;
587 *mode_l = atoi(tmp);
588 tmp = strstr(tmp, "m");
589 tmp++;
590
591 if (!strncmp(tmp, "p", 1))
592 sign = 1;
593
594 if (!strncmp(tmp, "n", 1))
595 sign = -1;
596
597 tmp++;
598 *mode_m = sign * atoi(tmp);
599 ret = 0;
600 }
601
602 tmp = strstr(name, "hplus_");
603 if (tmp)
604 {
605 tmp += strlen("hplus_") + 1;
606 *mode_l = atoi(tmp);
607 tmp = strstr(tmp, "m");
608 tmp++;
609
610 if (!strncmp(tmp, "p", 1))
611 sign = 1;
612
613 if (!strncmp(tmp, "n", 1))
614 sign = -1;
615
616 tmp++;
617 *mode_m = sign * atoi(tmp);
618
619 ret = 0;
620 }
621
622 return ret;
623}
624
625/**
626 * take a list of numrel group names separated by ";" and parse it to
627 * get a vector of NumRelGroup
628 */
629static int parse_group_list(NrParRange *range,
630 CHAR *list)
631{
632 UINT4 numGroups = 0;
633 NumRelGroup thisGroup;
634 NumRelGroup *grouplist = NULL;
635 CHAR *token;
636 CHAR *thislist = NULL;
637
638 /* look for the ";" token */
639 if (list)
640 {
641 thislist = LALCalloc(1, (strlen(list) + 1) * sizeof(CHAR));
642 strcpy(thislist, list);
643
644 token = strtok(thislist, ";");
645
646 while (token)
647 {
648 thisGroup = XLALParseNumRelGroupName(token);
649
650 /* if the parsing was successful, add to list */
651 if (thisGroup != NINJA_GROUP_LAST)
652 {
653 numGroups++;
654 grouplist = LALRealloc(grouplist, numGroups * sizeof(*grouplist));
655 grouplist[numGroups - 1] = thisGroup;
656 }
657 token = strtok(NULL, ";");
658 }
659 LALFree(thislist);
660 } /* if(list) */
661
662 /* copy to output */
663 range->numGroups = numGroups;
664 range->grouplist = grouplist;
665
666 return numGroups;
667}
const LALVCSInfoList lalAppsVCSInfoList
NULL-terminated list of VCS and build information for LALApps and its dependencies
const LALVCSInfo lalAppsVCSIdentInfo
Identable VCS and build information for LALApps.
lal_errhandler_t lal_errhandler
int LAL_ERR_EXIT(LALStatus *stat, const char *func, const char *file, const int line, volatile const char *id)
int k
void LALCheckMemoryLeaks(void)
#define LALRealloc(p, n)
#define LALCalloc(m, n)
#define LALMalloc(n)
#define LALFree(p)
int XLALCloseLIGOLwXMLFile(LIGOLwXMLStream *xml)
LIGOLwXMLStream * XLALOpenLIGOLwXMLFile(const char *path)
int XLALWriteLIGOLwXMLProcessTable(LIGOLwXMLStream *, const ProcessTable *)
int XLALWriteLIGOLwXMLSimInspiralTable(LIGOLwXMLStream *, const SimInspiralTable *)
#define LIGOMETA_COMMENT_MAX
void XLALDestroySimInspiralTable(SimInspiralTable *head)
void XLALDestroyProcessTable(ProcessTable *)
int XLALPopulateProcessTable(ProcessTable *ptable, const char *program_name, const char *cvs_revision, const char *cvs_source, const char *cvs_date, long process_id)
long XLALSimInspiralAssignIDs(SimInspiralTable *head, long process_id, long simulation_id)
#define STRING(a)
#define fprintf
sigmaKerr data[0]
LIGOTimeGPS * XLALGPSTimeNow(LIGOTimeGPS *gpstime)
void XLALDestroyCache(LALCache *cache)
LALCache * XLALCacheGlob(const char *dirstr, const char *fnptrn)
LALCache * XLALCacheDuplicate(const LALCache *cache)
unsigned char BOOLEAN
double REAL8
#define XLAL_INIT_DECL(var,...)
char CHAR
uint32_t UINT4
int32_t INT4
LALNameLength
void void LogPrintfVerbatim(LogLevel_t, const char *format,...) _LAL_GCC_PRINTF_FORMAT_(2
void LogPrintf(LogLevel_t, const char *format,...) _LAL_GCC_PRINTF_FORMAT_(2
LOG_NORMAL
NumRelGroup
NumRelGroup XLALParseNumRelGroupName(CHAR *name)
NINJA_GROUP_LAST
int XLALUserVarReadAllInput(BOOLEAN *should_exit, int argc, char *argv[], const LALVCSInfoList vcs_list)
void XLALDestroyUserVars(void)
#define XLALRegisterNamedUvar(cvar, name, type, option, category,...)
#define XLAL_CHECK_MAIN(assertion,...)
XLAL_SUCCESS
XLAL_EFUNC
CHAR comment[LIGOMETA_COMMENT_MAX]
Definition: inspfrinj.c:350
SimInspiralTable * injections
Definition: inspfrinj.c:339
char name[LIGOMETA_SOURCE_MAX]
Definition: inspinj.c:561
static LALStatus status
Definition: inspinj.c:552
path
string mode
range
static int get_metadata_from_string(NinjaMetaData *data, CHAR *comment, CHAR *metadata_format)
Definition: ninja.c:398
static int get_mode_index_from_channel_name(INT4 *mode_l, INT4 *mode_m, CHAR *name)
Definition: ninja.c:575
static int get_nr_metadata_from_framehistory(NinjaMetaData *data, FrHistory *history, CHAR *metadata_format)
Definition: ninja.c:367
#define PROGRAM_NAME
Definition: ninja.c:68
static int get_minmax_modes(INT4 *min, INT4 *max, FrameH *frame)
Definition: ninja.c:545
int main(INT4 argc, CHAR *argv[])
Definition: ninja.c:120
int vrbflg
defined in lal/lib/std/LALError.c
static int parse_group_list(NrParRange *range, CHAR *list)
take a list of numrel group names separated by ";" and parse it to get a vector of NumRelGroup
Definition: ninja.c:629
static int metadata_in_range(NinjaMetaData *data, NrParRange *range)
Definition: ninja.c:507
LIGOLwXMLStream * xmlfp
Definition: spininj.c:210
CHAR * url
UINT4 length
LALCacheEntry * list
const char *const vcsDate
const char *const vcsStatus
const char *const vcsId
NumRelGroup group
Definition: ninja.c:105
REAL8 freqStart22
start frequency of 22 mode
Definition: ninja.c:103
REAL8 spin2[3]
Spin of m2.
Definition: ninja.c:101
REAL8 massRatio
Mass ratio m1/m2 where we assume m1 >= m2.
Definition: ninja.c:99
REAL8 spin1[3]
Spin of m1.
Definition: ninja.c:100
INT4 numGroups
Definition: ninja.c:93
REAL8 massRatioMax
Definition: ninja.c:79
REAL8 massRatioMin
Definition: ninja.c:78
REAL8 sx1Min
Definition: ninja.c:80
REAL8 sz1Min
Definition: ninja.c:88
REAL8 sy2Max
Definition: ninja.c:87
REAL8 sy2Min
Definition: ninja.c:86
NumRelGroup * grouplist
Definition: ninja.c:94
REAL8 sx2Min
Definition: ninja.c:82
REAL8 freqStart22min
Definition: ninja.c:92
REAL8 sx1Max
Definition: ninja.c:81
REAL8 sy1Min
Definition: ninja.c:84
REAL8 sy1Max
Definition: ninja.c:85
REAL8 sx2Max
Definition: ninja.c:83
REAL8 sz2Min
Definition: ninja.c:90
REAL8 sz1Max
Definition: ninja.c:89
REAL8 sz2Max
Definition: ninja.c:91
LIGOTimeGPS start_time
LIGOTimeGPS end_time
CHAR comment[LIGOMETA_COMMENT_MAX]
struct tagSimInspiralTable * next
CHAR numrel_data[LIGOMETA_STRING_MAX]