30 #include <lal/Factorial.h>
31 #include <lal/LogPrintf.h>
32 #include <lal/SinCosLUT.h>
48 typedef struct tagFstatTimingDemod {
55 "%%%% ----- Demod-specific F-statistic timing model -----\n"
56 "%%%% Nsft: (average) number of SFTs per detector\n"
57 "%%%% tau0_coreLD: timing coefficient for core Demod F-stat time\n"
58 "%%%% tau0_bufferLD: timing coefficient for computation of buffered quantities\n"
60 "%%%% Demod F-statistic timing model:\n"
61 "%%%% tauF_core = Nsft * tau0_coreLD\n"
62 "%%%% tauF_buffer = Nsft * tau0_bufferLD / NFbin\n"
69 int ( *computefafb_func )(
101 #ifdef HAVE_SSE_COMPILER
126 REAL8 Tau_buffer = 0;
127 REAL8 tic = 0, toc = 0;
145 if ( collectTiming ) {
159 BufferRecomputed = 0;
162 BufferRecomputed = 1;
182 if ( collectTiming ) {
184 Tau_buffer = ( toc - tic );
190 if ( thisPoint.
asini > 0 ) {
193 multiSSBTotal = multiBinary;
195 multiSSBTotal = multiSSB;
232 multiFstatAtoms->
data[X] = FstatAtoms;
235 XLAL_CHECK( isfinite( creal( FaX ) ) && isfinite( cimag( FaX ) ) && isfinite( creal( FbX ) ) && isfinite( cimag( FbX ) ),
XLAL_EFPOVRFLW );
248 REAL4 DdX_inv = 1.0 / multiAMcoef->
data[X]->
D;
299 if ( collectTiming ) {
301 REAL8 Tau_total = ( toc - tic );
314 REAL8 tauF_eff = Tau_total / NFbin;
315 REAL8 tauF_core = ( Tau_total - Tau_buffer ) / NFbin;
319 REAL8 tau0_coreLD = tauF_core / NsftPerDet;
323 #define updateAvgF(q) tiGen->q = ((tiGen->q *(tiGen->NCalls-1) + q)/(tiGen->NCalls))
329 #define updateAvgLD(q) tiLD->q = ((tiLD->q *(tiGen->NCalls-1) + q)/(tiGen->NCalls))
333 if ( BufferRecomputed ) {
334 REAL8 tau0_bufferLD = Tau_buffer / NsftPerDet;
335 REAL8 tauF_buffer = Tau_buffer / NFbin;
420 #ifdef HAVE_SSE_COMPILER
453 timingModel->
names[
i] =
"Nsft";
457 timingModel->
names[
i] =
"tau0_coreLD";
461 timingModel->
names[
i] =
"tau0_bufferLD";
486 memcpy( demod_slice, demod_input,
sizeof( *demod_input ) );
497 for (
UINT4 X = 0; X < numIFOs; X ++ ) {
500 if ( iStart[X] > iEnd[X] ) {
503 UINT4 sliceLength = iEnd[X] - iStart[X] + 1;
504 multiSFTs->data[X]->length = sliceLength;
532 if ( !method_data ) {
static REAL4 compute_fstat_from_fa_fb(COMPLEX8 Fa, COMPLEX8 Fb, REAL4 A, REAL4 B, REAL4 C, REAL4 E, REAL4 Dinv)
int XLALComputeFaFb_OptC(COMPLEX8 *Fa, COMPLEX8 *Fb, FstatAtomVector **FstatAtoms, const SFTVector *sfts, const PulsarSpins fkdot, const SSBtimes *tSSB, const AMCoeffs *amcoe, const UINT4 Dterms)
static void XLALDestroyDemodMethodData(void *method_data)
void * XLALFstatInputTimeslice_Demod(const void *method_data, const UINT4 iStart[PULSAR_MAX_DETECTORS], const UINT4 iEnd[PULSAR_MAX_DETECTORS])
int XLALComputeFaFb_Generic(COMPLEX8 *Fa, COMPLEX8 *Fb, FstatAtomVector **FstatAtoms, const SFTVector *sfts, const PulsarSpins fkdot, const SSBtimes *tSSB, const AMCoeffs *amcoe, const UINT4 Dterms)
static const char FstatTimingDemodHelp[]
int XLALSetupFstatDemod(void **method_data, FstatCommon *common, FstatMethodFuncs *funcs, MultiSFTVector *multiSFTs, const FstatOptionalArgs *optArgs)
int XLALGetFstatTiming_Demod(const void *method_data, FstatTimingGeneric *timingGeneric, FstatTimingModel *timingModel)
static int XLALComputeFstatDemod(FstatResults *Fstats, const FstatCommon *common, void *method_data)
void XLALDestroyFstatInputTimeslice_Demod(void *method_data)
Free all memory not needed by the orginal FstatInput structure.
FstatQuantities
Bit-field of -statistic quantities which can be computed by XLALComputeFstat().
void XLALDestroyMultiFstatAtomVector(MultiFstatAtomVector *multiAtoms)
Free all memory associated with a MultiFstatAtomVector structure.
@ FMETHOD_DEMOD_SSE
Demod: SSE hotloop with precalc divisors, uses fixed
@ FMETHOD_DEMOD_OPTC
Demod: gptimized C hotloop using Akos' algorithm, only works for
@ FMETHOD_DEMOD_GENERIC
Demod: generic C hotloop, works for any number of Dirichlet kernel terms
@ FMETHOD_DEMOD_ALTIVEC
Demod: Altivec hotloop variant, uses fixed
@ FSTATQ_2F
Compute multi-detector .
@ FSTATQ_FAFB_PER_DET
Compute and for each detector.
@ FSTATQ_FAFB
Compute multi-detector and .
@ 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.
void XLALDestroyMultiAMCoeffs(MultiAMCoeffs *multiAMcoef)
Destroy a MultiAMCoeffs structure.
MultiAMCoeffs * XLALComputeMultiAMCoeffs(const MultiDetectorStateSeries *multiDetStates, const MultiNoiseWeights *multiWeights, SkyPosition skypos)
Multi-IFO version of XLALComputeAMCoeffs().
void * XLALCalloc(size_t m, size_t n)
void * XLALMalloc(size_t n)
REAL8 XLALGetCPUTime(void)
#define PULSAR_MAX_DETECTORS
maximal number of detectors we can handle (for static arrays of detector quantities)
REAL8 PulsarSpins[PULSAR_MAX_SPINS]
Typedef for fixed-size array holding GW frequency and derivatives fk = d^k Freq/dt^k|(tau_ref)
void XLALDestroyMultiSFTVector(MultiSFTVector *multvect)
Destroy a multi SFT-vector.
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
#define XLAL_CHECK(assertion,...)
#define XLAL_CHECK_NULL(assertion,...)
REAL8 XLALGPSDiff(const LIGOTimeGPS *t1, const LIGOTimeGPS *t0)
This structure contains the per-SFT (weighted) antenna-pattern functions , with the SFT-index,...
REAL4 B
summed antenna-pattern matrix coefficient:
REAL4 A
summed antenna-pattern matrix coefficient:
REAL4 C
summed antenna-pattern matrix coefficient:
REAL4 Dd
determinant factor , such that
A vector of COMPLEX8FrequencySeries.
COMPLEX8FrequencySeries * data
Pointer to the data array.
UINT4 length
Number of elements in array.
MultiSSBtimes * prevMultiSSBtimes
FstatTimingGeneric timingGeneric
FstatTimingDemod timingDemod
MultiSFTVector * multiSFTs
MultiAMCoeffs * prevMultiAMcoef
int(* computefafb_func)(COMPLEX8 *, COMPLEX8 *, FstatAtomVector **, const SFTVector *, const PulsarSpins, const SSBtimes *, const AMCoeffs *, const UINT4 Dterms)
A vector of -statistic 'atoms', i.e.
MultiDetectorStateSeries * multiDetectorStates
MultiNoiseWeights * multiNoiseWeights
void(* workspace_destroy_func)(void *)
void(* method_data_destroy_func)(void *)
int(* compute_func)(FstatResults *, const FstatCommon *, void *)
Struct of optional 'advanced level' and (potentially method-specific) arguments to be passed to the ...
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.
FstatMethodType FstatMethod
Method to use for computing the -statistic.
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.
REAL8 dFreq
Spacing in frequency between each computed -statistic.
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]
PulsarDopplerParams doppler
Doppler parameters, including the starting frequency, at which the were computed.
MultiFstatAtomVector ** multiFatoms
If whatWasComputed & FSTATQ_ATOMS_PER_DET is true, the per-SFT -statistic multi-atoms computed at nu...
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...
REAL4 values[TIMING_MODEL_MAX_VARS]
const char * names[TIMING_MODEL_MAX_VARS]
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 time-series of DetectorStates.
UINT4 length
number of detectors
A multi-detector vector of FstatAtomVector.
FstatAtomVector ** data
Array of FstatAtomVector pointers, one for each detector X.
UINT4 length
Number of detectors.
One noise-weight (number) per SFT (therefore indexed over IFOs and SFTs.
UINT4 length
number of detectors
A collection of SFT vectors – one for each IFO in a multi-IFO search.
UINT4 length
number of ifos
SFTVector ** data
sftvector for each ifo
Multi-IFO container for SSB timings.
SSBtimes ** data
array of SSBtimes (pointers)
Type containing the 'Doppler-parameters' affecting the time-evolution of the phase.
PulsarSpins fkdot
Intrinsic spins: [Freq, f1dot, f2dot, ...
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 asini
Binary: projected, normalized orbital semi-major axis (s).
Simple container for two REAL8-vectors, namely the SSB-timings DeltaT_alpha and Tdot_alpha,...