108 #include <lal/LALStdlib.h>
109 #include <lal/LALgetopt.h>
110 #include <lal/LALConstants.h>
111 #include <lal/LALSimBlackHoleRingdown.h>
113 #define theta_invalid -100.0
114 #define a_invalid -100.0
115 #define l_invalid (INT_MIN + 1)
116 #define m_invalid (INT_MAX)
117 #define s_invalid (INT_MAX)
129 int main(
int argc,
char *argv[] )
136 fprintf(stdout,
"# theta(deg)\t Re(S) \t Im(S)\n");
139 fprintf(stdout,
"%8g\t%e\t%e\n",
theta, creal(sphwf), cimag(sphwf));
143 fprintf(stdout,
"Spheroidal wave function (s)S(l,m)(cos(theta),a):\n");
144 fprintf(stdout,
"(%d)S(%d,%d)(cos(%g deg),%g) = %g + %g i\n",
s,
l,
m,
theta,
a, creal(sphwf), cimag(sphwf));
160 char args[] =
"ha:i:l:m:s:";
162 int option_index = 0;
171 if (long_options[option_index].
flag)
174 fprintf(stderr,
"error parsing option %s with argument %s\n", long_options[option_index].
name,
LALoptarg);
197 fprintf(stderr,
"unknown error while parsing options\n");
203 fprintf( stderr,
"extraneous command line arguments:\n" );
210 fprintf(stderr,
"must specify a, l, m, and s\n");
215 if (fabs(
a) >= 1.0) {
216 fprintf(stderr,
"must specify |a| < 1\n");
221 fprintf(stderr,
"must specify l >= |s|\n");
226 fprintf(stderr,
"must specify |m| <= l\n");
236 fprintf(stderr,
"options:\n" );
237 fprintf(stderr,
"\t-h, --help \tprint this message and exit\n");
238 fprintf(stderr,
"\t-i theta \t(optional) inclination (polar) angle theta (deg)\n");
239 fprintf(stderr,
"\t-a a \t(required) set value of a, -1<a<1\n");
240 fprintf(stderr,
"\t-l l \t(required) set value of l, l>=0\n");
241 fprintf(stderr,
"\t-m m \t(required) set value of m, abs(m)<=l\n");
242 fprintf(stderr,
"\t-s s \t(required) set value of s, s<=0\n");
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)
COMPLEX16 XLALSimBlackHoleRingdownSpheroidalWaveFunction(double theta, double dimensionless_spin, int l, int m, int s)
Evaluates the value of spheroidal wave function at a given polar angle theta for a specified mode (l,...
void XLALBacktraceErrorHandler(const char *func, const char *file, int line, int errnum)
XLALErrorHandlerType * XLALSetErrorHandler(XLALErrorHandlerType *newHandler)