Loading [MathJax]/extensions/TeX/AMSsymbols.js
LALInspiral 5.0.3.1-b246709
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
LALInspiralGetApproximantString.c
Go to the documentation of this file.
1/*
2* Copyright (C) 2008 Craig Robinson
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 * \author Craig Robinson
22 * \file
23 *
24 * \brief Function for creating the approximant string which gets written to output
25 * files for a given approximant and PN order of the phasing.
26 *
27 * ### Prototypes ###
28 *
29 * <tt>XLALXLALInspiralGetApproximantString()</tt>:
30 * <ul>
31 * <li> <tt>output,</tt> Output, Pointer to the string in which to place the output
32 * </li><li> <tt>length,</tt> Input, the length of the output string
33 * </li><li> <tt>approx,</tt> Input, enumeration of the waveform approximant
34 * </li><li> <tt>order,</tt> Input, post-Newtonian order of the phasing.</li>
35 * </ul>
36 *
37 * ### Description ###
38 *
39 *
40 * ### Algorithm ###
41 *
42 *
43 * ### Uses ###
44 *
45 * \code
46 * snprintf
47 * \endcode
48 *
49 * ### Notes ###
50 *
51 */
52
53#include <lal/LALStdlib.h>
54#include <lal/LALError.h>
55
56#include <lal/LALInspiral.h>
57
59 UINT4 length,
60 Approximant approx,
61 LALPNOrder order
62 )
63{
64 CHAR approxString[LIGOMETA_SEARCH_MAX];
65 CHAR orderString[LIGOMETA_SEARCH_MAX];
66
67 if (!output)
69
70 if (length < 1)
72
73 /* Set the approximant string */
74
75 switch ( approx )
76 {
77 case TaylorT1:
78 snprintf( approxString, LIGOMETA_SEARCH_MAX * sizeof(CHAR),
79 "TaylorT1" );
80 break;
81
82 case TaylorT2:
83 snprintf( approxString, LIGOMETA_SEARCH_MAX * sizeof(CHAR),
84 "TaylorT2" );
85 break;
86
87 case TaylorT3:
88 snprintf( approxString, LIGOMETA_SEARCH_MAX * sizeof(CHAR),
89 "TaylorT3" );
90 break;
91
92 case TaylorF1:
93 snprintf( approxString, LIGOMETA_SEARCH_MAX * sizeof(CHAR),
94 "TaylorF1" );
95 break;
96
97 case TaylorF2:
98 snprintf( approxString, LIGOMETA_SEARCH_MAX * sizeof(CHAR),
99 "TaylorF2" );
100 break;
101
102 case PadeT1:
103 snprintf( approxString, LIGOMETA_SEARCH_MAX * sizeof(CHAR),
104 "PadeT1" );
105 break;
106
107 case PadeF1:
108 snprintf( approxString, LIGOMETA_SEARCH_MAX * sizeof(CHAR),
109 "PadeF1" );
110 break;
111
112 case EOB:
113 snprintf( approxString, LIGOMETA_SEARCH_MAX * sizeof(CHAR),
114 "EOB" );
115 break;
116
117 case BCV:
118 snprintf( approxString, LIGOMETA_SEARCH_MAX * sizeof(CHAR),
119 "BCV" );
120 break;
121
122 case BCVSpin:
123 snprintf( approxString, LIGOMETA_SEARCH_MAX * sizeof(CHAR),
124 "BCVSpin" );
125 break;
126
127 case SpinTaylorT3:
128 snprintf( approxString, LIGOMETA_SEARCH_MAX * sizeof(CHAR),
129 "SpinTaylorT3" );
130 break;
131
133 snprintf( approxString, LIGOMETA_SEARCH_MAX * sizeof(CHAR),
134 "SpinTaylorFrameless" );
135 break;
136
137 case SpinTaylor:
138 snprintf( approxString, LIGOMETA_SEARCH_MAX * sizeof(CHAR),
139 "SpinTaylor" );
140 break;
141
142 case SpinQuadTaylor:
143 snprintf( approxString, LIGOMETA_SEARCH_MAX * sizeof(CHAR),
144 "SpinQuadTaylor" );
145 break;
146
147 case FindChirpSP:
148 snprintf( approxString, LIGOMETA_SEARCH_MAX * sizeof(CHAR),
149 "FindChirpSP" );
150 break;
151
152 case FindChirpPTF:
153 snprintf( approxString, LIGOMETA_SEARCH_MAX * sizeof(CHAR),
154 "FindChirpPTF" );
155 break;
156
157 case GeneratePPN:
158 snprintf( approxString, LIGOMETA_SEARCH_MAX * sizeof(CHAR),
159 "GeneratePPN" );
160 break;
161
162 case BCVC:
163 snprintf( approxString, LIGOMETA_SEARCH_MAX * sizeof(CHAR),
164 "BCVC" );
165 break;
166
167 case Eccentricity:
168 snprintf( approxString, LIGOMETA_SEARCH_MAX * sizeof(CHAR),
169 "Eccentricity" );
170 break;
171
172 case EOBNR:
173 snprintf( approxString, LIGOMETA_SEARCH_MAX * sizeof(CHAR),
174 "EOBNR" );
175 break;
176
177 case EOBNRv2:
178 snprintf( approxString, LIGOMETA_SEARCH_MAX * sizeof(CHAR),
179 "EOBNRv2" );
180 break;
181
182 case TaylorEt:
183 snprintf( approxString, LIGOMETA_SEARCH_MAX * sizeof(CHAR),
184 "TaylorEt" );
185 break;
186
187 case TaylorT4:
188 snprintf( approxString, LIGOMETA_SEARCH_MAX * sizeof(CHAR),
189 "TaylorT4" );
190 break;
191
192 case TaylorN:
193 snprintf( approxString, LIGOMETA_SEARCH_MAX * sizeof(CHAR),
194 "TaylorN" );
195 break;
196
197 case IMRPhenomB:
198 snprintf( approxString, LIGOMETA_SEARCH_MAX * sizeof(CHAR),
199 "IMRPhenomB" );
200 break;
201
202 case PhenSpinTaylorRD:
203 snprintf( approxString, LIGOMETA_SEARCH_MAX * sizeof(CHAR),
204 "PhenSpinTaylorRD" );
205 break;
206
207 default:
208 XLALPrintError("Unknown or unsupported approximant.\n");
210 break;
211 }
212
213
214 /* Now set the order */
215 switch ( order )
216 {
218 snprintf( orderString, LIGOMETA_SEARCH_MAX * sizeof(CHAR),
219 "newtonian" );
220 break;
221
222 case LAL_PNORDER_HALF:
223 snprintf( orderString, LIGOMETA_SEARCH_MAX * sizeof(CHAR),
224 "oneHalfPN" );
225 break;
226
227 case LAL_PNORDER_ONE:
228 snprintf( orderString, LIGOMETA_SEARCH_MAX * sizeof(CHAR),
229 "onePN" );
230 break;
231
233 snprintf( orderString, LIGOMETA_SEARCH_MAX * sizeof(CHAR),
234 "onePointFivePN" );
235 break;
236
237 case LAL_PNORDER_TWO:
238 snprintf( orderString, LIGOMETA_SEARCH_MAX * sizeof(CHAR),
239 "twoPN" );
240 break;
241
243 snprintf( orderString, LIGOMETA_SEARCH_MAX * sizeof(CHAR),
244 "twoPointFivePN" );
245 break;
246
248 snprintf( orderString, LIGOMETA_SEARCH_MAX * sizeof(CHAR),
249 "threePN" );
250 break;
251
253 snprintf( orderString, LIGOMETA_SEARCH_MAX * sizeof(CHAR),
254 "threePointFivePN" );
255 break;
256
258 snprintf( orderString, LIGOMETA_SEARCH_MAX * sizeof(CHAR),
259 "pseudoFourPN" );
260 break;
261
262 default:
263 XLALPrintError( "Unknown or unsupported order.\n" );
265 break;
266 }
267
268 /* Now build the output and return */
269 snprintf( output, length * sizeof(CHAR), "%s%s",
270 approxString, orderString );
271
272 return XLAL_SUCCESS;
273}
int XLALInspiralGetApproximantString(CHAR *output, UINT4 length, Approximant approx, LALPNOrder order)
#define LIGOMETA_SEARCH_MAX
char CHAR
uint32_t UINT4
Approximant
LALPNOrder
EOB
PadeT1
TaylorEt
GeneratePPN
BCVSpin
EOBNRv2
TaylorN
SpinQuadTaylor
FindChirpSP
Eccentricity
EOBNR
PadeF1
TaylorF1
TaylorT3
FindChirpPTF
TaylorT4
TaylorF2
IMRPhenomB
PhenSpinTaylorRD
SpinTaylorFrameless
BCV
TaylorT1
SpinTaylor
SpinTaylorT3
TaylorT2
BCVC
LAL_PNORDER_TWO_POINT_FIVE
LAL_PNORDER_THREE
LAL_PNORDER_TWO
LAL_PNORDER_ONE
LAL_PNORDER_PSEUDO_FOUR
LAL_PNORDER_THREE_POINT_FIVE
LAL_PNORDER_HALF
LAL_PNORDER_ONE_POINT_FIVE
LAL_PNORDER_NEWTONIAN
#define XLAL_ERROR(...)
int XLALPrintError(const char *fmt,...) _LAL_GCC_PRINTF_FORMAT_(1
XLAL_SUCCESS
XLAL_EFAULT
XLAL_EINVAL
char output[FILENAME_MAX]