Commit f8ecd1d7 authored by Maria Haney's avatar Maria Haney

Merge branch 'PN_modes_master_rebase' into 'master'

Precessing PN modes

See merge request lscsoft/lalsuite!1010
parents cac7e583 89440468
...@@ -50,6 +50,7 @@ extern "C" { ...@@ -50,6 +50,7 @@ extern "C" {
* @defgroup LALSimIMRPSpinInspiralRD_c LALSimIMRPSpinInspiralRD.c * @defgroup LALSimIMRPSpinInspiralRD_c LALSimIMRPSpinInspiralRD.c
* @defgroup LALSimIMRTidal_c LALSimIMRLackeyTidal2013.c * @defgroup LALSimIMRTidal_c LALSimIMRLackeyTidal2013.c
* @defgroup LALSimPrecessingNRSur_c LALSimIMRPrecessingNRSur.c * @defgroup LALSimPrecessingNRSur_c LALSimIMRPrecessingNRSur.c
* @defgroup LALSimIMRNRWaveforms_c LALSimIMRNRWaveforms.c
* @} * @}
* *
* @addtogroup LALSimIMR_h * @addtogroup LALSimIMR_h
...@@ -106,7 +107,7 @@ int XLALSimIMRPhenomPCalculateModelParametersFromSourceFrame(REAL8 *chi1_l, REAL ...@@ -106,7 +107,7 @@ int XLALSimIMRPhenomPCalculateModelParametersFromSourceFrame(REAL8 *chi1_l, REAL
int XLALSimIMREOBNRv2DominantMode(REAL8TimeSeries **hplus, REAL8TimeSeries **hcross, const REAL8 phiC, const REAL8 deltaT, const REAL8 m1SI, const REAL8 m2SI, const REAL8 fLower, const REAL8 distance, const REAL8 inclination); int XLALSimIMREOBNRv2DominantMode(REAL8TimeSeries **hplus, REAL8TimeSeries **hcross, const REAL8 phiC, const REAL8 deltaT, const REAL8 m1SI, const REAL8 m2SI, const REAL8 fLower, const REAL8 distance, const REAL8 inclination);
int XLALSimIMREOBNRv2AllModes(REAL8TimeSeries **hplus, REAL8TimeSeries **hcross, const REAL8 phiC, const REAL8 deltaT, const REAL8 m1SI, const REAL8 m2SI, const REAL8 fLower, const REAL8 distance, const REAL8 inclination); int XLALSimIMREOBNRv2AllModes(REAL8TimeSeries **hplus, REAL8TimeSeries **hcross, const REAL8 phiC, const REAL8 deltaT, const REAL8 m1SI, const REAL8 m2SI, const REAL8 fLower, const REAL8 distance, const REAL8 inclination);
SphHarmTimeSeries *XLALSimIMREOBNRv2Modes(const REAL8 phiRef, const REAL8 deltaT, const REAL8 m1, const REAL8 m2, const REAL8 fLower, const REAL8 distance); SphHarmTimeSeries *XLALSimIMREOBNRv2Modes(const REAL8 deltaT, const REAL8 m1, const REAL8 m2, const REAL8 fLower, const REAL8 distance);
/* in module LALSimIMRSpinAlignedEOB.c */ /* in module LALSimIMRSpinAlignedEOB.c */
...@@ -342,6 +343,9 @@ int XLALSimInspiralNRWaveformGetSpinsFromHDF5File( ...@@ -342,6 +343,9 @@ int XLALSimInspiralNRWaveformGetSpinsFromHDF5File(
const char *NRDataFile /**< Location of NR HDF file */ const char *NRDataFile /**< Location of NR HDF file */
); );
/* The following XLALSimInspiralNRWaveformGetHplusHcross() generates polarizations
* reading directly the NR files and does not return l,m modes.
*/
int XLALSimInspiralNRWaveformGetHplusHcross( int XLALSimInspiralNRWaveformGetHplusHcross(
REAL8TimeSeries **hplus, /**< OUTPUT h_+ vector */ REAL8TimeSeries **hplus, /**< OUTPUT h_+ vector */
REAL8TimeSeries **hcross, /**< OUTPUT h_x vector */ REAL8TimeSeries **hcross, /**< OUTPUT h_x vector */
...@@ -363,6 +367,25 @@ int XLALSimInspiralNRWaveformGetHplusHcross( ...@@ -363,6 +367,25 @@ int XLALSimInspiralNRWaveformGetHplusHcross(
LALValue* ModeArray /**< Container for the ell and m modes to generate. To generate all available modes pass NULL */ LALValue* ModeArray /**< Container for the ell and m modes to generate. To generate all available modes pass NULL */
); );
/* The following XLALSimInspiralNRWaveformGetHlms() reads NR file to output l,m modes.
*/
INT4 XLALSimInspiralNRWaveformGetHlms(SphHarmTimeSeries **hlms, /**< OUTPUT */
REAL8 deltaT, /**< sampling interval (s) */
REAL8 m1, /**< mass of companion 1 (kg) */
REAL8 m2, /**< mass of companion 2 (kg) */
REAL8 r, /**< distance of source (m) */
REAL8 fStart, /**< start GW frequency (Hz) */
REAL8 fRef, /**< reference GW frequency (Hz) */
REAL8 s1x, /**< initial value of S1x */
REAL8 s1y, /**< initial value of S1y */
REAL8 s1z, /**< initial value of S1z */
REAL8 s2x, /**< initial value of S2x */
REAL8 s2y, /**< initial value of S2y */
REAL8 s2z, /**< initial value of S2z */
const char *NRDataFile, /**< Location of NR HDF file */
LALValue* ModeArray /**< Container for the ell and m modes to generate. To generate all available modes pass NULL */
);
/* in module LALSimIMRPrecessingNRSur.c */ /* in module LALSimIMRPrecessingNRSur.c */
int XLALSimInspiralPrecessingNRSurPolarizations( int XLALSimInspiralPrecessingNRSurPolarizations(
...@@ -399,7 +422,7 @@ SphHarmTimeSeries *XLALSimInspiralPrecessingNRSurModes( ...@@ -399,7 +422,7 @@ SphHarmTimeSeries *XLALSimInspiralPrecessingNRSurModes(
REAL8 S2z, /**< z-component of the dimensionless spin of object 2 */ REAL8 S2z, /**< z-component of the dimensionless spin of object 2 */
REAL8 fMin, /**< start GW frequency (Hz) */ REAL8 fMin, /**< start GW frequency (Hz) */
REAL8 fRef, /**< reference GW frequency (Hz) */ REAL8 fRef, /**< reference GW frequency (Hz) */
REAL8 distnace, /**< distance of source (m) */ REAL8 distance, /**< distance of source (m) */
LALDict* LALparams, /**< Dict with extra parameters */ LALDict* LALparams, /**< Dict with extra parameters */
Approximant approximant /**< approximant (NRSur7dq2 or NRSur7dq4) */ Approximant approximant /**< approximant (NRSur7dq2 or NRSur7dq4) */
); );
...@@ -434,7 +457,6 @@ int XLALPrecessingNRSurDynamics( ...@@ -434,7 +457,6 @@ int XLALPrecessingNRSurDynamics(
Approximant approximant /**< approximant (NRSur7dq2 or NRSur7dq4). */ Approximant approximant /**< approximant (NRSur7dq2 or NRSur7dq4). */
); );
/* in module LALSimNRTunedTides.c */ /* in module LALSimNRTunedTides.c */
double XLALSimNRTunedTidesComputeKappa2T( double XLALSimNRTunedTidesComputeKappa2T(
REAL8 m1_SI, /**< Mass of companion 1 (kg) */ REAL8 m1_SI, /**< Mass of companion 1 (kg) */
......
...@@ -1748,7 +1748,6 @@ XLALSimIMREOBNRv2AllModes( ...@@ -1748,7 +1748,6 @@ XLALSimIMREOBNRv2AllModes(
* SWSH modes in a SphHarmTimeSeries struct. * SWSH modes in a SphHarmTimeSeries struct.
*/ */
SphHarmTimeSeries *XLALSimIMREOBNRv2Modes( SphHarmTimeSeries *XLALSimIMREOBNRv2Modes(
const REAL8 phiRef, /**< Orbital phase at coalescence (radians) */
const REAL8 deltaT, /**< Sampling interval (s) */ const REAL8 deltaT, /**< Sampling interval (s) */
const REAL8 m1, /**< First component mass (kg) */ const REAL8 m1, /**< First component mass (kg) */
const REAL8 m2, /**< Second component mass (kg) */ const REAL8 m2, /**< Second component mass (kg) */
...@@ -1757,7 +1756,7 @@ SphHarmTimeSeries *XLALSimIMREOBNRv2Modes( ...@@ -1757,7 +1756,7 @@ SphHarmTimeSeries *XLALSimIMREOBNRv2Modes(
) )
{ {
SphHarmTimeSeries *hlms = NULL; SphHarmTimeSeries *hlms = NULL;
if ( XLALSimIMREOBNRv2Generator(NULL, NULL, &hlms, phiRef, deltaT, m1, m2, if ( XLALSimIMREOBNRv2Generator(NULL, NULL, &hlms, 0., deltaT, m1, m2,
fLower, distance, 0., 1) == XLAL_FAILURE ) fLower, distance, 0., 1) == XLAL_FAILURE )
{ {
XLAL_ERROR_NULL( XLAL_EFUNC ); XLAL_ERROR_NULL( XLAL_EFUNC );
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -338,4 +338,50 @@ int XLALSimInspiralOrientationMatrixDirection( ...@@ -338,4 +338,50 @@ int XLALSimInspiralOrientationMatrixDirection(
return XLAL_SUCCESS; return XLAL_SUCCESS;
} }
/**
* Takes in the h_lm spherical harmonic decomposed modes and rotates the modes
* by Euler angles alpha, beta, and gamma using the Wigner D matrices, analog to
* int XLALSimInspiralPrecessionRotateModes but with 2 crucial differences:
*
* * leaves unaltered the input SphericalHarmonicTimeSeries
* * The Wigner DMatrix rotation function XLALWignerDMatrix() is called
with arguments (alpha, -beta, gamma), instead of (alpha, beta, gamma),
* to ensure that
* (h+ + i hx)(alpha,beta,gamma)=Sum_{lmm'} Y_lm(0,0) D_mm'(alpha,beta,gamma) h_lm'(0,0,0)
*
*/
int XLALSimInspiralPrecessionRotateModesOut(SphHarmTimeSeries **hlm_out, /**< spherical harmonic decomposed modes, output */
SphHarmTimeSeries *hlm_in, /**< spherical harmonic decomposed modes, input */
const REAL8TimeSeries *alpha, /**< alpha Euler angle time series */
const REAL8TimeSeries *beta, /**< beta Euler angle time series */
const REAL8TimeSeries *gam /**< gamma Euler angle time series */
){
if (*hlm_out)
XLAL_ERROR(XLAL_EFAILED);
unsigned int i;
int l, m, mp;
int lmax = XLALSphHarmTimeSeriesGetMaxL( hlm_in );
int lmin = XLALSphHarmTimeSeriesGetMinL( hlm_in );
for( l=lmin; l <= lmax; l++ ) {
COMPLEX16TimeSeries **inmode= XLALCalloc( 2*lmax+1, sizeof(COMPLEX16TimeSeries) );
for( m=-l; m<=l; m++){
inmode[m+l] = XLALSphHarmTimeSeriesGetMode(hlm_in, l, m );
}
for( m=-l; m<=l; m++){
COMPLEX16TimeSeries *outmode = XLALCreateCOMPLEX16TimeSeries(inmode[m+l]->name,&inmode[m+l]->epoch,0.,inmode[m+l]->deltaT,&inmode[m+l]->sampleUnits,inmode[m+l]->data->length);
for(i=0; i<inmode[m+l]->data->length; i++)
outmode->data->data[i]=0.;
for(mp=-l; mp<=l; mp++){
for(i=0; i<inmode[m+l]->data->length; i++) {
outmode->data->data[i] += inmode[mp+l]->data->data[i] * XLALWignerDMatrix( l, mp, m, alpha->data->data[i], -beta->data->data[i], gam->data->data[i] );
}
}
*hlm_out=XLALSphHarmTimeSeriesAddMode(*hlm_out,outmode,l,m);
}
}
return XLAL_SUCCESS;
}
/** @} */ /** @} */
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
#include <gsl/gsl_eigen.h> #include <gsl/gsl_eigen.h>
int XLALSimInspiralPrecessionRotateModes(SphHarmTimeSeries* h_lm, REAL8TimeSeries* alpha, REAL8TimeSeries* beta, REAL8TimeSeries* gam); int XLALSimInspiralPrecessionRotateModes(SphHarmTimeSeries* h_lm, REAL8TimeSeries* alpha, REAL8TimeSeries* beta, REAL8TimeSeries* gam);
int XLALSimInspiralPrecessionRotateModesOut(SphHarmTimeSeries **hlm_out, SphHarmTimeSeries *hlm_in, const REAL8TimeSeries *alpha, const REAL8TimeSeries *beta, const REAL8TimeSeries *gam);
int XLALSimInspiralConstantPrecessionConeWaveformModes(SphHarmTimeSeries** h_lm_tmp, double precess_freq, double a, double phi_precess, double alpha_0, double beta_0); int XLALSimInspiralConstantPrecessionConeWaveformModes(SphHarmTimeSeries** h_lm_tmp, double precess_freq, double a, double phi_precess, double alpha_0, double beta_0);
int XLALSimInspiralConstantPrecessionConeWaveform(REAL8TimeSeries** hp, REAL8TimeSeries** hx, SphHarmTimeSeries* h_lm, double precess_freq, double a, double phi_precess, double alpha_0, double beta_0); int XLALSimInspiralConstantPrecessionConeWaveform(REAL8TimeSeries** hp, REAL8TimeSeries** hx, SphHarmTimeSeries* h_lm, double precess_freq, double a, double phi_precess, double alpha_0, double beta_0);
int XLALSimInspiralOrientationMatrixForL2(REAL8 mtx[3][3], COMPLEX16 h22, COMPLEX16 h2m2, COMPLEX16 h21, COMPLEX16 h2m1, COMPLEX16 h20); int XLALSimInspiralOrientationMatrixForL2(REAL8 mtx[3][3], COMPLEX16 h22, COMPLEX16 h2m2, COMPLEX16 h21, COMPLEX16 h2m1, COMPLEX16 h20);
......
...@@ -470,8 +470,7 @@ int XLALSimInspiralTaylorT1PNGenerator( ...@@ -470,8 +470,7 @@ int XLALSimInspiralTaylorT1PNGenerator(
} }
SphHarmTimeSeries *XLALSimInspiralTaylorT1PNModes( SphHarmTimeSeries *XLALSimInspiralTaylorT1PNModes(
REAL8 phiRef, /**< reference orbital phase (rad) */ UNUSED REAL8 v0, /**< tail-term gauge choice (default = 1) */
REAL8 v0, /**< tail-term gauge choice (default = 1) */
REAL8 deltaT, /**< sampling interval (s) */ REAL8 deltaT, /**< sampling interval (s) */
REAL8 m1, /**< mass of companion 1 (kg) */ REAL8 m1, /**< mass of companion 1 (kg) */
REAL8 m2, /**< mass of companion 2 (kg) */ REAL8 m2, /**< mass of companion 2 (kg) */
...@@ -513,7 +512,7 @@ SphHarmTimeSeries *XLALSimInspiralTaylorT1PNModes( ...@@ -513,7 +512,7 @@ SphHarmTimeSeries *XLALSimInspiralTaylorT1PNModes(
REAL8TimeSeries *V; REAL8TimeSeries *V;
REAL8TimeSeries *phi; REAL8TimeSeries *phi;
int n; int n;
n = XLALSimInspiralTaylorT1PNEvolveOrbit(&V, &phi, phiRef, deltaT, n = XLALSimInspiralTaylorT1PNEvolveOrbit(&V, &phi, 0., deltaT,
m1, m2, f_min, fRef, lambda1, lambda2, tideO, phaseO); m1, m2, f_min, fRef, lambda1, lambda2, tideO, phaseO);
if ( n < 0 ) if ( n < 0 )
XLAL_ERROR_NULL(XLAL_EFUNC); XLAL_ERROR_NULL(XLAL_EFUNC);
...@@ -521,8 +520,8 @@ SphHarmTimeSeries *XLALSimInspiralTaylorT1PNModes( ...@@ -521,8 +520,8 @@ SphHarmTimeSeries *XLALSimInspiralTaylorT1PNModes(
COMPLEX16TimeSeries *hxx; COMPLEX16TimeSeries *hxx;
for(l=2; l<=lmax; l++){ for(l=2; l<=lmax; l++){
for(m=-l; m<=l; m++){ for(m=-l; m<=l; m++){
hxx = XLALCreateSimInspiralPNModeCOMPLEX16TimeSeries(V, phi, hxx = XLALCreateSimInspiralPNModeCOMPLEX16TimeSeriesLALConvention(V, phi,
v0, m1, m2, r, amplitudeO, l, m); m1, m2, r, amplitudeO, l, m);
if ( !hxx ){ if ( !hxx ){
XLAL_ERROR_NULL(XLAL_EFUNC); XLAL_ERROR_NULL(XLAL_EFUNC);
} }
...@@ -540,8 +539,7 @@ SphHarmTimeSeries *XLALSimInspiralTaylorT1PNModes( ...@@ -540,8 +539,7 @@ SphHarmTimeSeries *XLALSimInspiralTaylorT1PNModes(
* using TaylorT1 phasing. * using TaylorT1 phasing.
*/ */
COMPLEX16TimeSeries *XLALSimInspiralTaylorT1PNMode( COMPLEX16TimeSeries *XLALSimInspiralTaylorT1PNMode(
REAL8 phiRef, /**< reference orbital phase (rad) */ UNUSED REAL8 v0, /**< tail-term gauge choice (default = 1) */
REAL8 v0, /**< tail-term gauge choice (default = 1) */
REAL8 deltaT, /**< sampling interval (s) */ REAL8 deltaT, /**< sampling interval (s) */
REAL8 m1, /**< mass of companion 1 (kg) */ REAL8 m1, /**< mass of companion 1 (kg) */
REAL8 m2, /**< mass of companion 2 (kg) */ REAL8 m2, /**< mass of companion 2 (kg) */
...@@ -584,12 +582,12 @@ COMPLEX16TimeSeries *XLALSimInspiralTaylorT1PNMode( ...@@ -584,12 +582,12 @@ COMPLEX16TimeSeries *XLALSimInspiralTaylorT1PNMode(
REAL8TimeSeries *V; REAL8TimeSeries *V;
REAL8TimeSeries *phi; REAL8TimeSeries *phi;
int n; int n;
n = XLALSimInspiralTaylorT1PNEvolveOrbit(&V, &phi, phiRef, deltaT, n = XLALSimInspiralTaylorT1PNEvolveOrbit(&V, &phi, 0., deltaT,
m1, m2, f_min, fRef, lambda1, lambda2, tideO, phaseO); m1, m2, f_min, fRef, lambda1, lambda2, tideO, phaseO);
if ( n < 0 ) if ( n < 0 )
XLAL_ERROR_NULL(XLAL_EFUNC); XLAL_ERROR_NULL(XLAL_EFUNC);
hlm = XLALCreateSimInspiralPNModeCOMPLEX16TimeSeries(V, phi, hlm = XLALCreateSimInspiralPNModeCOMPLEX16TimeSeriesLALConvention(V, phi,
v0, m1, m2, r, amplitudeO, l, m); m1, m2, r, amplitudeO, l, m);
if ( !hlm ) if ( !hlm )
XLAL_ERROR_NULL(XLAL_EFUNC); XLAL_ERROR_NULL(XLAL_EFUNC);
XLALDestroyREAL8TimeSeries(phi); XLALDestroyREAL8TimeSeries(phi);
......
...@@ -935,7 +935,7 @@ int XLALSimInspiralTaylorT2PNGenerator( ...@@ -935,7 +935,7 @@ int XLALSimInspiralTaylorT2PNGenerator(
REAL8TimeSeries **hplus, /**< +-polarization waveform */ REAL8TimeSeries **hplus, /**< +-polarization waveform */
REAL8TimeSeries **hcross, /**< x-polarization waveform */ REAL8TimeSeries **hcross, /**< x-polarization waveform */
REAL8 phiRef, /**< reference orbital phase (rad) */ REAL8 phiRef, /**< reference orbital phase (rad) */
REAL8 v0, /**< tail-term gauge choice (default = 1) */ UNUSED REAL8 v0, /**< tail-term gauge choice (default = 1) */
REAL8 deltaT, /**< sampling interval (s) */ REAL8 deltaT, /**< sampling interval (s) */
REAL8 m1, /**< mass of companion 1 (kg) */ REAL8 m1, /**< mass of companion 1 (kg) */
REAL8 m2, /**< mass of companion 2 (kg) */ REAL8 m2, /**< mass of companion 2 (kg) */
...@@ -996,8 +996,7 @@ int XLALSimInspiralTaylorT2PNGenerator( ...@@ -996,8 +996,7 @@ int XLALSimInspiralTaylorT2PNGenerator(
* using TaylorT2 phasing. * using TaylorT2 phasing.
*/ */
SphHarmTimeSeries *XLALSimInspiralTaylorT2PNModes( SphHarmTimeSeries *XLALSimInspiralTaylorT2PNModes(
REAL8 phiRef, /**< reference orbital phase (rad) */ UNUSED REAL8 v0, /**< tail-term gauge choice (default = 1) */
REAL8 v0, /**< tail-term gauge choice (default = 1) */
REAL8 deltaT, /**< sampling interval (s) */ REAL8 deltaT, /**< sampling interval (s) */
REAL8 m1, /**< mass of companion 1 (kg) */ REAL8 m1, /**< mass of companion 1 (kg) */
REAL8 m2, /**< mass of companion 2 (kg) */ REAL8 m2, /**< mass of companion 2 (kg) */
...@@ -1039,7 +1038,7 @@ SphHarmTimeSeries *XLALSimInspiralTaylorT2PNModes( ...@@ -1039,7 +1038,7 @@ SphHarmTimeSeries *XLALSimInspiralTaylorT2PNModes(
REAL8TimeSeries *V; REAL8TimeSeries *V;
REAL8TimeSeries *phi; REAL8TimeSeries *phi;
int n; int n;
n = XLALSimInspiralTaylorT2PNEvolveOrbit(&V, &phi, phiRef, deltaT, n = XLALSimInspiralTaylorT2PNEvolveOrbit(&V, &phi, 0., deltaT,
m1, m2, f_min, fRef, lambda1, lambda2, tideO, phaseO); m1, m2, f_min, fRef, lambda1, lambda2, tideO, phaseO);
if ( n < 0 ) if ( n < 0 )
XLAL_ERROR_NULL(XLAL_EFUNC); XLAL_ERROR_NULL(XLAL_EFUNC);
...@@ -1047,8 +1046,8 @@ SphHarmTimeSeries *XLALSimInspiralTaylorT2PNModes( ...@@ -1047,8 +1046,8 @@ SphHarmTimeSeries *XLALSimInspiralTaylorT2PNModes(
COMPLEX16TimeSeries *hxx; COMPLEX16TimeSeries *hxx;
for(l=2; l<=lmax; l++){ for(l=2; l<=lmax; l++){
for(m=-l; m<=l; m++){ for(m=-l; m<=l; m++){
hxx = XLALCreateSimInspiralPNModeCOMPLEX16TimeSeries(V, phi, hxx = XLALCreateSimInspiralPNModeCOMPLEX16TimeSeriesLALConvention(V, phi,
v0, m1, m2, r, amplitudeO, l, m); m1, m2, r, amplitudeO, l, m);
if ( !hxx ){ if ( !hxx ){
XLAL_ERROR_NULL(XLAL_EFUNC); XLAL_ERROR_NULL(XLAL_EFUNC);
} }
...@@ -1066,8 +1065,7 @@ SphHarmTimeSeries *XLALSimInspiralTaylorT2PNModes( ...@@ -1066,8 +1065,7 @@ SphHarmTimeSeries *XLALSimInspiralTaylorT2PNModes(
* using TaylorT2 phasing. * using TaylorT2 phasing.
*/ */
COMPLEX16TimeSeries *XLALSimInspiralTaylorT2PNMode( COMPLEX16TimeSeries *XLALSimInspiralTaylorT2PNMode(
REAL8 phiRef, /**< reference orbital phase (rad) */ UNUSED REAL8 v0, /**< tail-term gauge choice (default = 1) */
REAL8 v0, /**< tail-term gauge choice (default = 1) */
REAL8 deltaT, /**< sampling interval (s) */ REAL8 deltaT, /**< sampling interval (s) */
REAL8 m1, /**< mass of companion 1 (kg) */ REAL8 m1, /**< mass of companion 1 (kg) */
REAL8 m2, /**< mass of companion 2 (kg) */ REAL8 m2, /**< mass of companion 2 (kg) */
...@@ -1110,12 +1108,12 @@ COMPLEX16TimeSeries *XLALSimInspiralTaylorT2PNMode( ...@@ -1110,12 +1108,12 @@ COMPLEX16TimeSeries *XLALSimInspiralTaylorT2PNMode(
REAL8TimeSeries *V; REAL8TimeSeries *V;
REAL8TimeSeries *phi; REAL8TimeSeries *phi;
int n; int n;
n = XLALSimInspiralTaylorT2PNEvolveOrbit(&V, &phi, phiRef, deltaT, n = XLALSimInspiralTaylorT2PNEvolveOrbit(&V, &phi, 0., deltaT,
m1, m2, f_min, fRef, lambda1, lambda2, tideO, phaseO); m1, m2, f_min, fRef, lambda1, lambda2, tideO, phaseO);
if ( n < 0 ) if ( n < 0 )
XLAL_ERROR_NULL(XLAL_EFUNC); XLAL_ERROR_NULL(XLAL_EFUNC);
hlm = XLALCreateSimInspiralPNModeCOMPLEX16TimeSeries(V, phi, hlm = XLALCreateSimInspiralPNModeCOMPLEX16TimeSeriesLALConvention(V, phi,
v0, m1, m2, r, amplitudeO, l, m); m1, m2, r, amplitudeO, l, m);
XLALDestroyREAL8TimeSeries(phi); XLALDestroyREAL8TimeSeries(phi);
XLALDestroyREAL8TimeSeries(V); XLALDestroyREAL8TimeSeries(V);
return hlm; return hlm;
......
...@@ -1040,8 +1040,7 @@ int XLALSimInspiralTaylorT3PNGenerator( ...@@ -1040,8 +1040,7 @@ int XLALSimInspiralTaylorT3PNGenerator(
* using TaylorT3 phasing. * using TaylorT3 phasing.
*/ */
SphHarmTimeSeries *XLALSimInspiralTaylorT3PNModes( SphHarmTimeSeries *XLALSimInspiralTaylorT3PNModes(
REAL8 phiRef, /**< reference orbital phase (rad) */ UNUSED REAL8 v0, /**< tail-term gauge choice (default = 1) */
REAL8 v0, /**< tail-term gauge choice (default = 1) */
REAL8 deltaT, /**< sampling interval (s) */ REAL8 deltaT, /**< sampling interval (s) */
REAL8 m1, /**< mass of companion 1 (kg) */ REAL8 m1, /**< mass of companion 1 (kg) */
REAL8 m2, /**< mass of companion 2 (kg) */ REAL8 m2, /**< mass of companion 2 (kg) */
...@@ -1083,7 +1082,7 @@ SphHarmTimeSeries *XLALSimInspiralTaylorT3PNModes( ...@@ -1083,7 +1082,7 @@ SphHarmTimeSeries *XLALSimInspiralTaylorT3PNModes(
REAL8TimeSeries *V; REAL8TimeSeries *V;
REAL8TimeSeries *phi; REAL8TimeSeries *phi;
int n; int n;
n = XLALSimInspiralTaylorT3PNEvolveOrbit(&V, &phi, phiRef, deltaT, n = XLALSimInspiralTaylorT3PNEvolveOrbit(&V, &phi, 0., deltaT,
m1, m2, f_min, fRef, lambda1, lambda2, tideO, phaseO); m1, m2, f_min, fRef, lambda1, lambda2, tideO, phaseO);
if ( n < 0 ) if ( n < 0 )
XLAL_ERROR_NULL(XLAL_EFUNC); XLAL_ERROR_NULL(XLAL_EFUNC);
...@@ -1091,8 +1090,8 @@ SphHarmTimeSeries *XLALSimInspiralTaylorT3PNModes( ...@@ -1091,8 +1090,8 @@ SphHarmTimeSeries *XLALSimInspiralTaylorT3PNModes(
COMPLEX16TimeSeries *hxx; COMPLEX16TimeSeries *hxx;
for(l=2; l<=lmax; l++){ for(l=2; l<=lmax; l++){
for(m=-l; m<=l; m++){ for(m=-l; m<=l; m++){
hxx = XLALCreateSimInspiralPNModeCOMPLEX16TimeSeries(V, phi, hxx = XLALCreateSimInspiralPNModeCOMPLEX16TimeSeriesLALConvention(V, phi,
v0, m1, m2, r, amplitudeO, l, m); m1, m2, r, amplitudeO, l, m);
if ( !hxx ){ if ( !hxx ){
XLAL_ERROR_NULL(XLAL_EFUNC); XLAL_ERROR_NULL(XLAL_EFUNC);
} }
...@@ -1110,8 +1109,7 @@ SphHarmTimeSeries *XLALSimInspiralTaylorT3PNModes( ...@@ -1110,8 +1109,7 @@ SphHarmTimeSeries *XLALSimInspiralTaylorT3PNModes(
* using TaylorT3 phasing. * using TaylorT3 phasing.
*/ */
COMPLEX16TimeSeries *XLALSimInspiralTaylorT3PNMode( COMPLEX16TimeSeries *XLALSimInspiralTaylorT3PNMode(
REAL8 phiRef, /**< reference orbital phase (rad) */ UNUSED REAL8 v0, /**< tail-term gauge choice (default = 1) */
REAL8 v0, /**< tail-term gauge choice (default = 1) */
REAL8 deltaT, /**< sampling interval (s) */ REAL8 deltaT, /**< sampling interval (s) */
REAL8 m1, /**< mass of companion 1 (kg) */ REAL8 m1, /**< mass of companion 1 (kg) */
REAL8 m2, /**< mass of companion 2 (kg) */ REAL8 m2, /**< mass of companion 2 (kg) */
...@@ -1154,12 +1152,12 @@ COMPLEX16TimeSeries *XLALSimInspiralTaylorT3PNMode( ...@@ -1154,12 +1152,12 @@ COMPLEX16TimeSeries *XLALSimInspiralTaylorT3PNMode(
REAL8TimeSeries *V; REAL8TimeSeries *V;
REAL8TimeSeries *phi; REAL8TimeSeries *phi;
int n; int n;
n = XLALSimInspiralTaylorT3PNEvolveOrbit(&V, &phi, phiRef, deltaT, n = XLALSimInspiralTaylorT3PNEvolveOrbit(&V, &phi, 0., deltaT,
m1, m2, f_min, fRef, lambda1, lambda2, tideO, phaseO); m1, m2, f_min, fRef, lambda1, lambda2, tideO, phaseO);
if ( n < 0 ) if ( n < 0 )
XLAL_ERROR_NULL(XLAL_EFUNC); XLAL_ERROR_NULL(XLAL_EFUNC);
hlm = XLALCreateSimInspiralPNModeCOMPLEX16TimeSeries(V, phi, hlm = XLALCreateSimInspiralPNModeCOMPLEX16TimeSeriesLALConvention(V, phi,
v0, m1, m2, r, amplitudeO, l, m); m1, m2, r, amplitudeO, l, m);
XLALDestroyREAL8TimeSeries(phi); XLALDestroyREAL8TimeSeries(phi);
XLALDestroyREAL8TimeSeries(V); XLALDestroyREAL8TimeSeries(V);
return hlm; return hlm;
......
...@@ -572,7 +572,7 @@ int XLALSimInspiralTaylorT4PNGenerator( ...@@ -572,7 +572,7 @@ int XLALSimInspiralTaylorT4PNGenerator(
REAL8TimeSeries **hplus, /**< +-polarization waveform */ REAL8TimeSeries **hplus, /**< +-polarization waveform */
REAL8TimeSeries **hcross, /**< x-polarization waveform */ REAL8TimeSeries **hcross, /**< x-polarization waveform */
REAL8 phiRef, /**< reference orbital phase (rad) */ REAL8 phiRef, /**< reference orbital phase (rad) */
REAL8 v0, /**< tail-term gauge choice (default = 1) */ UNUSED REAL8 v0, /**< tail-term gauge choice (default = 1) */
REAL8 deltaT, /**< sampling interval (s) */ REAL8 deltaT, /**< sampling interval (s) */
REAL8 m1, /**< mass of companion 1 (kg) */ REAL8 m1, /**< mass of companion 1 (kg) */
REAL8 m2, /**< mass of companion 2 (kg) */ REAL8 m2, /**< mass of companion 2 (kg) */
...@@ -634,8 +634,7 @@ int XLALSimInspiralTaylorT4PNGenerator( ...@@ -634,8 +634,7 @@ int XLALSimInspiralTaylorT4PNGenerator(
* using TaylorT4 phasing. * using TaylorT4 phasing.
*/ */
SphHarmTimeSeries *XLALSimInspiralTaylorT4PNModes( SphHarmTimeSeries *XLALSimInspiralTaylorT4PNModes(
REAL8 phiRef, /**< reference orbital phase (rad) */ UNUSED REAL8 v0, /**< tail-term gauge choice (default = 1) */
REAL8 v0, /**< tail-term gauge choice (default = 1) */
REAL8 deltaT, /**< sampling interval (s) */ REAL8 deltaT, /**< sampling interval (s) */
REAL8 m1, /**< mass of companion 1 (kg) */ REAL8 m1, /**< mass of companion 1 (kg) */
REAL8 m2, /**< mass of companion 2 (kg) */ REAL8 m2, /**< mass of companion 2 (kg) */
...@@ -677,7 +676,7 @@ SphHarmTimeSeries *XLALSimInspiralTaylorT4PNModes( ...@@ -677,7 +676,7 @@ SphHarmTimeSeries *XLALSimInspiralTaylorT4PNModes(
REAL8TimeSeries *V; REAL8TimeSeries *V;
REAL8TimeSeries *phi; REAL8TimeSeries *phi;
int n; int n;
n = XLALSimInspiralTaylorT4PNEvolveOrbit(&V, &phi, phiRef, deltaT, n = XLALSimInspiralTaylorT4PNEvolveOrbit(&V, &phi, 0., deltaT,
m1, m2, f_min, fRef, lambda1, lambda2, tideO, phaseO); m1, m2, f_min, fRef, lambda1, lambda2, tideO, phaseO);
if ( n < 0 ) if ( n < 0 )
XLAL_ERROR_NULL(XLAL_EFUNC); XLAL_ERROR_NULL(XLAL_EFUNC);
...@@ -685,8 +684,8 @@ SphHarmTimeSeries *XLALSimInspiralTaylorT4PNModes( ...@@ -685,8 +684,8 @@ SphHarmTimeSeries *XLALSimInspiralTaylorT4PNModes(
COMPLEX16TimeSeries *hxx; COMPLEX16TimeSeries *hxx;
for(l=2; l<=lmax; l++){ for(l=2; l<=lmax; l++){
for(m=-l; m<=l; m++){ for(m=-l; m<=l; m++){
hxx = XLALCreateSimInspiralPNModeCOMPLEX16TimeSeries(V, phi, hxx = XLALCreateSimInspiralPNModeCOMPLEX16TimeSeriesLALConvention(V, phi,
v0, m1, m2, r, amplitudeO, l, m); m1, m2, r, amplitudeO, l, m);
if ( !hxx ){ if ( !hxx ){
XLAL_ERROR_NULL(XLAL_EFUNC); XLAL_ERROR_NULL(XLAL_EFUNC);
} }
...@@ -704,8 +703,7 @@ SphHarmTimeSeries *XLALSimInspiralTaylorT4PNModes( ...@@ -704,8 +703,7 @@ SphHarmTimeSeries *XLALSimInspiralTaylorT4PNModes(
* using TaylorT4 phasing. * using TaylorT4 phasing.
*/ */
COMPLEX16TimeSeries *XLALSimInspiralTaylorT4PNMode( COMPLEX16TimeSeries *XLALSimInspiralTaylorT4PNMode(
REAL8 phiRef, /**< reference orbital phase (rad) */ UNUSED REAL8 v0, /**< tail-term gauge choice (default = 1) */
REAL8 v0, /**< tail-term gauge choice (default = 1) */
REAL8 deltaT, /**< sampling interval (s) */ REAL8 deltaT, /**< sampling interval (s) */
REAL8 m1, /**< mass of companion 1 (kg) */ REAL8 m1, /**< mass of companion 1 (kg) */
REAL8 m2, /**< mass of companion 2 (kg) */ REAL8 m2, /**< mass of companion 2 (kg) */
...@@ -748,12 +746,12 @@ COMPLEX16TimeSeries *XLALSimInspiralTaylorT4PNMode( ...@@ -748,12 +746,12 @@ COMPLEX16TimeSeries *XLALSimInspiralTaylorT4PNMode(
REAL8TimeSeries *V; REAL8TimeSeries *V;
REAL8TimeSeries *phi; REAL8TimeSeries *phi;
int n; int n;
n = XLALSimInspiralTaylorT4PNEvolveOrbit(&V, &phi, phiRef, deltaT, n = XLALSimInspiralTaylorT4PNEvolveOrbit(&V, &phi, 0., deltaT,
m1, m2, f_min, fRef, lambda1, lambda2, tideO, phaseO); m1, m2, f_min, fRef, lambda1, lambda2, tideO, phaseO);
if ( n < 0 ) if ( n < 0 )
XLAL_ERROR_NULL(XLAL_EFUNC); XLAL_ERROR_NULL(XLAL_EFUNC);
hlm = XLALCreateSimInspiralPNModeCOMPLEX16TimeSeries(V, phi, hlm = XLALCreateSimInspiralPNModeCOMPLEX16TimeSeriesLALConvention(V, phi,
v0, m1, m2, r, amplitudeO, l, m); m1, m2, r, amplitudeO, l, m);
XLALDestroyREAL8TimeSeries(phi); XLALDestroyREAL8TimeSeries(phi);
XLALDestroyREAL8TimeSeries(V); XLALDestroyREAL8TimeSeries(V);
return hlm; return hlm;
......
...@@ -82,6 +82,62 @@ int XLALSimAddMode( ...@@ -82,6 +82,62 @@ int XLALSimAddMode(
return 0; return 0;
} }
/**
* Multiplies a mode h(l,m) by a spin-2 weighted spherical harmonic
* to obtain hplus - i hcross, which is added to the time series for
* TimeSeries of angles.
*
* Implements the sum of Eq. (11) of:
* Lawrence E. Kidder, \"Using Full Information When Computing Modes of
* Post-Newtonian Waveforms From Inspiralling Compact Binaries in Circular
* Orbit\", Physical Review D 77, 044016 (2008), arXiv:0710.0614v1 [gr-qc].
*/
int XLALSimAddModeAngleTimeSeries(
REAL8TimeSeries *hplus, /**< +-polarization waveform */
REAL8TimeSeries *hcross, /**< x-polarization waveform */
COMPLEX16TimeSeries *hmode, /**< complex mode h(l,m) */
REAL8TimeSeries *theta, /**< polar angle (rad) */
REAL8TimeSeries *phi, /**< azimuthal angle (rad) */
int l, /**< mode number l */
int m, /**< mode number m */
int sym /**< flag to add -m mode too */
)
{
COMPLEX16 Y;
UINT4 j;
LAL_CHECK_VALID_SERIES(hmode, XLAL_FAILURE);
LAL_CHECK_VALID_SERIES(hplus, XLAL_FAILURE);
LAL_CHECK_VALID_SERIES(hcross, XLAL_FAILURE);
LAL_CHECK_VALID_SERIES(theta, XLAL_FAILURE);
LAL_CHECK_VALID_SERIES(phi, XLAL_FAILURE);
LAL_CHECK_CONSISTENT_TIME_SERIES(hplus, hmode, XLAL_FAILURE);
LAL_CHECK_CONSISTENT_TIME_SERIES(hcross, hmode, XLAL_FAILURE);
LAL_CHECK_COMPATIBLE_BUT_UNIT_TIME_SERIES(hcross, theta, XLAL_FAILURE);
LAL_CHECK_COMPATIBLE_BUT_UNIT_TIME_SERIES(hcross, phi, XLAL_FAILURE);
for ( j = 0; j < hmode->data->length; ++j ) {
COMPLEX16 hpc;
Y = XLALSpinWeightedSphericalHarmonic(theta->data->data[j], phi->data->data[j], -2, l, m);
hpc = Y * hmode->data->data[j];
hplus->data->data[j] += creal(hpc);
hcross->data->data[j] += -cimag(hpc);
}
if ( sym ) { /* equatorial symmetry: add in -m mode */
if ( l % 2 ) /* l is odd */
Y = -Y;
for ( j = 0; j < hmode->data->length; ++j ) {
COMPLEX16 hpc;
Y = XLALSpinWeightedSphericalHarmonic(theta->data->data[j], phi->data->data[j], -2, l, -m);
hpc = Y * conj(hmode->data->data[j]);
hplus->data->data[j] += creal(hpc);
hcross->data->data[j] += -cimag(hpc);
}
}
return 0;
}
/** /**
* For all valid TimeSeries contained within hmode structure, * For all valid TimeSeries contained within hmode structure,
* multiplies a mode h(l,m) by a spin-2 weighted spherical harmonic * multiplies a mode h(l,m) by a spin-2 weighted spherical harmonic
...@@ -93,11 +149,11 @@ int XLALSimAddMode( ...@@ -93,11 +149,11 @@ int XLALSimAddMode(
* Orbit\", Physical Review D 77, 044016 (2008), arXiv:0710.0614v1 [gr-qc]. * Orbit\", Physical Review D 77, 044016 (2008), arXiv:0710.0614v1 [gr-qc].
*/ */
int XLALSimAddModeFromModes( int XLALSimAddModeFromModes(
REAL8TimeSeries *hplus, /**< +-polarization waveform */ REAL8TimeSeries *hplus, /**< +-polarization waveform */
REAL8TimeSeries *hcross, /**< x-polarization waveform */ REAL8TimeSeries *hcross, /**< x-polarization waveform */
SphHarmTimeSeries *hmode, /**< complex modes h(l,m) */ SphHarmTimeSeries *hmode, /**< complex modes h(l,m) */
REAL8 theta, /**< polar angle (rad) */ REAL8 theta, /**< polar angle (rad) */
REAL8 phi /**< azimuthal angle (rad) */ REAL8 phi /**< azimuthal angle (rad) */
) )
{ {
SphHarmTimeSeries* this = hmode; SphHarmTimeSeries* this = hmode;
...@@ -114,6 +170,42 @@ int XLALSimAddModeFromModes( ...@@ -114,6 +170,42 @@ int XLALSimAddModeFromModes(
return 0; return 0;
} }
/**
* For all valid TimeSeries contained within hmode structure,
* multiplies a mode h(l,m) by a spin-2 weighted spherical harmonic
* to obtain hplus - i hcross, which is added to the time series.
* Angles are TimeSeries too.
*
* Implements the sum of Eq. (11) of:
* Lawrence E. Kidder, \"Using Full Information When Computing Modes of
* Post-Newtonian Waveforms From Inspiralling Compact Binaries in Circular
* Orbit\", Physical Review D 77, 044016 (2008), arXiv:0710.0614v1 [gr-qc].
*
* @sa XLALSimAddModeAngleTimeSeries()
*
*/
int XLALSimAddModeFromModesAngleTimeSeries(
REAL8TimeSeries *hplus, /**< +-polarization waveform */
REAL8TimeSeries *hcross, /**< x-polarization waveform */
SphHarmTimeSeries *hmode, /**< complex modes h(l,m) */
REAL8TimeSeries *theta, /**< polar angle (rad) */
REAL8TimeSeries *phi /**< azimuthal angle (rad) */
)
{
SphHarmTimeSeries* this = hmode;
while ( this ) {
if ( !this->tdata ) {
this = this->next;
continue;
}
XLALSimAddModeAngleTimeSeries(hplus, hcross, hmode->mode, theta, phi, this->l, this->m, 1);
this = this->next;
}
return 0;
}
/** /**