LALSimulation  5.4.0.1-fe68b98
LALSimInspiralWaveformFlags.c
Go to the documentation of this file.
1 /* Copyright (C) 2012 Evan Ochsner
2  *
3  * This program is free software; you can redistribute it and/or modify
4  * it under the terms of the GNU General Public License as published by
5  * the Free Software Foundation; either version 2 of the License, or
6  * (at your option) any later version.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with with program; see the file COPYING. If not, write to the
15  * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
16  * MA 02110-1301 USA
17  */
18 
19 #include <stdio.h>
20 #include <lal/LALString.h>
21 #include <lal/LALValue.h>
22 #include <lal/LALStdlib.h>
23 #include <limits.h>
24 #include <string.h>
25 #include <ctype.h>
26 #include <lal/LALSimInspiralWaveformFlags.h>
27 #include <lal/LALSimInspiralWaveformParams.h>
28 
29 /**
30  * Struct containing several enumerated flags that control specialized behavior
31  * for some waveform approximants.
32  *
33  * Users: Access this struct only through the Create/Destroy/Set/Get/IsDefault
34  * functions declared in this file.
35  *
36  * Developers: Do not add anything but enumerated flags to this struct. Avoid
37  * adding extra flags whenever possible.
38  * DEPRECATED, use LALDict instead.
39  */
41 {
42  LALSimInspiralSpinOrder spinO; /**< PN order of spin effects */
43  LALSimInspiralTidalOrder tideO; /**< PN order of spin effects */
44  LALSimInspiralFrameAxis axisChoice; /**< Flag to set frame z-axis convention */
45  LALSimInspiralModesChoice modesChoice; /**< Flag to control which modes are included in IMR models */
46  char numreldata[FILENAME_MAX]; /**< Location of NR data file for NR waveforms */
47 };
48 
49 /**
50  * @addtogroup LALSimInspiralWaveformFlags_c
51  * @brief Routines to manipulate inspiral waveform flags structures.
52  * @{
53  */
54 
55 /**
56  * Create a new LALSimInspiralWaveformFlags struct
57  * with all flags set to their default values.
58  *
59  * Remember to destroy the struct when you are done with it.
60  */
61 LALSimInspiralWaveformFlags *XLALSimInspiralCreateWaveformFlags(void)
62 {
63  LALSimInspiralWaveformFlags *waveFlags;
64  /* Allocate memory for the waveform flags */
65  waveFlags = XLALMalloc( sizeof(*waveFlags) );
66  if( !waveFlags )
67  {
68  XLALFree(waveFlags);
70  }
71 
72  /* Set all flags to their default values */
81 
82  return waveFlags;
83 }
84 
85 /**
86  * Destroy a LALSimInspiralWaveformFlags struct.
87  */
89  LALSimInspiralWaveformFlags *waveFlags
90  )
91 {
92  if( waveFlags )
93  XLALFree(waveFlags);
94  return;
95 }
96 
97 /**
98  * Returns true if waveFlags is non-NULL and all of its fields have default
99  * value; returns false otherwise.
100  */
102 {
103  /* Check every field of WaveformFlags, each returns 1/0 for true/false.
104  * Return true iff waveFlags is non-NULL and all checks are true. */
109 }
110 
111 /**
112  * Returns true if waveFlags is non-NULL and all of its fields have default
113  * value; returns false otherwise.
114  */
116  LALSimInspiralWaveformFlags *waveFlags
117  )
118 {
119  /* Check every field of WaveformFlags, each returns 1/0 for true/false.
120  * Return true iff waveFlags is non-NULL and all checks are true. */
121  return !waveFlags || (
122  XLALSimInspiralSpinOrderIsDefault(waveFlags->spinO) &&
123  XLALSimInspiralTidalOrderIsDefault(waveFlags->tideO) &&
124  XLALSimInspiralFrameAxisIsDefault(waveFlags->axisChoice) &&
125  XLALSimInspiralModesChoiceIsDefault(waveFlags->modesChoice));
126 }
127 
128 /**
129  * Checks if all flags in two LALSimInspiralWaveformFlags structs are equal.
130  * Returns true if all flags are equal. Returns false if one or more differ.
131  */
133  LALSimInspiralWaveformFlags *waveFlags1,
134  LALSimInspiralWaveformFlags *waveFlags2
135  )
136 {
137  LALSimInspiralSpinOrder spinO1, spinO2;
138  LALSimInspiralTidalOrder tideO1, tideO2;
139  LALSimInspiralFrameAxis axisChoice1, axisChoice2;
140  LALSimInspiralModesChoice modesChoice1, modesChoice2;
141 
142  spinO1 = XLALSimInspiralGetSpinOrder(waveFlags1);
143  spinO2 = XLALSimInspiralGetSpinOrder(waveFlags2);
144  tideO1 = XLALSimInspiralGetTidalOrder(waveFlags1);
145  tideO2 = XLALSimInspiralGetTidalOrder(waveFlags2);
146  axisChoice1 = XLALSimInspiralGetFrameAxis(waveFlags1);
147  axisChoice2 = XLALSimInspiralGetFrameAxis(waveFlags2);
148  modesChoice1 = XLALSimInspiralGetModesChoice(waveFlags1);
149  modesChoice2 = XLALSimInspiralGetModesChoice(waveFlags2);
150 
151  return ( (spinO1==spinO2) && (tideO1==tideO2) && (axisChoice1==axisChoice2)
152  && (modesChoice1==modesChoice2) );
153 }
154 
155 /**
156  * Checks if all flags in two LALSimInspiralWaveformFlags structs are equal.
157  * Returns true if all flags are equal. Returns false if one or more differ.
158  */
160  LALDict *LALpars1,
161  LALDict *LALpars2
162  )
163 {
164  LALSimInspiralSpinOrder spinO1, spinO2;
165  LALSimInspiralTidalOrder tideO1, tideO2;
166  LALSimInspiralFrameAxis axisChoice1, axisChoice2;
167  LALSimInspiralModesChoice modesChoice1, modesChoice2;
168 
173  axisChoice1 = XLALSimInspiralWaveformParamsLookupFrameAxis(LALpars1);
174  axisChoice2 = XLALSimInspiralWaveformParamsLookupFrameAxis(LALpars2);
175  modesChoice1 = XLALSimInspiralWaveformParamsLookupModesChoice(LALpars1);
176  modesChoice2 = XLALSimInspiralWaveformParamsLookupModesChoice(LALpars2);
177 
178  return ( (spinO1==spinO2) && (tideO1==tideO2) && (axisChoice1==axisChoice2)
179  && (modesChoice1==modesChoice2) );
180 }
181 
182 /**
183  * Set the LALSimInspiralSpinOrder within a LALSimInspiralWaveformFlags struct
184  */
186  LALSimInspiralWaveformFlags *waveFlags, /**< Struct whose flag will be set */
187 
188  LALSimInspiralSpinOrder spinO /**< value to set flag to */
189  )
190 {
191  waveFlags->spinO = spinO;
192  return;
193 }
194 
195 /**
196  * Get the LALSimInspiralSpinOrder within a LALSimInspiralWaveformFlags struct,
197  * or LAL_SIM_INSPIRAL_SPIN_ORDER_DEFAULT if waveFlags is NULL
198  */
200  LALSimInspiralWaveformFlags *waveFlags
201  )
202 {
203  if ( waveFlags )
204  return waveFlags->spinO;
205  else
207 }
208 
209 /**
210  * Returns true if LALSimInspiralSpinOrder has default value
211  * returns false otherwise
212  */
215  )
216 {
218  return true;
219  else
220  return false;
221 }
222 
223 /**
224  * Set the LALSimInspiralTidalOrder within a LALSimInspiralWaveformFlags struct
225  */
227  LALSimInspiralWaveformFlags *waveFlags, /**< Struct whose flag will be set */
228 
229  LALSimInspiralTidalOrder tideO /**< value to set flag to */
230  )
231 {
232  waveFlags->tideO = tideO;
233  return;
234 }
235 
236 /**
237  * Get the LALSimInspiralTidalOrder within a LALSimInspiralWaveformFlags struct,
238  * or LAL_SIM_INSPIRAL_TIDAL_ORDER_DEFAULT if waveFlags is NULL
239  */
241  LALSimInspiralWaveformFlags *waveFlags
242  )
243 {
244  if ( waveFlags )
245  return waveFlags->tideO;
246  else
248 }
249 
250 /**
251  * Returns true if LALSimInspiralTidalOrder has default value
252  * returns false otherwise
253  */
256  )
257 {
259  return true;
260  else
261  return false;
262 }
263 
264 /**
265  * Set the LALSimInspiralFrameAxis within a LALSimInspiralWaveformFlags struct
266  */
268  LALSimInspiralWaveformFlags *waveFlags, /**< Struct whose flag will be set */
269  LALSimInspiralFrameAxis axisChoice /**< value to set flag to */
270  )
271 {
272  waveFlags->axisChoice = axisChoice;
273  return;
274 }
275 
276 /**
277  * Get the LALSimInspiralFrameAxis within a LALSimInspiralWaveformFlags struct,
278  * or LAL_SIM_INSPIRAL_FRAME_AXIS_DEFAULT if waveFlags is NULL
279  */
281  LALSimInspiralWaveformFlags *waveFlags
282  )
283 {
284  if ( waveFlags )
285  return waveFlags->axisChoice;
286  else
288 }
289 
290 /**
291  * Returns true if LALSimInspiralFrameAxis has default value
292  * returns false otherwise
293  */
295  LALSimInspiralFrameAxis axisChoice
296  )
297 {
298  if( axisChoice == LAL_SIM_INSPIRAL_FRAME_AXIS_DEFAULT )
299  return true;
300  else
301  return false;
302 }
303 
304 /**
305  * Set the LALSimInspiralModesChoice within a LALSimInspiralWaveformFlags struct
306  */
308  LALSimInspiralWaveformFlags *waveFlags, /**< Struct whose flag will be set */
309  LALSimInspiralModesChoice modesChoice /**< value to set flag to */
310  )
311 {
312  waveFlags->modesChoice = modesChoice;
313  return;
314 }
315 
316 /**
317  * Get the LALSimInspiralModesChoice within a LALSimInspiralWaveformFlags struct,
318  * or LAL_SIM_INSPIRAL_MODES_CHOICE_DEFAULT if waveFlags is NULL
319  */
321  LALSimInspiralWaveformFlags *waveFlags
322  )
323 {
324  if ( waveFlags )
325  return waveFlags->modesChoice;
326  else
328 }
329 
330 /**
331  * Returns true if LALSimInspiralModesChoice has default value
332  * returns false otherwise
333  */
335  LALSimInspiralModesChoice modesChoice
336  )
337 {
338  if( modesChoice == LAL_SIM_INSPIRAL_MODES_CHOICE_DEFAULT )
339  return true;
340  else
341  return false;
342 }
343 
344 /**
345  * Set the numreldata string within a LALSimInspiralWaveformFlags struct
346  */
348  LALSimInspiralWaveformFlags *waveFlags, /**< Struct whose value will be set */
349  const char* numreldata /**< value to set numreldata to */
350  )
351 {
352  XLALStringCopy(waveFlags->numreldata, numreldata, sizeof(waveFlags->numreldata));
353  return;
354 }
355 
356 /**
357  * Returns a deepcopy of the pointer of the numeraldata attribute of the
358  * waveFlags structure. If this is NULL then NULL will be returned.
359  * The returned value is independent of the waveFlags structure and will
360  * need to be LALFree-d.
361  */
363  LALSimInspiralWaveformFlags *waveFlags
364  )
365 {
366  char *ret_string;
367  if ( waveFlags )
368  {
369  ret_string = XLALMalloc(FILENAME_MAX * sizeof(char));
370  XLALStringCopy(ret_string, waveFlags->numreldata, sizeof(waveFlags->numreldata));
371  return ret_string;
372  }
373  else
374  {
375  return NULL;
376  }
377 }
378 
379 
380 static char empty_modes[((LAL_SIM_L_MAX_MODE_ARRAY + 1) * (LAL_SIM_L_MAX_MODE_ARRAY + 1)) / CHAR_BIT + 2] = { '\0' };
381 
382 /**
383  * Create a LALValue pointer to store the mode array.
384  */
385 
387 {
389 }
390 
391 LALValue * XLALSimInspiralModeArrayActivateMode(LALValue *modes, unsigned l, int m)
392 {
393  char *data;
394  unsigned bit = l * l + l + m;
395  unsigned byte = bit / CHAR_BIT;
396  bit %= CHAR_BIT;
397 
398  /* sanity checks on l and m */
399  XLAL_CHECK_NULL(l <= LAL_SIM_L_MAX_MODE_ARRAY, XLAL_EINVAL, "Invalid value of l=%u must not be greater than %u", l, LAL_SIM_L_MAX_MODE_ARRAY);
400  XLAL_CHECK_NULL((unsigned)abs(m) <= l, XLAL_EINVAL, "Invalid value of m=%d for l=%u", m, l);
401 
402  /* sanity checks on modes */
403  data = (char *)(intptr_t)XLALValueGetString(modes);
405  XLAL_CHECK_NULL(XLALValueGetSize(modes) == sizeof(empty_modes), XLAL_EINVAL, "Invalid data size for modes");
406 
407  data[byte] |= (1 << bit);
408  return modes;
409 }
410 
411 LALValue * XLALSimInspiralModeArrayDeactivateMode(LALValue *modes, unsigned l, int m)
412 {
413  char *data;
414  unsigned bit = l * l + l + m;
415  unsigned byte = bit / CHAR_BIT;
416  bit %= CHAR_BIT;
417 
418  /* sanity checks on l and m */
419  XLAL_CHECK_NULL(l <= LAL_SIM_L_MAX_MODE_ARRAY, XLAL_EINVAL, "Invalid value of l=%u must not be greater than %u", l, LAL_SIM_L_MAX_MODE_ARRAY);
420  XLAL_CHECK_NULL((unsigned)abs(m) <= l, XLAL_EINVAL, "Invalid value of m=%d for l=%u", m, l);
421 
422  /* sanity checks on modes */
423  data = (char *)(intptr_t)XLALValueGetString(modes);
425  XLAL_CHECK_NULL(XLALValueGetSize(modes) == sizeof(empty_modes), XLAL_EINVAL, "Invalid data size for modes");
426 
427  data[byte] &= ~(1 << bit);
428  return modes;
429 }
430 
431 LALValue * XLALSimInspiralModeArrayActivateAllModes(LALValue *modes)
432 {
433  char *data;
434  data = (char *)(intptr_t)XLALValueGetString(modes);
436  XLAL_CHECK_NULL(XLALValueGetSize(modes) == sizeof(empty_modes), XLAL_EINVAL, "Invalid data size for modes");
437  memset(data, ~0, sizeof(empty_modes) - 1);
438 
439  /* Deactivate the unphysical modes: (l,m) = ((0,0), (1,-1), (1,0), (1,1)) */
444 
445  return modes;
446 }
447 
449 {
450  char *data;
451  data = (char *)(intptr_t)XLALValueGetString(modes);
453  XLAL_CHECK_NULL(XLALValueGetSize(modes) == sizeof(empty_modes), XLAL_EINVAL, "Invalid data size for modes");
454  memset(data, 0, sizeof(empty_modes) - 1);
455  return modes;
456 }
457 
458 int XLALSimInspiralModeArrayIsModeActive(LALValue *modes, unsigned l, int m)
459 {
460  const char *data;
461  unsigned bit = l * l + l + m;
462  unsigned byte = bit / CHAR_BIT;
463  // unsigned bit;
464  // unsigned byte;
465  // positionOfModeInString(&bit, &byte, l, m);
466  bit %= CHAR_BIT;
467 
468  /* sanity checks on l and m */
469  XLAL_CHECK(l <= LAL_SIM_L_MAX_MODE_ARRAY, XLAL_EINVAL, "Invalid value of l=%u must not be greater than %u", l, LAL_SIM_L_MAX_MODE_ARRAY);
470  XLAL_CHECK((unsigned)abs(m) <= l, XLAL_EINVAL, "Invalid value of m=%d for l=%u", m, l);
471 
472  /* sanity checks on modes */
473  data = XLALValueGetString(modes);
475  XLAL_CHECK(XLALValueGetSize(modes) == sizeof(empty_modes), XLAL_EINVAL, "Invalid data size for modes");
476 
477  return (data[byte] & (1 << bit)) != 0;
478 }
479 
480 
481 LALValue * XLALSimInspiralModeArrayActivateAllModesAtL(LALValue *modes, unsigned l)
482 {
483  for(int m =-l; m <= (int) l; ++m)
484  {
486  }
487  return modes;
488 }
489 
490 LALValue * XLALSimInspiralModeArrayDeactivateAllModesAtL(LALValue *modes, unsigned l)
491 {
492  for(int m =-l; m <= (int) l; ++m)
493  {
495  }
496  return modes;
497 }
498 
500 {
501  int l;
502  for (l = 0; l <= LAL_SIM_L_MAX_MODE_ARRAY; ++l) {
503  int m;
504  for (m = -l; m <= l; ++m)
505  printf("(%u,%+d) : %d\n", l, m, XLALSimInspiralModeArrayIsModeActive(modes, l, m));
506  printf("\n");
507  }
508  return 0;
509 }
510 
512 {
514  int nmodes = 0;
515  for (int l = 0; l <= LAL_SIM_L_MAX_MODE_ARRAY; l++) {
516  for (int m = -l; m <= l; m++)
518  {
519  seqmodes->data[2*nmodes] = l;
520  seqmodes->data[2*nmodes+1] = m;
521  nmodes++;
522  }
523  }
524  seqmodes = XLALShrinkINT2Sequence(seqmodes, 0, 2*nmodes);
525  return seqmodes;
526 }
527 
529 {
530  char *s = NULL;
531  int n = 0;
532  if ((s = XLALStringAppend(s, "[")) == NULL)
534  for (int l = 0; l <= LAL_SIM_L_MAX_MODE_ARRAY; ++l)
535  for (int m = -l; m <= l; ++m)
537  if ((s = XLALStringAppendFmt(s, "%s(%u,%+d)", n++ ? "," : "", l, m)) == NULL)
539  if ((s = XLALStringAppend(s, "]")) == NULL)
541  return s;
542 }
543 
544 LALValue * XLALSimInspiralModeArrayFromModeString(const char *modestr)
545 {
546  LALValue *modes = NULL;
547  const char *s = modestr;
548  int inlist = 0;
549  int intup = 0;
550  int done = 0;
551  unsigned l = UINT_MAX; // invalid value
552  int m = INT_MAX; // invalid value
553  char c;
554 
555  XLAL_CHECK_NULL(modestr, XLAL_EFAULT);
556 
559 
560  while ((c = *s++)) {
561  char *endp;
562 
563  if (isspace(c))
564  continue;
565 
566  XLAL_CHECK_FAIL(!done, XLAL_EINVAL, "Malformed mode string \"%s\": trailing characters found", modestr);
567 
568  switch (c) {
569 
570  case '[':
571  XLAL_CHECK_FAIL(!inlist, XLAL_EINVAL, "Malformed mode string \"%s\": cannot have a list inside a list", modestr);
572  inlist = 1;
573  break;
574 
575  case ']':
576  XLAL_CHECK_FAIL(inlist, XLAL_EINVAL, "Malformed mode string \"%s\": end of list when not in list", modestr);
577  inlist = 0;
578  done = 1;
579  break;
580 
581  case '(':
582  XLAL_CHECK_FAIL(inlist, XLAL_EINVAL, "Malformed mode string \"%s\": tuple found outside of list", modestr);
583  XLAL_CHECK_FAIL(!intup, XLAL_EINVAL, "Malformed mode string \"%s\": tuple found within tuple", modestr);
584  intup = 1;
585  l = strtoul(s, &endp, 0);
586  XLAL_CHECK_FAIL(s != endp, XLAL_EINVAL, "Malformed mode string \"%s\": could not convert unsigned integer", modestr);
587  s = endp;
588  break;
589 
590  case ')':
591  XLAL_CHECK_FAIL(intup, XLAL_EINVAL, "Malformed mode string \"%s\": end of tuple when not in tuple", modestr);
592  XLAL_CHECK_FAIL(inlist, XLAL_EINVAL, "Malformed mode string \"%s\": tuple found outside of list", modestr);
593  intup = 0;
594  break;
595 
596  case ',':
597  XLAL_CHECK_FAIL(inlist, XLAL_EINVAL, "Malformed mode string \"%s\": separater found when not in list", modestr);
598  if (intup) {
599  m = strtol(s, &endp, 0);
600  XLAL_CHECK_FAIL(s != endp, XLAL_EINVAL, "Malformed mode string \"%s\": could not convert signed integer", modestr);
602  s = endp;
603  }
604  break;
605 
606  default:
607  XLAL_ERROR_FAIL(XLAL_EINVAL, "Invalid character '%c' in mode string \"%s\"", c, modestr);
608  }
609  }
610 
611  if (done)
612  return modes;
613 
614 XLAL_FAIL:
615  XLALDestroyValue(modes);
616  return NULL;
617 }
618 
619 /** @} */
#define c
int XLALSimInspiralWaveformParamsPNTidalOrderIsDefault(LALDict *params)
INT4 XLALSimInspiralWaveformParamsLookupFrameAxis(LALDict *params)
INT4 XLALSimInspiralWaveformParamsLookupModesChoice(LALDict *params)
int XLALSimInspiralWaveformParamsModesChoiceIsDefault(LALDict *params)
INT4 XLALSimInspiralWaveformParamsLookupPNTidalOrder(LALDict *params)
INT4 XLALSimInspiralWaveformParamsLookupPNSpinOrder(LALDict *params)
int XLALSimInspiralWaveformParamsPNSpinOrderIsDefault(LALDict *params)
int XLALSimInspiralWaveformParamsFrameAxisIsDefault(LALDict *params)
void XLALDestroyValue(LALValue *value)
LALValue * XLALCreateValue(const void *data, size_t size, LALTYPECODE type)
size_t XLALValueGetSize(const LALValue *value)
const char * XLALValueGetString(const LALValue *value)
int s
Definition: bh_qnmode.c:137
int l
Definition: bh_qnmode.c:135
sigmaKerr data[0]
LAL_CHAR_TYPE_CODE
void * XLALMalloc(size_t n)
void XLALFree(void *p)
LALSimInspiralModesChoice
Enumerator for choosing which modes to include in IMR models.
#define LAL_SIM_INSPIRAL_FRAME_AXIS_DEFAULT
#define LAL_SIM_INSPIRAL_TIDAL_ORDER_DEFAULT
#define LAL_SIM_L_MAX_MODE_ARRAY
Maximum L spherical harmonic mode that is supported in Mode Array.
LALSimInspiralSpinOrder
Enumeration of allowed PN orders of spin effects.
LALSimInspiralFrameAxis
Enumerator for choosing the reference frame associated with PSpinInspiralRD waveforms.
LALSimInspiralTidalOrder
Enumeration of allowed PN orders of tidal effects.
#define LAL_SIM_INSPIRAL_SPIN_ORDER_DEFAULT
Default values for all enumerated flags.
@ LAL_SIM_INSPIRAL_MODES_CHOICE_DEFAULT
Include only (2,2) or l=2 modes.
char * XLALSimInspiralModeArrayToModeString(LALValue *modes)
void XLALSimInspiralSetFrameAxis(LALSimInspiralWaveformFlags *waveFlags, LALSimInspiralFrameAxis axisChoice)
Set the LALSimInspiralFrameAxis within a LALSimInspiralWaveformFlags struct.
bool XLALSimInspiralWaveformParamsFlagsAreDefault(LALDict *params)
Returns true if waveFlags is non-NULL and all of its fields have default value; returns false otherwi...
LALValue * XLALSimInspiralModeArrayDeactivateMode(LALValue *modes, unsigned l, int m)
LALValue * XLALSimInspiralCreateModeArray(void)
Create a LALValue pointer to store the mode array.
LALSimInspiralSpinOrder XLALSimInspiralGetSpinOrder(LALSimInspiralWaveformFlags *waveFlags)
Get the LALSimInspiralSpinOrder within a LALSimInspiralWaveformFlags struct, or LAL_SIM_INSPIRAL_SPIN...
LALSimInspiralWaveformFlags * XLALSimInspiralCreateWaveformFlags(void)
Create a new LALSimInspiralWaveformFlags struct with all flags set to their default values.
LALValue * XLALSimInspiralModeArrayFromModeString(const char *modestr)
LALValue * XLALSimInspiralModeArrayActivateAllModes(LALValue *modes)
LALSimInspiralModesChoice XLALSimInspiralGetModesChoice(LALSimInspiralWaveformFlags *waveFlags)
Get the LALSimInspiralModesChoice within a LALSimInspiralWaveformFlags struct, or LAL_SIM_INSPIRAL_MO...
int XLALSimInspiralModeArrayIsModeActive(LALValue *modes, unsigned l, int m)
bool XLALSimInspiralFrameAxisIsDefault(LALSimInspiralFrameAxis axisChoice)
Returns true if LALSimInspiralFrameAxis has default value returns false otherwise.
LALSimInspiralFrameAxis XLALSimInspiralGetFrameAxis(LALSimInspiralWaveformFlags *waveFlags)
Get the LALSimInspiralFrameAxis within a LALSimInspiralWaveformFlags struct, or LAL_SIM_INSPIRAL_FRAM...
bool XLALSimInspiralModesChoiceIsDefault(LALSimInspiralModesChoice modesChoice)
Returns true if LALSimInspiralModesChoice has default value returns false otherwise.
LALValue * XLALSimInspiralModeArrayDeactivateAllModes(LALValue *modes)
LALValue * XLALSimInspiralModeArrayActivateMode(LALValue *modes, unsigned l, int m)
LALSimInspiralTidalOrder XLALSimInspiralGetTidalOrder(LALSimInspiralWaveformFlags *waveFlags)
Get the LALSimInspiralTidalOrder within a LALSimInspiralWaveformFlags struct, or LAL_SIM_INSPIRAL_TID...
void XLALSimInspiralSetSpinOrder(LALSimInspiralWaveformFlags *waveFlags, LALSimInspiralSpinOrder spinO)
Set the LALSimInspiralSpinOrder within a LALSimInspiralWaveformFlags struct.
int XLALSimInspiralModeArrayPrintModes(LALValue *modes)
bool XLALSimInspiralWaveformFlagsEqual(LALDict *LALpars1, LALDict *LALpars2)
Checks if all flags in two LALSimInspiralWaveformFlags structs are equal.
bool XLALSimInspiralTidalOrderIsDefault(LALSimInspiralTidalOrder tideO)
Returns true if LALSimInspiralTidalOrder has default value returns false otherwise.
bool XLALSimInspiralSpinOrderIsDefault(LALSimInspiralSpinOrder spinO)
Returns true if LALSimInspiralSpinOrder has default value returns false otherwise.
LALValue * XLALSimInspiralModeArrayActivateAllModesAtL(LALValue *modes, unsigned l)
bool XLALSimInspiralWaveformFlagsEqualOLD(LALSimInspiralWaveformFlags *waveFlags1, LALSimInspiralWaveformFlags *waveFlags2)
Checks if all flags in two LALSimInspiralWaveformFlags structs are equal.
void XLALSimInspiralDestroyWaveformFlags(LALSimInspiralWaveformFlags *waveFlags)
Destroy a LALSimInspiralWaveformFlags struct.
void XLALSimInspiralSetNumrelDataOLD(LALSimInspiralWaveformFlags *waveFlags, const char *numreldata)
Set the numreldata string within a LALSimInspiralWaveformFlags struct.
static char empty_modes[((LAL_SIM_L_MAX_MODE_ARRAY+1) *(LAL_SIM_L_MAX_MODE_ARRAY+1))/CHAR_BIT+2]
INT2Sequence * XLALSimInspiralModeArrayReadModes(LALValue *modes)
void XLALSimInspiralSetTidalOrder(LALSimInspiralWaveformFlags *waveFlags, LALSimInspiralTidalOrder tideO)
Set the LALSimInspiralTidalOrder within a LALSimInspiralWaveformFlags struct.
bool XLALSimInspiralWaveformFlagsIsDefaultOLD(LALSimInspiralWaveformFlags *waveFlags)
Returns true if waveFlags is non-NULL and all of its fields have default value; returns false otherwi...
LALValue * XLALSimInspiralModeArrayDeactivateAllModesAtL(LALValue *modes, unsigned l)
char * XLALSimInspiralGetNumrelDataOLD(LALSimInspiralWaveformFlags *waveFlags)
Returns a deepcopy of the pointer of the numeraldata attribute of the waveFlags structure.
void XLALSimInspiralSetModesChoice(LALSimInspiralWaveformFlags *waveFlags, LALSimInspiralModesChoice modesChoice)
Set the LALSimInspiralModesChoice within a LALSimInspiralWaveformFlags struct.
size_t XLALStringCopy(char *dst, const char *src, size_t size)
int char * XLALStringAppend(char *s, const char *append)
char * XLALStringAppendFmt(char *s, const char *fmt,...) _LAL_GCC_PRINTF_FORMAT_(2
static const INT4 m
INT2Sequence * XLALShrinkINT2Sequence(INT2Sequence *sequence, size_t first, size_t length)
INT2Sequence * XLALCreateINT2Sequence(size_t length)
#define XLAL_ERROR_NULL(...)
#define XLAL_CHECK(assertion,...)
#define XLAL_CHECK_FAIL(assertion,...)
#define XLAL_CHECK_NULL(assertion,...)
#define XLAL_ERROR_FAIL(...)
XLAL_ENOMEM
XLAL_EFAULT
XLAL_EFUNC
XLAL_EINVAL
INT2 * data
Definition: burst.c:245
Struct containing several enumerated flags that control specialized behavior for some waveform approx...
LALSimInspiralTidalOrder tideO
PN order of spin effects.
LALSimInspiralModesChoice modesChoice
Flag to control which modes are included in IMR models.
LALSimInspiralFrameAxis axisChoice
Flag to set frame z-axis convention.
LALSimInspiralSpinOrder spinO
PN order of spin effects.
char numreldata[FILENAME_MAX]
Location of NR data file for NR waveforms.