26 #include <gsl/gsl_math.h>
30 #ifdef LALPULSAR_CUDA_ENABLED
32 #include <cuda_runtime_api.h>
35 #include <lal/LALString.h>
36 #include <lal/LALSIMD.h>
37 #include <lal/NormalizeSFTRngMed.h>
38 #include <lal/ExtrapolatePulsarSpins.h>
39 #include <lal/VectorMath.h>
67 #ifdef LALPULSAR_CUDA_ENABLED
94 .runningMedianWindow = 101,
96 .injectSources = NULL,
101 .resampFFTPowerOf2 = 1
105 "%%%% ----- Generic F-stat timing model (all times in seconds) [see https://dcc.ligo.org/LIGO-T1600531-v4 for details] -----\n"
106 "%%%% tauF_eff: effective total time per F-stat call to XLALComputeFstat() per detector per output frequency bin\n"
107 "%%%% tauF_core: core time per output frequency bin per detector, excluding time to compute the buffer\n"
108 "%%%% tauF_buffer: time per detector per frequency bin to re-compute all buffered quantities once\n"
109 "%%%% NFbin: (average over F-stat calls) number of F-stat output frequency bins\n"
110 "%%%% Ndet: number of detectors\n"
112 "%%%% => generic F-stat timing:\n"
113 "%%%% tauF_eff = tauF_core + b * tauF_buffer\n"
114 "%%%% where 'b' denotes the fraction of times per call to XLALComputeFstat() the buffer needed to be recomputed\n"
116 "%%%% NCalls: number of F-stat calls we average over\n"
117 "%%%% NBufferMisses: number of times the buffer needed to be recomputed\n"
118 "%%%% ==> b = NBufferMisses / NCalls\n"
119 "%%%% All timing numbers are averaged over repeated calls to XLALComputeFstat(for fixed-setup).\n"
164 const REAL8 binaryMaxAsini,
165 const REAL8 binaryMinPeriod,
179 const REAL8 Tsft_max_earth = sqrt( ( 6.0 * sqrt( 5.0 * mu_SFT ) ) / (
LAL_PI * earthAsini * maxFreq * earthOmega * earthOmega ) );
180 if ( binaryMaxAsini == 0 ) {
181 return Tsft_max_earth;
186 const REAL8 Tsft_max_binary = sqrt( ( 6.0 * sqrt( 5.0 * mu_SFT ) ) / (
LAL_PI * binaryMaxAsini * maxFreq * binaryMaxOmega * binaryMaxOmega ) );
189 const REAL8 Tsft_max = GSL_MIN( Tsft_max_earth, Tsft_max_binary );
205 const REAL8 binaryMaxAsini,
206 const REAL8 binaryMinPeriod,
207 const REAL8 allowedMismatch
214 if ( allowedMismatch > 0 ) {
215 mu_SFT = allowedMismatch;
220 XLAL_CHECK(
Tsft < Tsft_max,
XLAL_EINVAL,
"Length of input SFTs (%g s) must be less than %g s for CW signal with frequency = %g, binary asini = %g, period = %g to stay below mismatch of %g.",
Tsft, Tsft_max, maxFreq, binaryMaxAsini, binaryMinPeriod, mu_SFT );
240 if ( inputs->
length > 0 ) {
255 if ( inputs == NULL ) {
259 if ( inputs->
data ) {
285 if ( atoms->
length > 0 ) {
300 if ( atoms == NULL ) {
323 multiAtoms->
length = length;
326 if ( multiAtoms->
length > 0 ) {
341 if ( multiAtoms == NULL ) {
361 const REAL8 minCoverFreq,
362 const REAL8 maxCoverFreq,
374 "All 'locator' fields of SFTDescriptors in 'SFTcatalog' must be either NULL or !NULL." );
378 XLAL_CHECK_NULL( isfinite( minCoverFreq ) && ( minCoverFreq > 0 ) && isfinite( maxCoverFreq ) && ( maxCoverFreq > 0 ),
XLAL_EINVAL,
"Check failed: minCoverFreq=%f and maxCoverFreq=%f must be finite and positive!", minCoverFreq, maxCoverFreq );
379 XLAL_CHECK_NULL( maxCoverFreq > minCoverFreq,
XLAL_EINVAL,
"Check failed: maxCoverFreq>minCoverFreq (%f<=%f)!", maxCoverFreq, minCoverFreq );
385 if ( optionalArgs != NULL ) {
386 optArgs = *optionalArgs;
407 int extraBinsMethod = 0;
413 extraBinsMethod = optArgs.
Dterms;
419 extraBinsMethod = optArgs.
Dterms;
425 extraBinsMethod = optArgs.
Dterms;
431 extraBinsMethod = optArgs.
Dterms;
436 #ifdef LALPULSAR_CUDA_ENABLED
474 input->workspace_refcount = optArgs.
prevInput->workspace_refcount;
477 ++( *input->workspace_refcount );
478 XLALPrintInfo(
"%s: re-using workspace from 'optionalArgs.prevInput', reference count = %i\n",
__func__, *input->workspace_refcount );
489 ( *input->workspace_refcount ) = 1;
490 XLALPrintInfo(
"%s: allocating new workspace, reference count = %i\n",
__func__, *input->workspace_refcount );
510 input->singleFreqBin = ( dFreq == 0 );
511 common->
dFreq = input->singleFreqBin ? 1.0 /
Tspan : dFreq;
517 REAL8 minFreqMethod, maxFreqMethod;
523 const REAL8 extraFreqMethod = extraBinsMethod / input->Tsft;
524 minFreqMethod = minCoverFreq - extraFreqMethod;
525 maxFreqMethod = maxCoverFreq + extraFreqMethod;
527 const REAL8 extraFreqFull = extraBinsFull / input->Tsft;
528 input->minFreqFull = minCoverFreq - extraFreqFull;
529 input->maxFreqFull = maxCoverFreq + extraFreqFull;
561 if ( generateSFTs ) {
566 MFDparams.fMin = sft->
f0;
569 MFDparams.fMin = input->minFreqFull;
570 MFDparams.Band = input->maxFreqFull - input->minFreqFull;
574 MFDparams.randSeed = optArgs.
randSeed;
624 const REAL8 tOffset = 0.5 * input->Tsft;
661 *minFreqFull = input->minFreqFull;
662 *maxFreqFull = input->maxFreqFull;
693 return &input->common.detectors;
707 return input->common.multiTimestamps;
723 UINT4 numIFOs = input->common.multiNoiseWeights->length;
728 ret->
Sinv_Tsft = input->common.multiNoiseWeights->Sinv_Tsft;
729 REAL8 ooSinv_Tsft = 1.0 / input->common.multiNoiseWeights->Sinv_Tsft;
730 for (
UINT4 X = 0; X < numIFOs; X++ ) {
731 UINT4 length = input->common.multiNoiseWeights->data[X]->length;
734 XLAL_CHECK_NULL( input->common.multiNoiseWeights->isNotNormalized,
XLAL_EERR,
"BUG: noise weights stored in FstatInput must be unnormalized!\n" );
752 return input->common.multiDetectorStates;
763 const UINT4 numFreqBins,
773 XLAL_CHECK( !input->singleFreqBin || numFreqBins == 1,
XLAL_EINVAL,
"numFreqBins must be 1 if XLALCreateFstatInput() was passed zero dFreq" );
778 const REAL8 maxFreq = doppler->
fkdot[0] + input->common.dFreq * numFreqBins;
783 if ( ( *Fstats ) == NULL ) {
792 const BOOLEAN moreFreqBins = ( numFreqBins > ( *Fstats )->internalalloclen );
794 if ( moreFreqBins || moreDetectors ) {
796 if ( ( whatToCompute &
FSTATQ_2F ) && moreFreqBins ) {
797 ( *Fstats )->twoF =
XLALRealloc( ( *Fstats )->twoF, numFreqBins *
sizeof( ( *Fstats )->twoF[0] ) );
798 XLAL_CHECK( ( *Fstats )->twoF != NULL,
XLAL_EINVAL,
"Failed to (re)allocate (*Fstats)->twoF to length %u", numFreqBins );
800 #ifndef LALPULSAR_CUDA_ENABLED
805 if ( ( whatToCompute &
FSTATQ_FAFB ) && moreFreqBins ) {
806 ( *Fstats )->Fa =
XLALRealloc( ( *Fstats )->Fa, numFreqBins *
sizeof( ( *Fstats )->Fa[0] ) );
807 XLAL_CHECK( ( *Fstats )->Fa != NULL,
XLAL_EINVAL,
"Failed to (re)allocate (*Fstats)->Fa to length %u", numFreqBins );
808 ( *Fstats )->Fb =
XLALRealloc( ( *Fstats )->Fb, numFreqBins *
sizeof( ( *Fstats )->Fb[0] ) );
809 XLAL_CHECK( ( *Fstats )->Fb != NULL,
XLAL_EINVAL,
"Failed to (re)allocate (*Fstats)->Fb to length %u", numFreqBins );
813 if ( ( whatToCompute &
FSTATQ_2F_PER_DET ) && ( moreFreqBins || moreDetectors ) ) {
815 ( *Fstats )->twoFPerDet[X] =
XLALRealloc( ( *Fstats )->twoFPerDet[X], numFreqBins *
sizeof( ( *Fstats )->twoFPerDet[X][0] ) );
816 XLAL_CHECK( ( *Fstats )->twoFPerDet[X] != NULL,
XLAL_EINVAL,
"Failed to (re)allocate (*Fstats)->twoFPerDet[%u] to length %u", X, numFreqBins );
823 ( *Fstats )->FaPerDet[X] =
XLALRealloc( ( *Fstats )->FaPerDet[X], numFreqBins *
sizeof( ( *Fstats )->FaPerDet[X][0] ) );
824 XLAL_CHECK( ( *Fstats )->FaPerDet[X] != NULL,
XLAL_EINVAL,
"Failed to (re)allocate (*Fstats)->FaPerDet[%u] to length %u", X, numFreqBins );
825 ( *Fstats )->FbPerDet[X] =
XLALRealloc( ( *Fstats )->FbPerDet[X], numFreqBins *
sizeof( ( *Fstats )->FbPerDet[X][0] ) );
826 XLAL_CHECK( ( *Fstats )->FbPerDet[X] != NULL,
XLAL_EINVAL,
"Failed to (re)allocate (*Fstats)->FbPerDet[%u] to length %u", X, numFreqBins );
833 if ( ( *Fstats )->multiFatoms != NULL ) {
834 kPrev = ( *Fstats )->internalalloclen;
837 ( *Fstats )->multiFatoms =
XLALRealloc( ( *Fstats )->multiFatoms, numFreqBins *
sizeof( ( *Fstats )->multiFatoms[0] ) );
838 XLAL_CHECK( ( *Fstats )->multiFatoms != NULL,
XLAL_EINVAL,
"Failed to (re)allocate (*Fstats)->multiFatoms to length %u", numFreqBins );
840 for (
UINT4 k = kPrev;
k < numFreqBins; ++
k ) {
841 ( *Fstats )->multiFatoms[
k] = NULL;
847 ( *Fstats )->internalalloclen = numFreqBins;
860 ( *Fstats )->doppler = midDoppler;
861 ( *Fstats )->dFreq = input->singleFreqBin ? 0 : common->
dFreq;
862 ( *Fstats )->numFreqBins = numFreqBins;
868 ( *Fstats )->whatWasComputed = whatToCompute;
873 ( *Fstats )->doppler = ( *doppler );
875 ( *Fstats )->refTimePhase = midDoppler.
refTime;
888 if ( input == NULL ) {
891 if ( input->common.isTimeslice ) {
893 "Something is wrong: 'isTimeslice==TRUE' for non-LALDemod F-stat method '%s' is not supported!\n",
XLALGetFstatInputMethodName( input ) );
905 if ( --( *input->workspace_refcount ) == 0 ) {
906 XLALPrintInfo(
"%s: workspace reference count = %i, freeing workspace\n",
__func__, *input->workspace_refcount );
909 if ( input->common.workspace != NULL ) {
910 ( input->method_funcs.workspace_destroy_func )( input->common.workspace );
914 XLALFree( input->workspace_refcount );
920 if ( input->method_data != NULL ) {
922 ( input->method_funcs.method_data_destroy_func )( input->method_data );
937 if ( Fstats == NULL ) {
942 #ifdef LALPULSAR_CUDA_ENABLED
955 for (
UINT4 n = 0;
n < Fstats->internalalloclen; ++
n ) {
1001 XLAL_CHECK_REAL4( X >= -1,
XLAL_EDOM,
"Invalid detector number X=%d. Only nonnegative numbers, or -1 for multi-F, are allowed.", X );
1005 UINT4 Y, Ystart, Yend;
1008 Yend = multiFstatAtoms->
length - 1;
1015 REAL4 mmatrixA = 0.0, mmatrixB = 0.0, mmatrixC = 0.0;
1021 for ( Y = Ystart; Y <= Yend; Y++ ) {
1054 switch ( *method ) {
1111 #ifdef HAVE_SSE_COMPILER
1119 #ifdef LALPULSAR_CUDA_ENABLED
1138 XLAL_EINVAL,
"FstatMethodType = %i is invalid", method );
1149 static int firstCall = 1;
1196 switch ( input->method ) {
1208 #ifdef LALPULSAR_CUDA_ENABLED
1234 if ( printHeader ) {
1238 fprintf(
fp,
"%%%%%8s %10s %4s %10s %10s %11s %10s ",
"NCalls",
"NFbin",
"Ndet",
"tauF_eff",
"tauF_core",
"tauF_buffer",
"b" );
1241 for (
UINT4 i = 0;
i < tiModel.numVariables;
i ++ ) {
1248 fprintf(
fp,
"%10.0f %10d %4d %10.2e %10.2e %11.2e %10.2e ",
1249 tiGen.NCalls, tiGen.NFbin, tiGen.Ndet, tiGen.tauF_eff, tiGen.tauF_core, tiGen.tauF_buffer, tiGen.NBufferMisses / tiGen.NCalls );
1253 for (
UINT4 i = 0;
i < tiModel.numVariables;
i ++ ) {
1278 switch ( input->method ) {
1283 #ifdef LALPULSAR_CUDA_ENABLED
1309 const FstatInput *input,
1331 for (
UINT4 X = 0; X < numIFOs; X ++ ) {
1344 multiNoiseWeights->
length = numIFOs;
1349 multiDetectorStates->
length = numIFOs;
1356 UINT4 numSFTsSlice = 0;
1357 REAL8 sumWeightsSlice = 0;
1360 for (
UINT4 X = 0; X < numIFOs; X ++ ) {
1366 multiNoiseWeights->
data[X] = NULL;
1376 if ( iStart[X] > iEnd[X] ) {
1380 UINT4 sliceLength = iEnd[X] - iStart[X] + 1;
1395 multiNoiseWeights->
data[X]->
length = sliceLength;
1399 numSFTsSlice += sliceLength;
1405 multiDetectorStates->
data[X]->
length = sliceLength;
1414 XLALGPSAdd( &midTimeSlice, 0.5 * TspanSlice );
1417 multiNoiseWeights->
Sinv_Tsft = sumWeightsSlice / numSFTsSlice ;
1422 memcpy( ( *slice ), input,
sizeof( *input ) );
1424 ( *slice )->common.isTimeslice = ( 1 == 1 );
1425 ( *slice )->common.midTime = midTimeSlice;
1427 ( *slice )->common.multiDetectorStates = multiDetectorStates;
1428 ( *slice )->common.multiNoiseWeights = multiNoiseWeights;
static const char FstatTimingGenericHelp[]
static const char *const FstatMethodNames[FMETHOD_END]
static REAL4 compute_fstat_from_fa_fb(COMPLEX8 Fa, COMPLEX8 Fb, REAL4 A, REAL4 B, REAL4 C, REAL4 E, REAL4 Dinv)
#define __func__
log an I/O error, i.e.
int XLALCWMakeFakeMultiData(MultiSFTVector **multiSFTs, MultiREAL8TimeSeries **multiTseries, const PulsarParamsVector *injectionSources, const CWMFDataParams *dataParams, const EphemerisData *edat)
Generate fake 'CW' data, returned either as SFTVector or REAL4Timeseries or both, for given CW-signal...
void * XLALFstatInputTimeslice_Demod(const void *method_data, const UINT4 iStart[PULSAR_MAX_DETECTORS], const UINT4 iEnd[PULSAR_MAX_DETECTORS])
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)
void XLALDestroyFstatInputTimeslice_Demod(void *method_data)
Free all memory not needed by the orginal FstatInput structure.
int XLALExtractResampledTimeseries_ResampCUDA(MultiCOMPLEX8TimeSeries **multiTimeSeries_SRC_a, MultiCOMPLEX8TimeSeries **multiTimeSeries_SRC_b, void *method_data)
int XLALSetupFstatResampCUDA(void **method_data, FstatCommon *common, FstatMethodFuncs *funcs, MultiSFTVector *multiSFTs, const FstatOptionalArgs *optArgs)
int XLALGetFstatTiming_ResampCUDA(const void *method_data, FstatTimingGeneric *timingGeneric, FstatTimingModel *timingModel)
int XLALExtractResampledTimeseries_ResampGeneric(MultiCOMPLEX8TimeSeries **multiTimeSeries_SRC_a, MultiCOMPLEX8TimeSeries **multiTimeSeries_SRC_b, void *method_data)
int XLALGetFstatTiming_ResampGeneric(const void *method_data, FstatTimingGeneric *timingGeneric, FstatTimingModel *timingModel)
int XLALSetupFstatResampGeneric(void **method_data, FstatCommon *common, FstatMethodFuncs *funcs, MultiSFTVector *multiSFTs, const FstatOptionalArgs *optArgs)
FstatAtomVector * XLALCreateFstatAtomVector(const UINT4 length)
Create a FstatAtomVector of the given length.
static int XLALSelectBestFstatMethod(FstatMethodType *method)
If user asks for a 'best' FstatMethodType, find and select it.
const MultiLIGOTimeGPSVector * XLALGetFstatInputTimestamps(const FstatInput *input)
Returns the SFT timestamps stored in a FstatInput structure.
FstatMethodType
Different methods available to compute the -statistic, falling into two broad classes:
const MultiLALDetector * XLALGetFstatInputDetectors(const FstatInput *input)
Returns the detector information stored in a FstatInput structure.
static void XLALDestroyFstatInputTimeslice_common(FstatCommon *common)
const CHAR * XLALGetFstatInputMethodName(const FstatInput *input)
Returns the human-readable name of the -statistic method being used by a FstatInput structure.
const MultiDetectorStateSeries * XLALGetFstatInputDetectorStates(const FstatInput *input)
Returns the multi-detector state series stored in a FstatInput structure.
const FstatOptionalArgs FstatOptionalArgsDefaults
Global initializer for setting FstatOptionalArgs to default values.
int XLALFstatCheckSFTLengthMismatch(const REAL8 Tsft, const REAL8 maxFreq, const REAL8 binaryMaxAsini, const REAL8 binaryMinPeriod, const REAL8 allowedMismatch)
Check that the SFT length does not exceed the result of XLALFstatMaximumSFTLength(),...
const UserChoices * XLALFstatMethodChoices(void)
Return pointer to a static array of all (available) FstatMethodType choices.
void XLALDestroyFstatInputVector(FstatInputVector *inputs)
Free all memory associated with a FstatInputVector structure.
int XLALFstatInputTimeslice(FstatInput **slice, const FstatInput *input, const LIGOTimeGPS *minStartGPS, const LIGOTimeGPS *maxStartGPS)
Create and return an FstatInput 'timeslice' for given input FstatInput object [must be using LALDemod...
int XLALGetFstatInputSFTBand(const FstatInput *input, REAL8 *minFreqFull, REAL8 *maxFreqFull)
Returns the frequency band loaded from input SFTs.
MultiNoiseWeights * XLALGetFstatInputNoiseWeights(const FstatInput *input)
Returns the multi-detector noise weights stored in a FstatInput structure.
int XLALExtractResampledTimeseries(MultiCOMPLEX8TimeSeries **multiTimeSeries_SRC_a, MultiCOMPLEX8TimeSeries **multiTimeSeries_SRC_b, FstatInput *input)
Extracts the resampled timeseries from a given FstatInput structure (must have been initialized previ...
int XLALGetFstatTiming(const FstatInput *input, FstatTimingGeneric *timingGeneric, FstatTimingModel *timingModel)
Return measured values and details about generic F-statistic timing and method-specific timing model,...
REAL4 XLALComputeFstatFromAtoms(const MultiFstatAtomVector *multiFstatAtoms, const INT4 X)
Compute single-or multi-IFO Fstat '2F' from multi-IFO 'atoms'.
REAL8 XLALFstatMaximumSFTLength(const REAL8 maxFreq, const REAL8 binaryMaxAsini, const REAL8 binaryMinPeriod, const REAL8 mu_SFT)
Compute the maximum SFT length that can safely be used as input to XLALComputeFstat(),...
const CHAR * XLALFstatMethodName(FstatMethodType method)
Return pointer to a static string giving the name of the FstatMethodType method.
void XLALDestroyFstatInput(FstatInput *input)
Free all memory associated with a FstatInput structure.
int XLALAppendFstatTiming2File(const FstatInput *input, FILE *fp, BOOLEAN printHeader)
FstatInputVector * XLALCreateFstatInputVector(const UINT4 length)
Create a FstatInputVector of the given length, for example for setting up F-stat searches over severa...
REAL4 XLALComputeFstatFromFaFb(COMPLEX8 Fa, COMPLEX8 Fb, REAL4 A, REAL4 B, REAL4 C, REAL4 E, REAL4 Dinv)
Compute the -statistic from the complex and components and the antenna pattern matrix.
FstatQuantities
Bit-field of -statistic quantities which can be computed by XLALComputeFstat().
void XLALDestroyFstatAtomVector(FstatAtomVector *atoms)
Free all memory associated with a FstatAtomVector structure.
#define DEFAULT_MAX_MISMATCH_FROM_SFT_LENGTH
default maximum allowed F-stat mismatch from SFTs being too long, to be used in XLALFstatCheckSFTLeng...
void XLALDestroyMultiFstatAtomVector(MultiFstatAtomVector *multiAtoms)
Free all memory associated with a MultiFstatAtomVector structure.
FstatInput * XLALCreateFstatInput(const SFTCatalog *SFTcatalog, const REAL8 minCoverFreq, const REAL8 maxCoverFreq, const REAL8 dFreq, const EphemerisData *ephemerides, const FstatOptionalArgs *optionalArgs)
Create a fully-setup FstatInput structure for computing the -statistic using XLALComputeFstat().
int XLALComputeFstat(FstatResults **Fstats, FstatInput *input, const PulsarDopplerParams *doppler, const UINT4 numFreqBins, const FstatQuantities whatToCompute)
Compute the -statistic over a band of frequencies.
int XLALFstatMethodIsAvailable(FstatMethodType method)
Return true if given FstatMethodType corresponds to a valid and available Fstat method,...
MultiFstatAtomVector * XLALCreateMultiFstatAtomVector(const UINT4 length)
Create a MultiFstatAtomVector of the given length.
void XLALDestroyFstatResults(FstatResults *Fstats)
Free all memory associated with a FstatResults structure.
@ FMETHOD_RESAMP_GENERIC
Resamp: generic implementation
@ 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_BEST
Demod: best guess of the fastest available hotloop
@ FMETHOD_RESAMP_BEST
Resamp: best guess of the fastest available implementation
@ FMETHOD_DEMOD_GENERIC
Demod: generic C hotloop, works for any number of Dirichlet kernel terms
@ FMETHOD_RESAMP_CUDA
Resamp: CUDA resampling
@ 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_ATOMS_PER_DET
Compute per-SFT -statistic atoms for each detector (Demod only).
@ FSTATQ_2F_PER_DET
Compute for each detector.
#define LAL_GPS_PRINT(gps)
void XLALDestroyMultiDetectorStateSeries(MultiDetectorStateSeries *mdetStates)
Helper function to get rid of a multi-IFO DetectorStateSeries Note, this is "NULL-robust" in the sens...
int XLALMultiLALDetectorFromMultiSFTs(MultiLALDetector *multiIFO, const MultiSFTVector *multiSFTs)
Extract multi detector-info from a given multi SFTCatalog view.
MultiDetectorStateSeries * XLALGetMultiDetectorStates(const MultiLIGOTimeGPSVector *multiTS, const MultiLALDetector *multiIFO, const EphemerisData *edat, REAL8 tOffset)
Get the detector-time series for the given MultiLIGOTimeGPSVector.
int XLALMultiLALDetectorFromMultiSFTCatalogView(MultiLALDetector *multiIFO, const MultiSFTCatalogView *multiView)
Extract multi detector-info from a given multi SFTCatalog view.
REAL4 XLALComputeAntennaPatternSqrtDeterminant(REAL4 A, REAL4 B, REAL4 C, REAL4 E)
Compute (sqrt of) determinant of the antenna-pattern matrix Mmunu = [ A, C, 0, -E; C B E,...
#define XLAL_INIT_DECL(var,...)
void * XLALCalloc(size_t m, size_t n)
void * XLALRealloc(void *p, size_t n)
#define LAL_HAVE_SSE_RUNTIME()
MultiPSDVector * XLALNormalizeMultiSFTVect(MultiSFTVector *multsft, UINT4 blockSize, const MultiNoiseFloor *assumeSqrtSX)
Function for normalizing a multi vector of SFTs in a multi IFO search and returns the running-median ...
void XLALDestroyMultiPSDVector(MultiPSDVector *multvect)
Destroy a multi PSD-vector.
MultiNoiseWeights * XLALComputeMultiNoiseWeights(const MultiPSDVector *rngmed, UINT4 blocksRngMed, UINT4 excludePercentile)
Computes weight factors arising from MultiSFTs with different noise floors.
void XLALDestroyMultiNoiseWeights(MultiNoiseWeights *weights)
Destroy a MultiNoiseWeights object.
#define PULSAR_MAX_DETECTORS
maximal number of detectors we can handle (for static arrays of detector quantities)
MultiSFTVector * XLALLoadMultiSFTs(const SFTCatalog *inputCatalog, REAL8 fMin, REAL8 fMax)
Function to load a catalog of SFTs from possibly different detectors.
void XLALDestroyMultiSFTCatalogView(MultiSFTCatalogView *multiView)
Destroys a MultiSFTCatalogView, without freeing the original catalog that the 'view' was referring to...
void XLALDestroyMultiSFTVector(MultiSFTVector *multvect)
Destroy a multi SFT-vector.
MultiSFTCatalogView * XLALGetMultiSFTCatalogView(const SFTCatalog *catalog)
Return a MultiSFTCatalogView generated from an input SFTCatalog.
int XLALMultiSFTVectorResizeBand(MultiSFTVector *multiSFTs, REAL8 f0, REAL8 Band)
Resize the frequency-band of a given multi-SFT vector to [f0, f0+Band].
int XLALFindTimesliceBounds(UINT4 *iStart, UINT4 *iEnd, const LIGOTimeGPSVector *timestamps, const LIGOTimeGPS *minStartGPS, const LIGOTimeGPS *maxStartGPS)
MultiLIGOTimeGPSVector * XLALTimestampsFromMultiSFTCatalogView(const MultiSFTCatalogView *multiView)
Given a multi-SFTCatalogView, return a MultiLIGOTimeGPSVector holding the SFT timestamps.
MultiLIGOTimeGPSVector * XLALExtractMultiTimestampsFromSFTs(const MultiSFTVector *multiSFTs)
Given a multi-SFT vector, return a MultiLIGOTimeGPSVector holding the SFT timestamps.
int XLALMultiSFTVectorAdd(MultiSFTVector *a, const MultiSFTVector *b)
Adds SFT-data from MultiSFTvector 'b' to elements of MultiSFTVector 'a'.
void XLALDestroyMultiTimestamps(MultiLIGOTimeGPSVector *multiTS)
Destroy a MultiLIGOTimeGPSVector timestamps vector.
@ SSBPREC_RELATIVISTICOPT
optimized relativistic, numerically equivalent to SSBPREC_RELATIVISTIC, but faster
REAL8Vector * XLALCreateREAL8Vector(UINT4 length)
int XLALVectorScaleREAL8(REAL8 *out, REAL8 scalar, const REAL8 *in, const UINT4 len)
#define XLAL_ERROR_NULL(...)
int int int XLALPrintInfo(const char *fmt,...) _LAL_GCC_PRINTF_FORMAT_(1
#define XLAL_CHECK(assertion,...)
#define XLAL_CHECK_VOID(assertion,...)
#define XLAL_CHECK_REAL4(assertion,...)
#define XLAL_CHECK_REAL8(assertion,...)
#define XLAL_CHECK_NULL(assertion,...)
static _LAL_INLINE_ int XLALIsREAL8FailNaN(REAL8 val)
LIGOTimeGPS * XLALGPSAdd(LIGOTimeGPS *epoch, REAL8 dt)
int XLALGPSCmp(const LIGOTimeGPS *t0, const LIGOTimeGPS *t1)
REAL8 XLALGPSDiff(const LIGOTimeGPS *t1, const LIGOTimeGPS *t0)
Struct controlling all the aspects of the fake data (time-series + SFTs) to be produced by XLALCWMake...
REAL8 deltaT
timespan centered on each timestamp (e.g.
CoordinateSystem system
The coordinate system used for detector's position/velocity and detector-tensor.
DetectorState * data
array of DetectorState entries
UINT4 length
total number of entries
LALDetector detector
detector-info corresponding to this timeseries
This structure contains all information about the center-of-mass positions of the Earth and Sun,...
An -statistic 'atom', i.e.
REAL4 b2_alpha
Antenna-pattern factor .
REAL4 ab_alpha
Antenna-pattern factor .
REAL4 a2_alpha
Antenna-pattern factor .
A vector of -statistic 'atoms', i.e.
FstatAtom * data
Array of FstatAtom pointers of given length.
UINT4 length
Number of per-SFT 'atoms'.
MultiDetectorStateSeries * multiDetectorStates
const EphemerisData * ephemerides
REAL8 allowedMismatchFromSFTLength
MultiLALDetector detectors
MultiLIGOTimeGPSVector * multiTimestamps
MultiNoiseWeights * multiNoiseWeights
void(* workspace_destroy_func)(void *)
Struct of optional 'advanced level' and (potentially method-specific) arguments to be passed to the ...
UINT4 randSeed
Random-number seed value used in case of fake Gaussian noise generation (injectSqrtSX)
MultiNoiseFloor * injectSqrtSX
Single-sided PSD values for fake Gaussian noise to be added to SFT data.
PulsarParamsVector * injectSources
Vector of parameters of CW signals to simulate and inject.
UINT4 runningMedianWindow
If SFT noise weights are calculated from the SFTs, the running median window length to use.
MultiNoiseFloor * assumeSqrtSX
Single-sided PSD values to be used for computing SFT noise weights instead of from a running median o...
FstatInput * prevInput
An FstatInput structure from a previous call to XLALCreateFstatInput(); may contain common workspace ...
REAL8 allowedMismatchFromSFTLength
Optional override for XLALFstatCheckSFTLengthMismatch().
REAL8 sourceDeltaT
Optional source-frame sampling period for XLALCWMakeFakeData(); if zero, use the previous internal de...
UINT4 Dterms
Number of Dirichlet kernel terms, used by some Demod methods; see FstatMethodType.
FstatMethodType FstatMethod
Method to use for computing the -statistic.
SSBprecision SSBprec
Barycentric transformation precision.
XLALComputeFstat() computed results structure.
REAL4 * twoFPerDet[PULSAR_MAX_DETECTORS]
If whatWasComputed & FSTATQ_2F_PER_DET is true, the values computed at numFreqBins frequencies space...
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...
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]
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...
REAL8 deltaT
'length' of each timestamp (e.g.
LIGOTimeGPS * data
array of timestamps
Multi-IFO container for COMPLEX8 resampled timeseries.
Multi-IFO time-series of DetectorStates.
UINT4 length
number of detectors
DetectorStateSeries ** data
vector of pointers to DetectorStateSeries
A multi-detector vector of FstatAtomVector.
FstatAtomVector ** data
Array of FstatAtomVector pointers, one for each detector X.
UINT4 length
Number of detectors.
array of detectors definitions 'LALDetector'
UINT4 length
number of detectors
LALDetector sites[PULSAR_MAX_DETECTORS]
array of site information
A collection of (multi-IFO) LIGOTimeGPSVector time-stamps vectors.
UINT4 length
number of timestamps vectors or ifos
LIGOTimeGPSVector ** data
timestamps vector for each ifo
UINT4 length
number of detectors
One noise-weight (number) per SFT (therefore indexed over IFOs and SFTs.
REAL8 Sinv_Tsft
normalization factor used: (using single-sided PSD!)
UINT4 length
number of detectors
REAL8Vector ** data
weights-vector for each detector
BOOLEAN isNotNormalized
if true: weights are saved unnormalized (divide by Sinv_Tsft to get normalized version).
A collection of PSD vectors – one for each IFO in a multi-IFO search.
A multi-SFT-catalogue "view": a multi-IFO vector of SFT-catalogs.
A collection of SFT vectors – one for each IFO in a multi-IFO search.
Type containing the 'Doppler-parameters' affecting the time-evolution of the phase.
REAL8 period
Binary: orbital period (sec)
PulsarSpins fkdot
Intrinsic spins: [Freq, f1dot, f2dot, ...
LIGOTimeGPS refTime
Reference time of pulsar parameters (in SSB!)
REAL8 asini
Binary: projected, normalized orbital semi-major axis (s).
PulsarParams * data
array of pulsar-signal parameters
UINT4 length
number of pulsar-signals
An "SFT-catalogue": a vector of SFTdescriptors, as returned by XLALSFTdataFind()
SFTDescriptor * data
array of data-entries describing matched SFTs
UINT4 length
number of SFTs in catalog
SFTtype header
SFT-header info.
struct tagSFTLocator * locator
internal description of where to find this SFT [opaque!]