124 #include <lal/LALStdlib.h>
125 #include <lal/LALgetopt.h>
126 #include <lal/LALConstants.h>
127 #include <lal/LALSimBlackHoleRingdown.h>
129 #define a_invalid -100.0
130 #define l_invalid (INT_MIN + 1)
131 #define m_invalid (INT_MAX)
132 #define s_invalid (INT_MAX)
148 double avec[] = {0.0,0.1,0.2,0.3,0.4,0.45,0.49,0.4999};
153 fprintf(stdout,
"# quasinormal mode table for l=%d m=%d s=%d ",
l,
m,
s);
155 fprintf(stdout,
"(Leaver's conventions)\n");
157 fprintf(stdout,
"(standard conventions)\n");
161 fprintf(stdout,
"# a \t frequency (Hz) \t quality \n");
164 for (asign = 1; abs(asign) == 1; asign -= 2) {
165 for (
i = 0;
i < numa; ++
i) {
175 fprintf(stdout,
"%.4f \t(%.5f,%+.5f)\t(%+.6f,%.6f)\n",
a, creal(A), cimag(A), creal(omega), cimag(omega));
179 Q = fabs(creal(omega)) / (-2.0 * cimag(omega));
180 fprintf(stdout,
"%.4f \t %12.3f \t\t %8.3f\n",
a, f,
Q);
208 fprintf(stdout,
"using %s conventions\n",
leaver ?
"Leaver's" :
"standard");
209 fprintf(stdout,
"mode l = %d, m = %d, s = %d\n",
l,
m,
s);
210 fprintf(stdout,
"spin a = %g (dimensionless)\n",
a);
211 fprintf(stdout,
"M * omega = (%+.6f,%+.6f)\n", creal(omega), cimag(omega));
215 Q = fabs(creal(omega)) / (-2.0 * cimag(omega));
217 fprintf(stdout,
"mass M = %g solar masses\n",
M);
218 fprintf(stdout,
"frequency f = %g Hz\n", f);
219 fprintf(stdout,
"quality Q = %g\n",
Q);
226 int main(
int argc,
char *argv[])
253 char args[] =
"hLM:a:l:m:s:";
255 int option_index = 0;
264 if (long_options[option_index].
flag)
267 fprintf(stderr,
"error parsing option %s with argument %s\n", long_options[option_index].
name,
LALoptarg);
293 fprintf(stderr,
"unknown error while parsing options\n");
299 fprintf(stderr,
"extraneous command line arguments:\n");
306 fprintf(stderr,
"must specify l, m, and s\n");
312 fprintf(stderr,
"must specify |a| < 1 (or |a| < 0.5 with Leaver's conventions)\n");
317 fprintf(stderr,
"do not use both --leaver and --mass options\n");
329 fprintf(stderr,
"\t-h, --help \tprint this message and exit\n");
330 fprintf(stderr,
"\t-L, --leaver \tuse Leaver's conventions\n");
331 fprintf(stderr,
"\t-M Msolar \t(optional) set black hole mass (solar masses)\n");
332 fprintf(stderr,
"\t-a a \t(optional) set value of a, |a|<1 (Leaver: |a|<0.5)\n");
333 fprintf(stderr,
"\t-l l \t(required) set value of l, l>=0\n");
334 fprintf(stderr,
"\t-m m \t(required) set value of m, abs(m)<=l\n");
335 fprintf(stderr,
"\t-s s \t(required) set value of s, s<=0\n");
336 fprintf(stderr,
"description:\n");
337 fprintf(stderr,
"\tprints the eigenvalues for given a if a is specified\n");
338 fprintf(stderr,
"\tprints a table of mode eigenvalues if a is not specified\n");
339 fprintf(stderr,
"\tprints frequency and quality factor if mass is specified\n");
340 fprintf(stderr,
"\tuses Leaver's conventions (G = c = 2M = 1) if --leaver is used\n");
void LALCheckMemoryLeaks(void)
int LALgetopt_long_only(int argc, char *const *argv, const char *options, const struct LALoption *long_options, int *opt_index)
#define required_argument
int main(int argc, char *argv[])
int usage(const char *program)
int parseargs(int argc, char **argv)
int output_mode_table(void)
int XLALSimBlackHoleRingdownModeEigenvaluesLeaver(COMPLEX16 *A, COMPLEX16 *omega, double a, int l, int m, int s)
Low-level routine that computes the black hole quasinormal mode eigenefrequency, omega,...
void XLALBacktraceErrorHandler(const char *func, const char *file, int line, int errnum)
XLALErrorHandlerType * XLALSetErrorHandler(XLALErrorHandlerType *newHandler)