33 #define LD_SMALL4 (2.0e-4)
34 #define OOTWOPI (1.0 / LAL_TWOPI)
35 #define TWOPI_FLOAT 6.28318530717958f
36 #define OOTWOPI_FLOAT (1.0f / TWOPI_FLOAT)
41 #define likely(x) __builtin_expect((x),1)
66 if ( !sfts || !sfts->
data ) {
71 if ( !tSSB || !tSSB->
DeltaT || !tSSB->
Tdot || !amcoe || !amcoe->
a || !amcoe->
b ) {
77 XLALPrintError(
"\nInverse factorials table only up to order s=%d, can't handle %d spin-order\n\n",
90 REAL8 *DeltaT_al, *Tdot_al;
98 freqIndex0 = (
UINT4 )( sfts->
data[0].
f0 / dFreq + 0.5 );
103 static int firstcall = 1;
110 if ( FstatAtoms != NULL ) {
114 ( *FstatAtoms )->TAtom =
Tsft;
120 if ( fkdot[spdnOrder] != 0.0 ) {
127 a_al = amcoe->
a->
data;
128 b_al = amcoe->
b->
data;
135 REAL4 a_alpha, b_alpha;
142 REAL4 realXP, imagXP;
143 REAL4 realQXP, imagQXP;
145 REAL8 lambda_alpha, kappa_star;
150 REAL8 phi_alpha, Dphi_alpha, DT_al;
157 DT_al = ( *DeltaT_al );
161 for (
s = 0;
s <= spdnOrder;
s++ ) {
163 Dphi_alpha += fsdot * TAS_invfact_s;
166 phi_alpha += fsdot * TAS_invfact_s;
170 Dphi_alpha *=
Tsft * ( *Tdot_al );
171 lambda_alpha = 0.5 * Dphi_alpha - phi_alpha;
173 kstar = (
INT4 )( Dphi_alpha );
174 kappa_star = Dphi_alpha - 1.0 * kstar;
177 k0 = kstar - Dterms + 1;
180 if ( (
k0 < freqIndex0 ) || (
k1 > freqIndex1 ) ) {
181 XLAL_ERROR(
XLAL_EDOM,
"Required frequency-bins [%d, %d] not covered by SFT-interval [%d, %d]\n"
182 "\t\t[Parameters: alpha:%d, Dphi_alpha:%e, Tsft:%e, *Tdot_al:%e]\n",
183 k0,
k1, freqIndex0, freqIndex1,
alpha, Dphi_alpha,
Tsft, *Tdot_al );
200 COMPLEX8 *Xalpha_l = Xalpha +
k0 - freqIndex0;
209 #include HOTLOOP_SOURCE
233 realQXP = realQ * realXP - imagQ * imagXP;
234 imagQXP = realQ * imagXP + imagQ * realXP;
240 COMPLEX8 Fa_alpha =
crect( a_alpha * realQXP, a_alpha * imagQXP );
243 COMPLEX8 Fb_alpha =
crect( b_alpha * realQXP, b_alpha * imagQXP );
247 if ( FstatAtoms != NULL ) {
249 ( *FstatAtoms )->data[
alpha].a2_alpha = a_alpha * a_alpha;
250 ( *FstatAtoms )->data[
alpha].b2_alpha = b_alpha * b_alpha;
251 ( *FstatAtoms )->data[
alpha].ab_alpha = a_alpha * b_alpha;
252 ( *FstatAtoms )->data[
alpha].Fa_alpha =
OOTWOPI * Fa_alpha;
253 ( *FstatAtoms )->data[
alpha].Fb_alpha =
OOTWOPI * Fb_alpha;
int FUNC(COMPLEX8 *Fa, COMPLEX8 *Fb, FstatAtomVector **FstatAtoms, const SFTVector *sfts, const PulsarSpins fkdot, const SSBtimes *tSSB, const AMCoeffs *amcoe, const UINT4 Dterms)
FstatAtomVector * XLALCreateFstatAtomVector(const UINT4 length)
Create a FstatAtomVector of the given length.
static const REAL8 LAL_FACT_INV[]
REAL8 PulsarSpins[PULSAR_MAX_SPINS]
Typedef for fixed-size array holding GW frequency and derivatives fk = d^k Freq/dt^k|(tau_ref)
#define PULSAR_MAX_SPINS
maximal number of spin-parameters (Freq + spindowns) we can handle
int XLALSinCos2PiLUT(REAL4 *sin2pix, REAL4 *cos2pix, REAL8 x)
Calculate sin(2*pi*x) and cos(2*pi*x) to roughly 1e-7 precision using a lookup-table and Taylor-expan...
void XLALSinCosLUTInit(void)
#define XLAL_CHECK(assertion,...)
int XLALPrintError(const char *fmt,...) _LAL_GCC_PRINTF_FORMAT_(1
This structure contains the per-SFT (weighted) antenna-pattern functions , with the SFT-index,...
REAL4Vector * b
(weighted) per-SFT antenna-pattern function
REAL4Vector * a
(weighted) per-SFT antenna-pattern function
A vector of COMPLEX8FrequencySeries.
COMPLEX8FrequencySeries * data
Pointer to the data array.
UINT4 length
Number of elements in array.
A vector of -statistic 'atoms', i.e.
Simple container for two REAL8-vectors, namely the SSB-timings DeltaT_alpha and Tdot_alpha,...
REAL8Vector * Tdot
dT/dt : time-derivative of SSB-time wrt local time for SFT-alpha
REAL8Vector * DeltaT
Time-difference of SFT-alpha - tau0 in SSB-frame.