21#include <lal/LALStdlib.h>
22#include <lal/LALConstants.h>
23#include <lal/LIGOMetadataTables.h>
24#include <lal/RingUtils.h>
30 const REAL4 fparam1 = 1.5251;
31 const REAL4 fparam2 = -1.1568;
32 const REAL4 fparam3 = 0.1292;
34 return fparam1 + fparam2 * pow( 1.0 -
a, fparam3);
42 return 1.0 + 7.0/(24.0*
Q*
Q);
77 const REAL4 qparam1 = 0.7000;
78 const REAL4 qparam2 = 1.4187;
79 const REAL4 qparam3 = -0.4990;
81 return 1.0 - pow( qparam2/(
Q - qparam1), -1.0/qparam3 );
104 const REAL4 qparam1 = 0.7000;
105 const REAL4 qparam2 = 1.4187;
106 const REAL4 qparam3 = -0.4990;
108 return qparam1 + (qparam2 * pow( (1.0 -
a), qparam3 ));
130 return sqrt(12.0) * eta - 2.9 * eta *eta;
137 return ( 1 + ( sqrt(8.0/9.0) - 1) * eta - 0.498 * eta * eta) * (mass1 + mass2);
154 const REAL4 t2 = -3.5171;
155 const REAL4 t3 = 2.5763;
156 const REAL4 s4 = -0.1229;
157 const REAL4 s5 = 0.4537;
158 const REAL4 q = mass2 / mass1;
160 const REAL4 q4 = q2 * q2;
161 const REAL4 q2sum = 1.0 + q2;
162 const REAL4 norma1 = sqrt( spin1x * spin1x + spin1y * spin1y + spin1z * spin1z );
163 const REAL4 norma2 = sqrt( spin2x * spin2x + spin2y * spin2y + spin2z * spin2z );
164 const REAL4 norma12 = norma1 * norma1;
165 const REAL4 norma22 = norma2 * norma2;
173 const int a1sign =
SIGN( spin1z );
174 const int a2sign =
SIGN( spin2z );
175 cosalpha = (
REAL4) a1sign * a2sign;
176 cosbeta = (
REAL4) a1sign;
177 cosgamma = (
REAL4) a2sign;
179 norml = 2.0 * sqrt(3.0) + t2 * eta + t3 * eta * eta + s4 / (q2sum * q2sum) *
180 (norma12 + norma22 * q4 + 2.0 * norma1 * norma2 * q2 * cosalpha) +
181 (s5 * eta +
t0 + 2.0) / q2sum * (norma1 * cosbeta + norma2 * q2 * cosgamma);
183 return 1.0 / ((1.0 +
q) * (1.0 +
q)) * sqrt(norma12 + norma22 * q4 + 2.0 * norma1 *
184 norma2 * q2 * cosalpha + 2.0 * (norma1 * cosbeta + norma2 * q2 * cosgamma) * norml *
185 q + norml * norml * q2);
198 return sqrt(5.0/2.0 * epsilon) *
200 (1.0 / sqrt(
Q * F * g) );
213 return (2.0/5.0 * amplitude * amplitude) *
222 return amplitude * sqrt(
Q * ( (0.5 +
Q*
Q ) * plus*plus +
Q * plus*cross +
Q*
Q * cross*cross ) / ( 1.0 + 4.0 *
Q*
Q) /
LAL_PI / f );
234 gQQ = ( 3.0 + 16.0 * Q2 * Q2) / ( Q2 * ( 1.0 + 4.0 * Q2 ) * ( 1.0 + 4.0 * Q2 ) );
235 gff = ( 3.0 + 8.0 * Q2) / ( fa * fa);
236 gQf = - 2.0 * ( 3.0 + 4.0 * Q2 ) / ( Qa * fa * ( 1.0 + 4.0 * Q2 ));
238 return ( 1.0/8.0 * ( gQQ * pow(Qb-Qa,2) + gQf * (Qb-Qa) * (fb-fa) + gff * pow(fb-fa,2) ) );
248 REAL8 f = (fa+fb)/2.;
252 gQQ = ( 1. + 28.*Q2*Q2 + 128.*Q2*Q2*Q2 + 64.*Q2*Q2*Q2*Q2) / ( 4. * Q2 * ( 1. + 6.*Q2 + 8.*Q2*Q2 )*( 1. + 6.*Q2 + 8.*Q2*Q2 ) );
253 gff = ( 1. + 6.*Q2 + 16.*Q2*Q2) / ( 4. * f*f * ( 1. + 2.*Q2 ) );
254 gtt = (
LAL_PI*
LAL_PI * f*f ) * ( 1. + 4.*Q2 ) / ( Q2 );
255 gQf = - ( 1. + 2.*Q2 + 8.*Q2*Q2 ) / ( 4.*
Q*f * ( 1. + 6.*Q2 + 8.*Q2*Q2 ) );
256 gtf = - (
LAL_PI *
Q ) * ( 1. + 4.*Q2) / ( 1. + 2.*Q2 );
257 gtQ = (
LAL_PI * f ) * ( 1. - 2.*Q2 ) / ( ( 1. + 2.*Q2 )*( 1. + 2.*Q2 ) );
262 ds2 = ( gQQ * dQ*dQ + gff *
df*
df + gtt *
dt*
dt + gQf * 2.*dQ*
df + gtf * 2.*
dt*
df + gtQ * 2.*
dt*dQ );
275 REAL8 f = (fa+fb)/2.;
279 gtt = (
LAL_PI*
LAL_PI * f*f ) * ( 1. + 4.*Q2 ) / ( Q2 );
280 gtf = - (
LAL_PI *
Q ) * ( 1. + 4.*Q2) / ( 1. + 2.*Q2 );
281 gtQ = (
LAL_PI * f ) * ( 1. - 2.*Q2 ) / ( ( 1. + 2.*Q2 )*( 1. + 2.*Q2 ) );
286 dt = -(gtf *
df + gtQ * dQ)/gtt;
299 gtt = (
LAL_PI*
LAL_PI * f*f ) * ( 1. + 4.*Q2 ) / ( Q2 );
301 return ( sqrt( lal_ring_ds_sq / gtt ) );
323 const REAL8 efolds = 10;
335 if ( !
output->data->length )
343 n = ceil( - efolds / log( fac ) );
352 if ( n < output->
data->length )
353 memset(
output->data->data +
n, 0,
354 (
output->data->length -
n ) *
sizeof( *
output->data->data ) );
358 for (
i = 0;
i <
n; ++
i )
362 output->data->data[
i] = amp * (
y = tmp );
406 const REAL4 amp = dynRange *
414 for (
i = 0;
i <
output->data->length; ++
i )
429 while ( q < input->maxQuality )
432 REAL4 logfreq = minlogf;
434 while ( logfreq < maxlogf )
445 logfreq += dseff / sqrt( 3 + 8 * q2 );
448 q += dseff *
q * ( 1 + 4 * q2 ) / sqrt( 3 + 16 * q2 * q2 );
static REAL4 ring_quality_fn(REAL4 Q)
static REAL4 ring_spin_factor(REAL4 a)
static int MakeBank(SnglRingdownTable *tmplt, RingTemplateBankInput *input)
REAL8 XLALRingdownTimeError(const SnglRingdownTable *table, REAL8 lal_ring_ds_sq)
int XLALComputeBlackHoleRing(REAL4TimeSeries *output, SnglRingdownTable *input, REAL4 dynRange)
This routine computes a waveform for a black hole with the specified physical parameters (in the inpu...
REAL4 XLALNonSpinBinaryFinalBHSpin(REAL4 eta)
REAL4 XLALBlackHoleRingHRSS(REAL4 f, REAL4 Q, REAL4 amplitude, REAL4 plus, REAL4 cross)
REAL4 XLALBlackHoleRingEpsilon(REAL4 f, REAL4 Q, REAL4 r, REAL4 amplitude)
REAL4 XLALBlackHoleRingFrequency(REAL4 M, REAL4 a)
REAL4 XLALBlackHoleRingMass(REAL4 f, REAL4 Q)
REAL4 XLALBlackHoleRingAmplitude(REAL4 f, REAL4 Q, REAL4 r, REAL4 epsilon)
int XLALComputeRingTemplate(REAL4TimeSeries *output, SnglRingdownTable *input)
This routine computes the ringdown waveform.
REAL4 XLALBlackHoleRingSpin(REAL4 Q)
void XLALDestroyRingTemplateBank(RingTemplateBank *bank)
Destroys a RingTemplateBank.
REAL4 XLALSpinBinaryFinalBHSpin(REAL4 eta, REAL4 mass1, REAL4 mass2, REAL4 spin1x, REAL4 spin2x, REAL4 spin1y, REAL4 spin2y, REAL4 spin1z, REAL4 spin2z)
REAL4 XLALBlackHoleRingQuality(REAL4 a)
REAL8 XLAL2DRingMetricDistance(REAL8 fa, REAL8 fb, REAL8 Qa, REAL8 Qb)
REAL4 XLALNonSpinBinaryFinalBHMass(REAL4 eta, REAL4 mass1, REAL4 mass2)
RingTemplateBank * XLALCreateRingTemplateBank(RingTemplateBankInput *input)
This routine creates a bank of ringdown templates that cover a set range in the parameters and .
REAL8 XLAL3DRingTimeMinimum(REAL8 fa, REAL8 fb, REAL8 Qa, REAL8 Qb)
REAL8 XLAL3DRingMetricDistance(REAL8 fa, REAL8 fb, REAL8 Qa, REAL8 Qb, REAL8 dt)
#define XLAL_ERROR_NULL(...)
This structure contains a bank of ringdown waveforms.
SnglRingdownTable * tmplt
Array of ringdown templates.
UINT4 numTmplt
The number of templates in the bank.
struct tagSnglRingdownTable * next
char output[FILENAME_MAX]