Loading [MathJax]/extensions/TeX/AMSsymbols.js
LALPulsar 7.1.1.1-b246709
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
LFTandTSutilsTest.c File Reference

Unit tests for LFTandTSutils module. More...

Prototypes

int main (void)
 MAIN function. More...
 
int test_XLALSFTVectorToLFT (void)
 Unit-Test for function XLALSFTVectorToLFT(). More...
 
int test_XLALSincInterpolateCOMPLEX8TimeSeries (void)
 
int test_XLALSincInterpolateSFT (void)
 
int XLALgenerateRandomData (REAL4TimeSeries **ts, SFTVector **sfts)
 function to generate random time-series with gaps, and corresponding SFTs More...
 
int write_SFTdata (const char *fname, const SFTtype *sft)
 
int XLALCompareSFTs (const SFTtype *sft1, const SFTtype *sft2, const VectorComparison *tol)
 
static COMPLEX8 testSignal (REAL8 t, REAL8 sigmaN)
 
int extractBandFromSFT (SFTtype **outSFT, const SFTtype *inSFT, REAL8 fMin, REAL8 Band)
 
SFTVectorextractBandFromSFTVector (const SFTVector *inSFTs, REAL8 fMin, REAL8 Band)
 
REAL8 TSFTfromDFreq (REAL8 dFreq)
 

Detailed Description

Unit tests for LFTandTSutils module.

Author
R. Prix

Definition in file LFTandTSutilsTest.c.

Go to the source code of this file.

Macros

#define MYMAX(x, y)   ( (x) > (y) ? (x) : (y) )
 
#define MYMIN(x, y)   ( (x) < (y) ? (x) : (y) )
 
#define RELERR(x, y)   ( ( (x) - (y) ) / ( 0.5 * (fabs(x) + fabs(y)) + 2) )
 

Variables

static LALUnit emptyLALUnit
 

Macro Definition Documentation

◆ MYMAX

#define MYMAX (   x,
  y 
)    ( (x) > (y) ? (x) : (y) )

Definition at line 57 of file LFTandTSutilsTest.c.

◆ MYMIN

#define MYMIN (   x,
  y 
)    ( (x) < (y) ? (x) : (y) )

Definition at line 58 of file LFTandTSutilsTest.c.

◆ RELERR

#define RELERR (   x,
  y 
)    ( ( (x) - (y) ) / ( 0.5 * (fabs(x) + fabs(y)) + 2) )

Definition at line 59 of file LFTandTSutilsTest.c.

Function Documentation

◆ main()

int main ( void  )

MAIN function.

Definition at line 91 of file LFTandTSutilsTest.c.

◆ test_XLALSFTVectorToLFT()

int test_XLALSFTVectorToLFT ( void  )

Unit-Test for function XLALSFTVectorToLFT().

Generates random data (timeseries + corresponding SFTs), then feeds the SFTs into XLALSFTVectorToLFT() and checks correctness of output Fourier transform by comparing to FT of original real-valued timeseries.

Note
This indirectly also checks XLALSFTVectorToCOMPLEX8TimeSeries() which is used by XLALSFTVectorToLFT().

returns XLAL_SUCCESS on success, XLAL-error otherwise

Definition at line 119 of file LFTandTSutilsTest.c.

◆ test_XLALSincInterpolateCOMPLEX8TimeSeries()

int test_XLALSincInterpolateCOMPLEX8TimeSeries ( void  )

Definition at line 205 of file LFTandTSutilsTest.c.

◆ test_XLALSincInterpolateSFT()

int test_XLALSincInterpolateSFT ( void  )

Definition at line 280 of file LFTandTSutilsTest.c.

◆ XLALgenerateRandomData()

int XLALgenerateRandomData ( REAL4TimeSeries **  ts,
SFTVector **  sfts 
)

function to generate random time-series with gaps, and corresponding SFTs

Definition at line 392 of file LFTandTSutilsTest.c.

◆ write_SFTdata()

int write_SFTdata ( const char fname,
const SFTtype sft 
)

Definition at line 516 of file LFTandTSutilsTest.c.

◆ XLALCompareSFTs()

int XLALCompareSFTs ( const SFTtype sft1,
const SFTtype sft2,
const VectorComparison tol 
)

Definition at line 466 of file LFTandTSutilsTest.c.

◆ testSignal()

static COMPLEX8 testSignal ( REAL8  t,
REAL8  sigmaN 
)
static

Definition at line 493 of file LFTandTSutilsTest.c.

◆ extractBandFromSFT()

int extractBandFromSFT ( SFTtype **  outSFT,
const SFTtype inSFT,
REAL8  fMin,
REAL8  Band 
)
Parameters
[out]outSFToutput SFT (alloc'ed or re-alloced as required)
[in]inSFTinput SFT
[in]fMinlower end of frequency interval to return
[in]Bandband width of frequency interval to return

Definition at line 567 of file LFTandTSutilsTest.c.

◆ extractBandFromSFTVector()

SFTVector * extractBandFromSFTVector ( const SFTVector inSFTs,
REAL8  fMin,
REAL8  Band 
)
Parameters
[in]inSFTsinput SFTs
[in]fMinlower end of frequency interval to return
[in]Bandband width of frequency interval to return

Definition at line 538 of file LFTandTSutilsTest.c.

Variable Documentation

◆ emptyLALUnit

LALUnit emptyLALUnit
static

Definition at line 64 of file LFTandTSutilsTest.c.