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

Tests for exported functions in UniversalDopplerMetric. More...

Prototypes

static int test_XLALComputeOrbitalDerivatives (void)
 Unit test function for XLALComputeOrbitalDerivatives() More...
 
static int test_XLALComputeDopplerMetrics (void)
 Unit test for metric functions XLALComputeDopplerPhaseMetric() and XLALComputeDopplerFstatMetric() More...
 
OldDopplerMetricXLALOldDopplerFstatMetric (const OldMetricType_t metricType, const DopplerMetricParams *metricParams, const EphemerisData *edat)
 The only purpose of this function is to serve as a backwards-comparison check for XLALDopplerFstatMetric(). More...
 
void XLALDestroyOldDopplerMetric (OldDopplerMetric *metric)
 Free a OldDopplerMetric structure. More...
 
int XLALAddOldDopplerMetric (OldDopplerMetric **metric1, const OldDopplerMetric *metric2)
 Add 'metric2' to 'metric1', by adding the matrixes and 'rho2', and adding error-estimates in quadrature. More...
 
int XLALScaleOldDopplerMetric (OldDopplerMetric *m, REAL8 scale)
 Scale all (existing) matrices, error-estimates and 'rho2' by 'scale'. More...
 
int main (void)
 MAIN function: calls a number of unit-tests. More...
 

Detailed Description

Tests for exported functions in UniversalDopplerMetric.

Author
Reinhard Prix

Definition in file UniversalDopplerMetricTest.c.

Go to the source code of this file.

Data Structures

struct  OldDopplerMetric
 

Macros

#define COPY_VECT(dst, src)   do { (dst)[0] = (src)[0]; (dst)[1] = (src)[1]; (dst)[2] = (src)[2]; } while(0)
 
#define NORM(v)   ( sqrt ( (v)[0]*(v)[0] + (v)[1]*(v)[1] + (v)[2]*(v)[2] ) )
 
#define DIV_VECT(dst, src, div)   do { (dst)[0] = (src)[0]/(div); (dst)[1] = (src)[1]/(div); (dst)[2] = (src)[2]/(div); } while(0)
 
#define SUB_VECT(dst, src)   do { (dst)[0] -= (src)[0]; (dst)[1] -= (src)[1]; (dst)[2] -= (src)[2]; } while(0)
 
#define MULT_VECT(v, lam)   do{ (v)[0] *= (lam); (v)[1] *= (lam); (v)[2] *= (lam); } while(0)
 

Enumerations

enum  OldMetricType_t {
  OLDMETRIC_TYPE_PHASE = 0 , OLDMETRIC_TYPE_FSTAT = 1 , OLDMETRIC_TYPE_ALL = 2 , OLDMETRIC_TYPE_LAST ,
  OLDMETRIC_TYPE_PHASE = 0 , OLDMETRIC_TYPE_FSTAT = 1 , OLDMETRIC_TYPE_ALL = 2 , OLDMETRIC_TYPE_LAST
}
 

Macro Definition Documentation

◆ COPY_VECT

#define COPY_VECT (   dst,
  src 
)    do { (dst)[0] = (src)[0]; (dst)[1] = (src)[1]; (dst)[2] = (src)[2]; } while(0)

Definition at line 51 of file UniversalDopplerMetricTest.c.

◆ NORM

#define NORM (   v)    ( sqrt ( (v)[0]*(v)[0] + (v)[1]*(v)[1] + (v)[2]*(v)[2] ) )

Definition at line 53 of file UniversalDopplerMetricTest.c.

◆ DIV_VECT

#define DIV_VECT (   dst,
  src,
  div 
)    do { (dst)[0] = (src)[0]/(div); (dst)[1] = (src)[1]/(div); (dst)[2] = (src)[2]/(div); } while(0)

Definition at line 55 of file UniversalDopplerMetricTest.c.

◆ SUB_VECT

