28#include <cuda_runtime_api.h>
35#include <lal/Factorial.h>
36#include <lal/LFTandTSutils.h>
37#include <lal/LogPrintf.h>
38#include <lal/SinCosLUT.h>
39#include <lal/TimeSeries.h>
41#include <lal/Window.h>
56#define CUDA_BLOCK_SIZE 512
64#define XLAL_CHECK_CUDA_CALL(...) do { \
66 XLAL_CHECK ( ( retn = (__VA_ARGS__) ) == cudaSuccess, XLAL_EERR, "%s failed with return code %i", #__VA_ARGS__, retn ); \
68#define XLAL_CHECK_CUFFT_CALL(...) do { \
70 XLAL_CHECK ( ( retn = (__VA_ARGS__) ) == CUFFT_SUCCESS, XLAL_EERR, "%s failed with return code %i", #__VA_ARGS__, retn ); \
73#define CPLX_MULT(x, y) (crectf(crealf(x)*crealf(y) - cimagf(x)*cimagf(y), cimagf(x)*crealf(y) + crealf(x)*cimagf(y)))
78typedef struct tagResampCUDAWorkspace {
174 if ( vec->
data != NULL ) {
175 cudaFree( vec->
data );
185 if ( vec->
data != NULL ) {
186 cudaFree( vec->
data );
195 if ( series != NULL ) {
224 if ( *
dst == NULL ) {
227 ( *dst )->data->length = 0;
232 ( *dst )->data = dst_data;
234 if ( ( ( *dst )->data->data == NULL ) || ( ( *dst )->data->length <
src->data->length ) ) {
236 ( *dst )->data->length =
src->data->length;
246 if ( *
dst == NULL ) {
249 ( *dst )->length =
src->length;
251 for (
UINT4 X = 0; X <
src->length; X++ ) {
259 if ( multi != NULL ) {
260 if ( multi->
data != NULL ) {
300 cufftDestroy( resamp->
fftplan );
364 REAL8 TspanX = numSamples_DETX * dt_DET;
365 TspanXMax =
fmax( TspanXMax, TspanX );
367 UINT4 decimateFFT = (
UINT4 )ceil( TspanXMax / TspanFFT );
368 if ( decimateFFT > 1 ) {
369 XLALPrintWarning(
"WARNING: Frequency spacing larger than 1/Tspan, we'll internally decimate FFT frequency bins by a factor of %" LAL_UINT4_FORMAT "\n", decimateFFT );
371 TspanFFT *= decimateFFT;
374 UINT4 numSamplesFFT0 = (
UINT4 ) ceil( TspanFFT / dt_DET );
375 UINT4 numSamplesFFT = 0;
377 numSamplesFFT = (
UINT4 ) pow( 2, ceil( log2( (
double ) numSamplesFFT0 ) ) );
379 numSamplesFFT = (
UINT4 ) 2 * ceil( numSamplesFFT0 / 2 );
382 REAL8 dt_SRC = TspanFFT / numSamplesFFT;
400 UINT4 numSamplesMax_SRC = 0;
404 XLAL_CHECK( dt_DET == dt_DETX,
XLAL_EINVAL,
"Input timeseries must have identical 'deltaT(X=%d)' (%.16g != %.16g)\n", X, dt_DET, dt_DETX );
407 XLAL_CHECK( fabs( fHet - fHetX ) <
LAL_REAL8_EPS * fHet,
XLAL_EINVAL,
"Input timeseries must have identical heterodyning frequency 'f0(X=%d)' (%.16g != %.16g)\n", X, fHet, fHetX );
415 UINT4 numSamples_SRCX = (
UINT4 )ceil( numSamples_DETX * dt_DET / dt_SRC );
420 numSamplesMax_SRC =
MYMAX( numSamplesMax_SRC, numSamples_SRCX );
425 XLAL_CHECK( numSamplesFFT >= numSamplesMax_SRC,
XLAL_EFAILED,
"[numSamplesFFT = %d] < [numSamplesMax_SRC = %d]\n", numSamplesFFT, numSamplesMax_SRC );
486__global__
void CUDAAddToFaFb( cuComplex *Fa_k, cuComplex *Fb_k, cuComplex *FaX_k, cuComplex *FbX_k,
UINT4 numFreqBins )
488 int k = threadIdx.x + blockDim.x * blockIdx.x;
489 if (
k >= numFreqBins ) {
492 Fa_k[
k] = cuCaddf( Fa_k[
k], FaX_k[
k] );
493 Fb_k[
k] = cuCaddf( Fb_k[
k], FbX_k[
k] );
498 int k = threadIdx.x + blockDim.x * blockIdx.x;
499 if (
k >= numFreqBins ) {
502 cuComplex Fa = Fa_k[
k];
503 cuComplex Fb = Fb_k[
k];
504 REAL4 Fa_re = cuCrealf( Fa );
505 REAL4 Fa_im = cuCimagf( Fa );
506 REAL4 Fb_re = cuCrealf( Fb );
507 REAL4 Fb_im = cuCimagf( Fb );
511 twoF_k = 2.0f * Dinv * (
B * (
SQ( Fa_re ) +
SQ( Fa_im ) )
512 +
A * (
SQ( Fb_re ) +
SQ( Fb_im ) )
513 - 2.0 *
C * ( Fa_re * Fb_re + Fa_im * Fb_im )
514 - 2.0 * E * ( - Fa_re * Fb_im + Fa_im * Fb_re )
549 REAL8 ticStart = 0, tocEnd = 0;
550 REAL8 tic = 0, toc = 0;
551 if ( collectTiming ) {
571 if ( collectTiming ) {
619 if ( collectTiming ) {
621 Tau->Mem = ( toc - tic );
633 if ( collectTiming ) {
653 if ( collectTiming ) {
655 Tau->SumFabX += ( toc - tic );
671 cudaFree( twoF_gpu );
675 if ( collectTiming ) {
677 Tau->Fab2F += ( toc - tic );
688 if ( Fstats->
Fa_CUDA == NULL ) {
692 if ( Fstats->
Fb_CUDA == NULL ) {
700 if ( collectTiming ) {
726 if ( collectTiming ) {
728 Tau->Fab2F += ( toc - tic );
748 cudaFree( ws->
Fa_k );
749 cudaFree( ws->
Fb_k );
750 cudaFree( ws->
FaX_k );
751 cudaFree( ws->
FbX_k );
761 if ( collectTiming ) {
768 Tau->Total = ( tocEnd - ticStart );
776 REAL8 Tau_buffer = Tau->Bary;
779 REAL8 tauF_eff = Tau->Total / NFbin;
780 REAL8 tauF_core = ( Tau->Total - Tau_buffer ) / NFbin;
783 REAL8 tau0_Fbin = ( Tau->Copy + Tau->Norm + Tau->SumFabX + Tau->Fab2F ) / NFbin;
789#define updateAvgF(q) tiGen->q = ((tiGen->q *(tiGen->NCalls-1) + q)/(tiGen->NCalls))
795#define updateAvgRS(q) tiRS->q = ((tiRS->q *(tiGen->NCalls-1) + q)/(tiGen->NCalls))
801 if ( Tau->BufferRecomputed ) {
803 REAL8 tauF_buffer = Tau_buffer / NFbin;
822 int k = threadIdx.x + blockDim.x * blockIdx.x;
823 if (
k >= numFreqBins ) {
826 REAL8 f_k = FreqOut0 +
k * dFreq;
827 REAL8 cycles = - f_k * dtauX;
828 REAL8 sinphase, cosphase;
829 sincospi( 2 * cycles, &sinphase, &cosphase );
830 cuComplex normX_k = { (
float )( dt_SRC * cosphase ), (
float )( dt_SRC * sinphase ) };
832 Fa_out[
k] = cuCmulf( Fa_out[
k], normX_k );
833 Fb_out[
k] = cuCmulf( Fb_out[
k], normX_k );
838 int k = threadIdx.x + blockIdx.x * blockDim.x;
839 if (
k >= numFreqBins ) {
842 out[
k] = in[offset_bins +
k * decimateFFT];
855 XLAL_CHECK( ( resamp != NULL ) && ( ws != NULL ) && ( TimeSeries_SRC_a != NULL ) && ( TimeSeries_SRC_b != NULL ),
XLAL_EINVAL );
862 REAL8 fHet = TimeSeries_SRC_a->f0;
863 REAL8 dt_SRC = TimeSeries_SRC_a->deltaT;
866 REAL8 freqShift = remainder( FreqOut0 - fHet, dFreq );
868 XLAL_CHECK( FreqOut0 >= fMinFFT,
XLAL_EDOM,
"Lowest output frequency outside the available frequency band: [FreqOut0 = %.16g] < [fMinFFT = %.16g]\n", FreqOut0, fMinFFT );
869 UINT4 offset_bins = (
UINT4 ) lround( ( FreqOut0 - fMinFFT ) / dFreqFFT );
870 UINT4 maxOutputBin = offset_bins + ( numFreqBins - 1 ) * resamp->
decimateFFT;
871 XLAL_CHECK( maxOutputBin < resamp->numSamplesFFT,
XLAL_EDOM,
"Highest output frequency bin outside available band: [maxOutputBin = %d] >= [numSamplesFFT = %d]\n", maxOutputBin, resamp->
numSamplesFFT );
875 REAL8 tic = 0, toc = 0;
880 if ( collectTiming ) {
889 if ( collectTiming ) {
891 tiRS->
Tau.
Spin += ( toc - tic );
899 if ( collectTiming ) {
901 tiRS->
Tau.
FFT += ( toc - tic );
907 if ( collectTiming ) {
909 tiRS->
Tau.
Copy += ( toc - tic );
917 if ( collectTiming ) {
919 tiRS->
Tau.
Spin += ( toc - tic );
926 if ( collectTiming ) {
928 tiRS->
Tau.
FFT += ( toc - tic );
934 if ( collectTiming ) {
936 tiRS->
Tau.
Copy += ( toc - tic );
944 if ( collectTiming ) {
946 tiRS->
Tau.
Norm += ( toc - tic );
964 int j = threadIdx.x + blockIdx.x * blockDim.x;
965 if (
j >= numSamplesIn ) {
969 REAL8 Dtau_alpha_j = Dtau0 + taup_j;
970 REAL8 cycles = -freqShift * taup_j;
971 REAL8 Dtau_pow_kp1 = Dtau_alpha_j;
972 for (
UINT4 k = 1;
k <= s_max;
k++ ) {
973 Dtau_pow_kp1 *= Dtau_alpha_j;
976 REAL8 cosphase, sinphase;
977 sincospi( 2 * cycles, &sinphase, &cosphase );
978 cuComplex em2piphase = {(
float )cosphase, (
float )sinphase};
979 out[
j] = cuCmulf( in[
j], em2piphase );
996 while ( ( s_max > 0 ) && ( doppler->fkdot[s_max] == 0 ) ) {
1000 UINT4 numSamplesIn = xIn->data->length;
1014 int j = threadIdx.x + blockIdx.x * blockDim.x;
1015 if (
j >= numSamples ) {
1018 TS_b[
j] = cuCmulf( TS_a[
j], TStmp2[
j] );
1019 TS_a[
j] = cuCmulf( TS_a[
j], TStmp1[
j] );
1023 cuComplex *TStmp2_SRC_data,
1025 UINT4 iStart_SRC_al,
1037 int j = threadIdx.x + blockIdx.x * blockDim.x;
1038 if (
j >= numSamples ) {
1042 UINT4 iSRC_al_j = iStart_SRC_al +
j;
1046 REAL8 t_SRC = tStart_SRC_0 + iSRC_al_j * dt_SRC;
1047 REAL8 ti_DET_al_j = tMid_DET_al + ( t_SRC - tMid_SRC_al ) / Tdot_al;
1048 ti_DET_data [ iSRC_al_j ] = ti_DET_al_j;
1051 REAL8 tDiff = iSRC_al_j * dt_SRC + ( tStart_DET_0 - ti_DET_al_j );
1052 REAL8 cycles = fmod( fHet * tDiff, 1.0 );
1054 REAL8 cosphase, sinphase;
1055 sincospi( -2 * cycles, &sinphase, &cosphase );
1057 cuComplex ei2piphase = {(
float ) cosphase, (
float ) sinphase};
1061 cuComplex signum = {1.0f - 2 * ( iSRC_al_j % 2 ), 0};
1062 ei2piphase = cuCmulf( ei2piphase, signum );
1064 TStmp1_SRC_data[iSRC_al_j] = make_cuComplex( ei2piphase.x * a_al, ei2piphase.y * a_al );
1065 TStmp2_SRC_data[iSRC_al_j] = make_cuComplex( ei2piphase.x * b_al, ei2piphase.y * b_al );
1074 UINT4 numSamplesOut,
1079 int l = threadIdx.x + blockDim.x * blockIdx.x;
1080 if (
l >= numSamplesOut ) {
1086 if ( (
t < 0 ) || (
t > ( numSamplesIn - 1 ) *
dt ) ) {
1087 out[
l] = make_cuComplex( 0, 0 );
1091 REAL8 t_by_dt =
t * oodt;
1092 INT8 jstar = lround( t_by_dt );
1094 if ( fabs( t_by_dt - jstar ) < 2.0e-4 ) {
1099 INT4 jStart0 = jstar - Dterms;
1100 UINT4 jEnd0 = jstar + Dterms;
1102 UINT4 jEnd =
min( jEnd0, numSamplesIn - 1 );
1104 REAL4 delta_jStart = ( t_by_dt - jStart );
1105 REAL8 sin0 = sinpi( delta_jStart );
1107 REAL4 sin0oopi = sin0 * 1.0 / M_PI;
1109 cuComplex y_l = {0, 0};
1110 REAL8 delta_j = delta_jStart;
1111 for (
UINT8 j = jStart;
j <= jEnd;
j ++ ) {
1112 cuComplex Cj = {(
float )(
win[
j - jStart0] * sin0oopi / delta_j ), 0};
1114 y_l = cuCaddf( y_l, cuCmulf( Cj, in[
j] ) );
1116 sin0oopi = -sin0oopi;
1127 int i = threadIdx.x + blockDim.x * blockIdx.x;
1128 if (
i >= ( length + 1 ) / 2 ) {
1132 int length_reduced = length - 1;
1133 double Y = length_reduced > 0 ? ( 2 *
i - length_reduced ) / (
double ) length_reduced : 0;
1134 out[
i] = 0.08 + 0.92 * pow( cos( M_PI / 2 * Y ), 2 );
1135 out[length -
i - 1] = 0.08 + 0.92 * pow( cos( M_PI / 2 * Y ), 2 );
1155 UINT4 winLen = 2 * Dterms + 1;
1162 CUDASincInterp <<< ( numSamplesOut +
CUDA_BLOCK_SIZE - 1 ) /
CUDA_BLOCK_SIZE,
CUDA_BLOCK_SIZE >>> ( ( cuComplex * )( y_out->
data ), t_out->
data, ( cuComplex * )( ts_in->
data->
data ), win_gpu, Dterms, numSamplesIn, numSamplesOut, tmin,
dt, oodt );
1164 cudaFree( win_gpu );
1208 REAL8 tic = 0, toc = 0;
1212 if ( same_skypos && same_refTime && same_binary ) {
1219 if ( collectTiming ) {
1226 if ( !( same_skypos && same_refTime ) ) {
1248 if ( thisPoint->
asini > 0 ) {
1286 XLAL_CHECK( numSamples_DETX > 0,
XLAL_EINVAL,
"Input timeseries for detector X=%d has zero samples. Can't handle that!\n", X );
1289 XLAL_CHECK( fabs( fHet - fHetX ) <
LAL_REAL8_EPS * fHet,
XLAL_EINVAL,
"Input timeseries must have identical heterodyning frequency 'f0(X=%d)' (%.16g != %.16g)\n", X, fHet, fHetX );
1293 TimeSeries_SRCX_a->
f0 = fHet;
1294 TimeSeries_SRCX_b->
f0 = fHet;
1317 REAL8 tStart_SRC_al = tMid_SRC_al - 0.5 *
Tsft * Tdot_al;
1318 REAL8 tEnd_SRC_al = tMid_SRC_al + 0.5 *
Tsft * Tdot_al;
1321 REAL8 tMid_DET_al = tStart_DET_al + 0.5 *
Tsft;
1324 UINT4 iStart_SRC_al = lround( ( tStart_SRC_al - tStart_SRC_0 ) / dt_SRC );
1325 UINT4 iEnd_SRC_al = lround( ( tEnd_SRC_al - tStart_SRC_0 ) / dt_SRC );
1328 iStart_SRC_al =
MYMIN( iStart_SRC_al, numSamples_SRCX - 1 );
1329 iEnd_SRC_al =
MYMIN( iEnd_SRC_al, numSamples_SRCX - 1 );
1330 UINT4 numSamplesSFT_SRC_al = iEnd_SRC_al - iStart_SRC_al + 1;
1334 CUDAApplyHetAMSrc <<< ( numSamplesSFT_SRC_al +
CUDA_BLOCK_SIZE - 1 ) /
CUDA_BLOCK_SIZE,
CUDA_BLOCK_SIZE >>> ( ( cuComplex * )( ws->
TStmp1_SRC->
data ), ( cuComplex * )( ws->
TStmp2_SRC->
data ), ti_DET->
data, iStart_SRC_al, tStart_SRC_0, tStart_DET_0, dt_SRC, tMid_DET_al, tMid_SRC_al, Tdot_al, fHet, a_al, b_al, numSamplesSFT_SRC_al );
1344 ti_DET->
length = bak_length;
1352 if ( collectTiming ) {
1354 Tau->
Bary = ( toc - tic );
#define GPSSETREAL8(gps, r8)
static int XLALGetFstatTiming_Resamp_intern(const FstatTimingResamp *tiRS, FstatTimingModel *timingModel)
int SincInterp(COMPLEX8Vector *y_out, const REAL8Vector *t_out, const COMPLEX8TimeSeries *ts_in, UINT4 Dterms)
static int XLALComputeFstatResampCUDA(FstatResults *Fstats, const FstatCommon *common, void *method_data)
__global__ void CUDAApplySpindownAndFreqShift(cuComplex *out, cuComplex *in, PulsarDopplerParams doppler, REAL8 freqShift, REAL8 dt, REAL8 Dtau0, UINT4 s_max, UINT4 numSamplesIn)
__global__ void CUDACreateHammingWindow(REAL8 *out, UINT4 length)
static void XLALDestroyResampCUDAWorkspace(void *workspace)
static void DestroyMultiCOMPLEX8TimeSeriesCUDA(MultiCOMPLEX8TimeSeries *multi)
static void DestroyCOMPLEX8TimeSeriesCUDA(COMPLEX8TimeSeries *series)
__global__ void CUDAPopulateFaFbFromRaw(cuComplex *out, cuComplex *in, UINT4 numFreqBins, UINT4 offset_bins, UINT4 decimateFFT)
static int XLALComputeFaFb_ResampCUDA(ResampCUDAMethodData *resamp, ResampCUDAWorkspace *ws, const PulsarDopplerParams thisPoint, REAL8 dFreq, UINT4 numFreqBins, const COMPLEX8TimeSeries *TimeSeries_SRC_a, const COMPLEX8TimeSeries *TimeSeries_SRC_b)
__global__ void CUDASincInterp(cuComplex *out, REAL8 *t_out, cuComplex *in, REAL8 *win, UINT4 Dterms, UINT4 numSamplesIn, UINT4 numSamplesOut, REAL8 tmin, REAL8 dt, REAL8 oodt)
static int CopyCOMPLEX8TimeSeriesDtoH(COMPLEX8TimeSeries **dst, COMPLEX8TimeSeries *src)
static void DestroyCOMPLEX8VectorCUDA(COMPLEX8Vector *vec)
static COMPLEX8Vector * CreateCOMPLEX8VectorCUDA(UINT4 length)
__device__ __constant__ REAL8 lal_fact_inv[LAL_FACT_MAX]
int XLALExtractResampledTimeseries_ResampCUDA(MultiCOMPLEX8TimeSeries **multiTimeSeries_SRC_a, MultiCOMPLEX8TimeSeries **multiTimeSeries_SRC_b, void *method_data)
__global__ void CUDAComputeTwoF(REAL4 *twoF, cuComplex *Fa_k, cuComplex *Fb_k, REAL4 A, REAL4 B, REAL4 C, REAL4 E, REAL4 Dinv, UINT4 numFreqBins)
static int MoveCOMPLEX8TimeSeriesHtoD(COMPLEX8TimeSeries *series)
static REAL8Vector * CreateREAL8VectorCUDA(UINT4 length)
static int XLALBarycentricResampleMultiCOMPLEX8TimeSeriesCUDA(ResampCUDAMethodData *resamp, const PulsarDopplerParams *thisPoint, const FstatCommon *common)
Performs barycentric resampling on a multi-detector timeseries, updates resampling buffer with result...
__global__ void CUDAAddToFaFb(cuComplex *Fa_k, cuComplex *Fb_k, cuComplex *FaX_k, cuComplex *FbX_k, UINT4 numFreqBins)
static void DestroyREAL8VectorCUDA(REAL8Vector *vec)
int XLALSetupFstatResampCUDA(void **method_data, FstatCommon *common, FstatMethodFuncs *funcs, MultiSFTVector *multiSFTs, const FstatOptionalArgs *optArgs)
#define XLAL_CHECK_CUDA_CALL(...)
static int CopyMultiCOMPLEX8TimeSeriesDtoH(MultiCOMPLEX8TimeSeries **dst, MultiCOMPLEX8TimeSeries *src)
__global__ void CUDAApplyHetAMInterp(cuComplex *TS_a, cuComplex *TS_b, cuComplex *TStmp1, cuComplex *TStmp2, UINT4 numSamples)
int XLALGetFstatTiming_ResampCUDA(const void *method_data, FstatTimingGeneric *timingGeneric, FstatTimingModel *timingModel)
__global__ void CUDAApplyHetAMSrc(cuComplex *TStmp1_SRC_data, cuComplex *TStmp2_SRC_data, REAL8 *ti_DET_data, UINT4 iStart_SRC_al, REAL8 tStart_SRC_0, REAL8 tStart_DET_0, REAL8 dt_SRC, REAL8 tMid_DET_al, REAL8 tMid_SRC_al, REAL8 Tdot_al, REAL8 fHet, REAL4 a_al, REAL4 b_al, UINT4 numSamples)
static int MoveMultiCOMPLEX8TimeSeriesHtoD(MultiCOMPLEX8TimeSeries *multi)
#define XLAL_CHECK_CUFFT_CALL(...)
__global__ void CUDANormFaFb(cuComplex *Fa_out, cuComplex *Fb_out, REAL8 FreqOut0, REAL8 dFreq, REAL8 dtauX, REAL8 dt_SRC, UINT4 numFreqBins)
static int XLALApplySpindownAndFreqShiftCUDA(cuComplex *xOut, const COMPLEX8TimeSeries *xIn, const PulsarDopplerParams *doppler, REAL8 freqShift)
static void XLALDestroyResampCUDAMethodData(void *method_data)
FstatQuantities
Bit-field of -statistic quantities which can be computed by XLALComputeFstat().
@ FSTATQ_2F
Compute multi-detector .
@ FSTATQ_FAFB_PER_DET
Compute and for each detector.
@ FSTATQ_FAFB
Compute multi-detector and .
@ FSTATQ_NONE
Do not compute -statistic, still compute buffered quantities.
@ FSTATQ_2F_CUDA
Compute multi-detector , store results on CUDA GPU (CUDA implementation of Resamp only).
@ FSTATQ_ATOMS_PER_DET
Compute per-SFT -statistic atoms for each detector (Demod only).
@ FSTATQ_2F_PER_DET
Compute for each detector.
@ FSTATQ_FAFB_CUDA
Compute multi-detector and , store results on CUDA GPU (CUDA implementation of Resamp only).
static const REAL8 LAL_FACT_INV[]
void XLALDestroyMultiAMCoeffs(MultiAMCoeffs *multiAMcoef)
Destroy a MultiAMCoeffs structure.
MultiAMCoeffs * XLALComputeMultiAMCoeffs(const MultiDetectorStateSeries *multiDetStates, const MultiNoiseWeights *multiWeights, SkyPosition skypos)
Multi-IFO version of XLALComputeAMCoeffs().
#define XLAL_INIT_DECL(var,...)
void * XLALMalloc(size_t n)
void * XLALCalloc(size_t m, size_t n)
void * XLALRealloc(void *p, size_t n)
MultiCOMPLEX8TimeSeries * XLALMultiSFTVectorToCOMPLEX8TimeSeries(const MultiSFTVector *multisfts)
Turn the given multiSFTvector into multiple long COMPLEX8TimeSeries, properly dealing with gaps.
void XLALDestroyMultiCOMPLEX8TimeSeries(MultiCOMPLEX8TimeSeries *multiTimes)
Destroy a MultiCOMPLEX8TimeSeries structure.
REAL8 XLALGetCPUTime(void)
#define PULSAR_MAX_DETECTORS
maximal number of detectors we can handle (for static arrays of detector quantities)
#define PULSAR_MAX_SPINS
maximal number of spin-parameters (Freq + spindowns) we can handle
void XLALDestroyMultiSFTVector(MultiSFTVector *multvect)
Destroy a multi SFT-vector.
int XLALMultiSFTVectorResizeBand(MultiSFTVector *multiSFTs, REAL8 f0, REAL8 Band)
Resize the frequency-band of a given multi-SFT vector to [f0, f0+Band].
MultiSSBtimes * XLALGetMultiSSBtimes(const MultiDetectorStateSeries *multiDetStates, SkyPosition skypos, LIGOTimeGPS refTime, SSBprecision precision)
Multi-IFO version of XLALGetSSBtimes().
void XLALDestroyMultiSSBtimes(MultiSSBtimes *multiSSB)
Destroy a MultiSSBtimes structure.
int XLALAddMultiBinaryTimes(MultiSSBtimes **multiSSBOut, const MultiSSBtimes *multiSSBIn, const PulsarDopplerParams *Doppler)
Multi-IFO version of XLALAddBinaryTimes().
COORDINATESYSTEM_EQUATORIAL
COMPLEX8TimeSeries * XLALCreateCOMPLEX8TimeSeries(const CHAR *name, const LIGOTimeGPS *epoch, REAL8 f0, REAL8 deltaT, const LALUnit *sampleUnits, size_t length)
const LALUnit lalDimensionlessUnit
#define XLAL_CHECK(assertion,...)
int int XLALPrintWarning(const char *fmt,...) _LAL_GCC_PRINTF_FORMAT_(1
#define XLAL_CHECK_NULL(assertion,...)
REAL8 XLALGPSGetREAL8(const LIGOTimeGPS *epoch)
This structure contains the per-SFT (weighted) antenna-pattern functions , with the SFT-index,...
REAL4 B
summed antenna-pattern matrix coefficient:
REAL4Vector * b
(weighted) per-SFT antenna-pattern function
REAL4 A
summed antenna-pattern matrix coefficient:
REAL4 C
summed antenna-pattern matrix coefficient:
REAL4Vector * a
(weighted) per-SFT antenna-pattern function
Struct holding the "antenna-pattern" matrix , in terms of the multi-detector scalar product.
REAL4 Dd
determinant factor , such that
MultiDetectorStateSeries * multiDetectorStates
MultiLIGOTimeGPSVector * multiTimestamps
MultiNoiseWeights * multiNoiseWeights
int(* compute_func)(FstatResults *, const FstatCommon *, void *)
void(* workspace_destroy_func)(void *)
void(* method_data_destroy_func)(void *)
Struct of optional 'advanced level' and (potentially method-specific) arguments to be passed to the ...
BOOLEAN resampFFTPowerOf2
Resamp: round up FFT lengths to next power of 2; see FstatMethodType.
BOOLEAN collectTiming
a flag to turn on/off the collection of F-stat-method-specific timing-data
UINT4 Dterms
Number of Dirichlet kernel terms, used by some Demod methods; see FstatMethodType.
XLALComputeFstat() computed results structure.
AntennaPatternMatrix MmunuX[PULSAR_MAX_DETECTORS]
Per detector antenna pattern matrix , used in computing .
AntennaPatternMatrix Mmunu
Antenna pattern matrix , used in computing .
REAL4 * twoFPerDet[PULSAR_MAX_DETECTORS]
If whatWasComputed & FSTATQ_2F_PER_DET is true, the values computed at numFreqBins frequencies space...
FstatQuantities whatWasComputed
Bit-field of which -statistic quantities were computed.
REAL4 * twoF_CUDA
If whatWasComputed & FSTATQ_2F_CUDA is true, the multi-detector values as for twoF,...
COMPLEX8 * FaPerDet[PULSAR_MAX_DETECTORS]
If whatWasComputed & FSTATQ_PARTS_PER_DET is true, the and values computed at numFreqBins frequenci...
UINT4 numFreqBins
Number of frequencies at which the were computed.
REAL4 * twoF
If whatWasComputed & FSTATQ_2F is true, the multi-detector values computed at numFreqBins frequencie...
COMPLEX8 * Fa
If whatWasComputed & FSTATQ_PARTS is true, the multi-detector and computed at numFreqBins frequenci...
COMPLEX8 * FbPerDet[PULSAR_MAX_DETECTORS]
COMPLEX8 * Fa_CUDA
If whatWasComputed & FSTAT_FAFB_CUDA is true, the multi-detector and computed at numFreqBins freque...
PulsarDopplerParams doppler
Doppler parameters, including the starting frequency, at which the were computed.
Generic F-stat timing coefficients (times in seconds) [see https://dcc.ligo.org/LIGO-T1600531-v4 for ...
Struct to carry the -statistic method-specific timing model in terms of a list of variable names and...
A vector of 'timestamps' of type LIGOTimeGPS.
REAL8 deltaT
'length' of each timestamp (e.g.
LIGOTimeGPS * data
array of timestamps
UINT4 length
number of timestamps
Multi-IFO container for antenna-pattern coefficients and atenna-pattern matrix .
AMCoeffs ** data
noise-weighted AM-coeffs , and
AntennaPatternMatrix Mmunu
antenna-pattern matrix
Multi-IFO container for COMPLEX8 resampled timeseries.
COMPLEX8TimeSeries ** data
array of COMPLEX8TimeSeries (pointers)
UINT4 length
number of IFOs
LIGOTimeGPSVector ** data
timestamps vector for each ifo
A collection of SFT vectors – one for each IFO in a multi-IFO search.
Multi-IFO container for SSB timings.
SSBtimes ** data
array of SSBtimes (pointers)
Type containing the 'Doppler-parameters' affecting the time-evolution of the phase.
REAL8 period
Binary: orbital period (sec)
LIGOTimeGPS tp
Binary: time of observed periapsis passage (in SSB)
PulsarSpins fkdot
Intrinsic spins: [Freq, f1dot, f2dot, ... ] where fkdot = d^kFreq/dt^k.
REAL8 Delta
Sky position: DEC (latitude) in equatorial coords and radians.
LIGOTimeGPS refTime
Reference time of pulsar parameters (in SSB!)
REAL8 Alpha
Sky position: RA (longitude) in equatorial coords and radians.
REAL8 ecc
Binary: orbital eccentricity.
REAL8 asini
Binary: projected, normalized orbital semi-major axis (s).
REAL8 argp
Binary: argument of periapsis (radians)
MultiCOMPLEX8TimeSeries * hostCopy4ExtractTS_SRC_b
MultiAMCoeffs * multiAMcoef
FstatTimingResamp timingResamp
AntennaPatternMatrix MmunuX[PULSAR_MAX_DETECTORS]
PulsarDopplerParams prev_doppler
MultiCOMPLEX8TimeSeries * hostCopy4ExtractTS_SRC_a
AntennaPatternMatrix Mmunu
MultiSSBtimes * multiSSBtimes
MultiCOMPLEX8TimeSeries * multiTimeSeries_SRC_b
MultiCOMPLEX8TimeSeries * multiTimeSeries_SRC_a
FstatTimingGeneric timingGeneric
MultiCOMPLEX8TimeSeries * multiTimeSeries_DET
MultiSSBtimes * multiBinaryTimes
REAL8Vector * SRCtimes_DET
COMPLEX8Vector * TStmp2_SRC
COMPLEX8Vector * TStmp1_SRC
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.
LIGOTimeGPS refTime
reference-time 'tau0'