20 #ifndef _COMPUTEFSTAT_H
21 #define _COMPUTEFSTAT_H
23 #include <lal/LALStdlib.h>
24 #include <lal/UserInputParse.h>
25 #include <lal/PulsarDataTypes.h>
26 #include <lal/LALComputeAM.h>
27 #include <lal/LALComputeAM.h>
28 #include <lal/SSBtimes.h>
29 #include <lal/CWMakeFakeData.h>
30 #include <lal/LFTandTSutils.h>
70 #define DEFAULT_MAX_MISMATCH_FROM_SFT_LENGTH 0.05
82 typedef struct tagFstatInputVector {
94 typedef enum tagFstatQuantities {
110 typedef enum tagFstatMethodType {
136 typedef struct tagFstatOptionalArgs {
161 typedef struct tagFstatAtom {
174 typedef struct tagFstatAtomVector {
186 typedef struct tagMultiFstatAtomVector {
198 SWIGLAL( IGNORE_MEMBERS( tagFstatResults, internalalloclen ) );
199 SWIGLAL( ARRAY_MULTIPLE_LENGTHS( tagFstatResults, numFreqBins, numDetectors ) );
201 typedef struct tagFstatResults {
291 UINT4 internalalloclen;
305 SWIGLAL( IMMUTABLE_MEMBERS( tagFstatTimingGeneric,
help ) );
307 typedef struct tagFstatTimingGeneric {
318 #define TIMING_MODEL_MAX_VARS 10
324 SWIGLAL( IMMUTABLE_MEMBERS( tagFstatTimingModel,
help ) );
326 typedef struct tagFstatTimingModel {
FstatAtomVector * XLALCreateFstatAtomVector(const UINT4 length)
Create a FstatAtomVector of the given length.
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.
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)
#define TIMING_MODEL_MAX_VARS
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.
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_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.
#define PULSAR_MAX_DETECTORS
maximal number of detectors we can handle (for static arrays of detector quantities)
SSBprecision
The precision in calculating the barycentric transformation.
Struct holding the "antenna-pattern" matrix , in terms of the multi-detector scalar product.
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 .
UINT4 timestamp
SFT GPS timestamp in seconds.
REAL4 ab_alpha
Antenna-pattern factor .
REAL4 a2_alpha
Antenna-pattern factor .
A vector of -statistic 'atoms', i.e.
UINT4 TAtom
Time-baseline of 'atoms', typically .
FstatAtom * data
Array of FstatAtom pointers of given length.
UINT4 length
Number of per-SFT 'atoms'.
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...
BOOLEAN resampFFTPowerOf2
Resamp: round up FFT lengths to next power of 2; see FstatMethodType.
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...
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.
SSBprecision SSBprec
Barycentric transformation precision.
XLALComputeFstat() computed results structure.
AntennaPatternMatrix Mmunu
Antenna pattern matrix , used in computing .
UINT4 numDetectors
Number of detectors over which the were computed.
FstatQuantities whatWasComputed
Bit-field of which -statistic quantities were computed.
REAL8 dFreq
Spacing in frequency between each computed -statistic.
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...
LIGOTimeGPS refTimePhase
For performance reasons the global phase of all returned 'Fa' and 'Fb' quantities (Fa,...
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...
Multi-IFO container for COMPLEX8 resampled timeseries.
Multi-IFO time-series of DetectorStates.
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'
A collection of (multi-IFO) LIGOTimeGPSVector time-stamps vectors.
array of detector-specific 'noise floors' (ie PSD values), assumed constant over the frequency-band o...
One noise-weight (number) per SFT (therefore indexed over IFOs and SFTs.
Type containing the 'Doppler-parameters' affecting the time-evolution of the phase.
Straightforward vector type of N PulsarParams structs.
An "SFT-catalogue": a vector of SFTdescriptors, as returned by XLALSFTdataFind()