#define SUB_VECT (   dst,
  src 
)    do { (dst)[0] -= (src)[0]; (dst)[1] -= (src)[1]; (dst)[2] -= (src)[2]; } while(0)

Definition at line 56 of file UniversalDopplerMetricTest.c.

◆ MULT_VECT

#define MULT_VECT (   v,
  lam 
)    do{ (v)[0] *= (lam); (v)[1] *= (lam); (v)[2] *= (lam); } while(0)

Definition at line 57 of file UniversalDopplerMetricTest.c.

Enumeration Type Documentation

◆ OldMetricType_t

Enumerator
OLDMETRIC_TYPE_PHASE 

compute phase metric only

OLDMETRIC_TYPE_FSTAT 

compute full F-metric only

OLDMETRIC_TYPE_ALL 

compute both F-metric and phase-metric

OLDMETRIC_TYPE_LAST 
OLDMETRIC_TYPE_PHASE 

compute phase metric only

OLDMETRIC_TYPE_FSTAT 

compute full F-metric only

OLDMETRIC_TYPE_ALL 

compute both F-metric and phase-metric

OLDMETRIC_TYPE_LAST 

Definition at line 63 of file UniversalDopplerMetricTest.c.

Function Documentation

◆ test_XLALComputeOrbitalDerivatives()

static int test_XLALComputeOrbitalDerivatives ( void  )
static

Unit test function for XLALComputeOrbitalDerivatives()

Definition at line 528 of file UniversalDopplerMetricTest.c.

◆ test_XLALComputeDopplerMetrics()

static int test_XLALComputeDopplerMetrics ( void  )
static

Unit test for metric functions XLALComputeDopplerPhaseMetric() and XLALComputeDopplerFstatMetric()

Initially modelled afer testMetricCodes.py script: Check metric codes 'getMetric' 'FstatMetric' and 'FstatMetric_v2' by comparing them against each other. Given that they represent 3 very different implementations of metric calculations, this provides a very powerful consistency test

Definition at line 132 of file UniversalDopplerMetricTest.c.

◆ XLALOldDopplerFstatMetric()

OldDopplerMetric * XLALOldDopplerFstatMetric ( const OldMetricType_t  metricType,
const DopplerMetricParams metricParams,
const EphemerisData edat 
)

The only purpose of this function is to serve as a backwards-comparison check for XLALDopplerFstatMetric().

This is why it has been moved into the test-directory

This is basically a wrapper of the 'main()' function from the old standalone 'lalapps_FstatMetric' code, providing an API compatible with XLALDopplerFstatMetric().

Parameters
metricTypetype of metric to compute
metricParamsinput parameters determining the metric calculation
edatephemeris data

Definition at line 187 of file old-FstatMetric.c.

◆ XLALDestroyOldDopplerMetric()

void XLALDestroyOldDopplerMetric ( OldDopplerMetric metric)

Free a OldDopplerMetric structure.

Definition at line 254 of file old-FstatMetric.c.

◆ XLALAddOldDopplerMetric()

int XLALAddOldDopplerMetric ( OldDopplerMetric **  metric1,
const OldDopplerMetric metric2 
)

Add 'metric2' to 'metric1', by adding the matrixes and 'rho2', and adding error-estimates in quadrature.

Note1: if the 'metric1 == NULL', then it is initialized to the values in 'metric2'. The elements are *copied and the result is allocated here.

Note2: the 'meta' field-information of 'metric2' is simply copied into the output, meta-info consistency is not checked.

Definition at line 299 of file old-FstatMetric.c.

◆ XLALScaleOldDopplerMetric()

int XLALScaleOldDopplerMetric ( OldDopplerMetric m,
REAL8  scale 
)

Scale all (existing) matrices, error-estimates and 'rho2' by 'scale'.

Definition at line 378 of file old-FstatMetric.c.

◆ main()

int main ( void  )

MAIN function: calls a number of unit-tests.

Definition at line 101 of file UniversalDopplerMetricTest.c.