LAL  7.5.0.1-89842e6
DetResponseTest.c File Reference

Prototypes

static void PrintLALDetector (const LALDetector *detector)
 
static void PrintDetResponse (const LALDetAMResponse *const response, const char *const title)
 
static BOOLEAN almost_equal_real4_p (REAL4 a, REAL4 b, REAL4 tolerance)
 
static BOOLEAN almost_equal_real8_p (REAL8 a, REAL8 b, REAL8 tolerance)
 
static BOOLEAN almost_equal_real4_relative_p (REAL4 computed, REAL4 expected, REAL4 tolerance)
 
static BOOLEAN matrix_ok_p (LALDR_33Matrix *computed, LALDR_33Matrix *expected, REAL8 tolerance)
 
static BOOLEAN vector_ok_p (LALDR_3Vector *computed, LALDR_3Vector *expected, REAL8 tolerance)
 
static BOOLEAN vector_relative_ok_p (LALDR_3Vector *computed, const LALDR_3Vector *expected, REAL8 tolerance)
 
static void print_m_results_maybe (const char *title, LALDR_33Matrix *computed, LALDR_33Matrix *expected)
 
static void print_v_results_maybe (const char *title, LALDR_3Vector *computed, LALDR_3Vector *expected)
 
static void print_s_results_maybe (const char *title, REAL8 computed, REAL8 expected)
 
static int print_separator_maybe (void)
 
static int print_small_separator_maybe (void)
 
static int print_passed_maybe (void)
 
static BOOLEAN detresponse_ok_p (LALStatus *status, LALDetAndSource *det_and_src, LIGOTimeGPS *gps, LALDetAMResponse *expected_resp, REAL4 tolerance)
 
static void handle_detresponse_test (BOOLEAN passed_p, int line)
 
static BOOLEAN frdetector_ok_p (LALFrDetector *computed, const LALFrDetector *expected)
 
static BOOLEAN detector_ok_p (LALDetector *computed, const LALDetector *expected)
 
static REAL8 deg_to_rad (REAL8 degrees)
 
static REAL8 rad_to_deg (REAL8 radians)
 
static void LALDR_Set3Vector (LALDR_3Vector *v, REAL8 v1, REAL8 v2, REAL8 v3)
 
static void LALDR_CrossProd3Vector (LALDR_3Vector *result, LALDR_3Vector *a, LALDR_3Vector *b)
 
static REAL8 LALDR_DotProd3Vector (LALDR_3Vector *a, LALDR_3Vector *b)
 
static void LALDR_OuterProd3Vector (LALDR_33Matrix *a, LALDR_3Vector *u, LALDR_3Vector *v)
 
static REAL8 LALDR_DotProd33Matrix (LALDR_33Matrix *a, LALDR_33Matrix *b)
 
static void LALDR_Set33Matrix (LALDR_33Matrix *matrix, REAL8 a11, REAL8 a12, REAL8 a13, REAL8 a21, REAL8 a22, REAL8 a23, REAL8 a31, REAL8 a32, REAL8 a33)
 
static void LALDR_Zero33Matrix (LALDR_33Matrix *matrix)
 
static void LALDR_Multiply33Matrix (LALDR_33Matrix *product, LALDR_33Matrix *matrixL, LALDR_33Matrix *matrixR)
 
static void LALDR_ScalarMult33Matrix (LALDR_33Matrix *result, REAL8 coefficient, LALDR_33Matrix *matrix)
 
static void LALDR_Add33Matrix (LALDR_33Matrix *result, LALDR_33Matrix *matrix1, LALDR_33Matrix *matrix2)
 
static void LALDR_Transpose33Matrix (LALDR_33Matrix *transpose, LALDR_33Matrix *matrix)
 
static void LALDR_Print33Matrix (LALDR_33Matrix *matrix, const CHAR *varname, UINT4 format, FILE *file, const CHAR *graph_title)
 
static void LALDR_Print3Vector (LALDR_3Vector *vector, const CHAR *varname, FILE *file)
 
REAL4 skygrid_avg (const skygrid_t response)
 
void skygrid_square (skygrid_t square, const skygrid_t input)
 
REAL4 skygrid_rms (const skygrid_t input)
 
void skygrid_sqrt (skygrid_t result, const skygrid_t input)
 
INT4 skygrid_copy (skygrid_t dest, const skygrid_t src)
 
void skygrid_print (const char *comments, const skygrid_t input, const char *filename)
 
void skygrid_fabs (skygrid_t absgrid, const skygrid_t input)
 
void skygrid_add (skygrid_t sum, const skygrid_t a, const skygrid_t b)
 
void skygrid_subtract (skygrid_t sum, const skygrid_t a, const skygrid_t b)
 
void skygrid_scalar_mult (skygrid_t result, const skygrid_t a, REAL4 b)
 
void setup_global_detectors (void)
 
void set_source_params (LALSource *source, const char *name, REAL8 ra_rad, REAL8 dec_rad, REAL8 orien_rad)
 
void print_source_maybe (const LALSource *source)
 
void setup_global_sources (void)
 
void crab_pulsar_test (LALStatus *status)
 
void find_zero_gmst (void)
 
REAL4 resp_local (REAL8 psi, REAL8 theta, REAL8 phi, GWPolarization pol)
 
FILE * xfopen (const char *path, const char *mode)
 
int xfclose (FILE *stream)
 
char * laldr_strlcpy (char *dst, const char *src, size_t len)
 
void fudge_factor_test (LALStatus *status)
 
BOOLEAN passed_special_locations_tests_p (LALStatus *status)
 
BOOLEAN passed_almost_equal_tests_p (void)
 
BOOLEAN passed_matrix_test_p (void)
 
int main (int argc, char *argv[])
 
BOOLEAN passed_special_locations_tests_p (LALStatus UNUSED *status)
 

Go to the source code of this file.

Macros

#define FALSE   0
 
#define TRUE   1
 
#define LALDR_MATRIXSIZE   3
 
#define TESTDR_MIN(a, b)   (((a) < (b)) ? (a) : (b))
 
#define NUM_DEC   21
 
#define NUM_RA   24
 

Typedefs

typedef REAL8 LALDR_3Vector[3]
 
typedef REAL8 LALDR_33Matrix[3][3]
 
typedef REAL4 skygrid_t[NUM_RA *NUM_DEC]
 

Enumerations

enum  LALDR_Axis_t { xAxis = 1 , yAxis = 2 , zAxis = 3 }
 
enum  GWPolarization { gwpol_scalar = 0 , gwpol_plus = 1 , gwpol_cross = 2 }
 

Variables

const INT4 lim = NUM_RA * NUM_DEC
 
const INT4 declim = (NUM_DEC-1)/2
 
BOOLEAN verbose_p = FALSE
 
int verbose_level = 0
 
const INT4 oneBillion = 1000000000
 
const REAL8 zero_tolerance = 0.
 
REAL8 real8_tolerance = (REAL8)2.*LAL_REAL8_EPS
 
REAL4 real4_tolerance = (REAL4)2.*LAL_REAL4_EPS
 
LALDetector det_north_pole
 
LALDetector det_south_pole
 
LALDetector det_green_equator
 
LALDetector det_green_tropic_of_cancer
 
LALDetector det_foo_tropic_of_cancer
 
LALSource src_0_0_p
 
LALSource src_0_0_c
 
LALSource src_0_90_p
 
LALSource src_0_90_c
 
LALSource src_0_45_p
 
LALSource src_0_45_c
 

Macro Definition Documentation

◆ FALSE

#define FALSE   0

Definition at line 50 of file DetResponseTest.c.

◆ TRUE

#define TRUE   1

Definition at line 51 of file DetResponseTest.c.

◆ LALDR_MATRIXSIZE

#define LALDR_MATRIXSIZE   3

Definition at line 52 of file DetResponseTest.c.

◆ TESTDR_MIN

#define TESTDR_MIN (   a,
 
)    (((a) < (b)) ? (a) : (b))

Definition at line 54 of file DetResponseTest.c.

◆ NUM_DEC

#define NUM_DEC   21

Definition at line 57 of file DetResponseTest.c.

◆ NUM_RA

#define NUM_RA   24

Definition at line 58 of file DetResponseTest.c.

Typedef Documentation

◆ LALDR_3Vector

typedef REAL8 LALDR_3Vector[3]

Definition at line 63 of file DetResponseTest.c.

◆ LALDR_33Matrix

typedef REAL8 LALDR_33Matrix[3][3]

Definition at line 64 of file DetResponseTest.c.

◆ skygrid_t

typedef REAL4 skygrid_t[NUM_RA *NUM_DEC]

Definition at line 66 of file DetResponseTest.c.

Enumeration Type Documentation

◆ LALDR_Axis_t

Enumerator
xAxis 
yAxis 
zAxis 

Definition at line 178 of file DetResponseTest.c.

◆ GWPolarization

Enumerator
gwpol_scalar 
gwpol_plus 
gwpol_cross 

Definition at line 668 of file DetResponseTest.c.

Function Documentation

◆ PrintLALDetector()

static void PrintLALDetector ( const LALDetector detector)
static

Definition at line 1821 of file DetResponseTest.c.

◆ PrintDetResponse()

static void PrintDetResponse ( const LALDetAMResponse *const  response,
const char *const  title 
)
static

Definition at line 2206 of file DetResponseTest.c.

◆ almost_equal_real4_p()

static BOOLEAN almost_equal_real4_p ( REAL4  a,
REAL4  b,
REAL4  tolerance 
)
static

Definition at line 2052 of file DetResponseTest.c.

◆ almost_equal_real8_p()

static BOOLEAN almost_equal_real8_p ( REAL8  a,
REAL8  b,
REAL8  tolerance 
)
static

Definition at line 2069 of file DetResponseTest.c.

◆ almost_equal_real4_relative_p()

static BOOLEAN almost_equal_real4_relative_p ( REAL4  computed,
REAL4  expected,
REAL4  tolerance 
)
static

Definition at line 2079 of file DetResponseTest.c.

◆ matrix_ok_p()

static BOOLEAN matrix_ok_p ( LALDR_33Matrix computed,
LALDR_33Matrix expected,
REAL8  tolerance 
)
static

Definition at line 1864 of file DetResponseTest.c.

◆ vector_ok_p()

static BOOLEAN vector_ok_p ( LALDR_3Vector computed,
LALDR_3Vector expected,
REAL8  tolerance 
)
static

Definition at line 1901 of file DetResponseTest.c.

◆ vector_relative_ok_p()

static BOOLEAN vector_relative_ok_p ( LALDR_3Vector computed,
const LALDR_3Vector expected,
REAL8  tolerance 
)
static

Definition at line 1934 of file DetResponseTest.c.

◆ print_m_results_maybe()

static void print_m_results_maybe ( const char *  title,
LALDR_33Matrix computed,
LALDR_33Matrix expected 
)
static

Definition at line 1963 of file DetResponseTest.c.

◆ print_v_results_maybe()

static void print_v_results_maybe ( const char *  title,
LALDR_3Vector computed,
LALDR_3Vector expected 
)
static

Definition at line 1983 of file DetResponseTest.c.

◆ print_s_results_maybe()

static void print_s_results_maybe ( const char *  title,
REAL8  computed,
REAL8  expected 
)
static

Definition at line 2002 of file DetResponseTest.c.

◆ print_separator_maybe()

static int print_separator_maybe ( void  )
static

Definition at line 2022 of file DetResponseTest.c.

◆ print_small_separator_maybe()

static int print_small_separator_maybe ( void  )
static

Definition at line 2032 of file DetResponseTest.c.

◆ print_passed_maybe()

static int print_passed_maybe ( void  )
static

Definition at line 2042 of file DetResponseTest.c.

◆ detresponse_ok_p()

static BOOLEAN detresponse_ok_p ( LALStatus status,
LALDetAndSource det_and_src,
LIGOTimeGPS gps,
LALDetAMResponse expected_resp,
REAL4  tolerance 
)
static

Definition at line 2100 of file DetResponseTest.c.

◆ handle_detresponse_test()

void handle_detresponse_test ( BOOLEAN  passed_p,
int  line 
)
static

Definition at line 2190 of file DetResponseTest.c.

◆ frdetector_ok_p()

static BOOLEAN frdetector_ok_p ( LALFrDetector computed,
const LALFrDetector expected 
)
static

Definition at line 2221 of file DetResponseTest.c.

◆ detector_ok_p()

static BOOLEAN detector_ok_p ( LALDetector computed,
const LALDetector expected 
)
static

Definition at line 2252 of file DetResponseTest.c.

◆ deg_to_rad()

static REAL8 deg_to_rad ( REAL8  degrees)
static

Definition at line 166 of file DetResponseTest.c.

◆ rad_to_deg()

static REAL8 rad_to_deg ( REAL8  radians)
static

Definition at line 171 of file DetResponseTest.c.

◆ LALDR_Set3Vector()

static void LALDR_Set3Vector ( LALDR_3Vector v,
REAL8  v1,
REAL8  v2,
REAL8  v3 
)
static

Definition at line 183 of file DetResponseTest.c.

◆ LALDR_CrossProd3Vector()

static void LALDR_CrossProd3Vector ( LALDR_3Vector result,
LALDR_3Vector a,
LALDR_3Vector b 
)
static

Definition at line 196 of file DetResponseTest.c.

◆ LALDR_DotProd3Vector()

static REAL8 LALDR_DotProd3Vector ( LALDR_3Vector a,
LALDR_3Vector b 
)
static

Definition at line 213 of file DetResponseTest.c.

◆ LALDR_OuterProd3Vector()

static void LALDR_OuterProd3Vector ( LALDR_33Matrix a,
LALDR_3Vector u,
LALDR_3Vector v 
)
static

Definition at line 228 of file DetResponseTest.c.

◆ LALDR_DotProd33Matrix()

static REAL8 LALDR_DotProd33Matrix ( LALDR_33Matrix a,
LALDR_33Matrix b 
)
static

Definition at line 248 of file DetResponseTest.c.

◆ LALDR_Set33Matrix()

static void LALDR_Set33Matrix ( LALDR_33Matrix matrix,
REAL8  a11,
REAL8  a12,
REAL8  a13,
REAL8  a21,
REAL8  a22,
REAL8  a23,
REAL8  a31,
REAL8  a32,
REAL8  a33 
)
static

Definition at line 267 of file DetResponseTest.c.

◆ LALDR_Zero33Matrix()

static void LALDR_Zero33Matrix ( LALDR_33Matrix matrix)
static

Definition at line 306 of file DetResponseTest.c.

◆ LALDR_Multiply33Matrix()

static void LALDR_Multiply33Matrix ( LALDR_33Matrix product,
LALDR_33Matrix matrixL,
LALDR_33Matrix matrixR 
)
static

Definition at line 321 of file DetResponseTest.c.

◆ LALDR_ScalarMult33Matrix()

static void LALDR_ScalarMult33Matrix ( LALDR_33Matrix result,
REAL8  coefficient,
LALDR_33Matrix matrix 
)
static

Definition at line 353 of file DetResponseTest.c.

◆ LALDR_Add33Matrix()

static void LALDR_Add33Matrix ( LALDR_33Matrix result,
LALDR_33Matrix matrix1,
LALDR_33Matrix matrix2 
)
static

Definition at line 372 of file DetResponseTest.c.

◆ LALDR_Transpose33Matrix()

static void LALDR_Transpose33Matrix ( LALDR_33Matrix transpose,
LALDR_33Matrix matrix 
)
static

Definition at line 412 of file DetResponseTest.c.

◆ LALDR_Print33Matrix()

static void LALDR_Print33Matrix ( LALDR_33Matrix matrix,
const CHAR varname,
UINT4  format,
FILE *  file,
const CHAR graph_title 
)
static

Definition at line 504 of file DetResponseTest.c.

◆ LALDR_Print3Vector()

static void LALDR_Print3Vector ( LALDR_3Vector vector,
const CHAR varname,
FILE *  file 
)
static

Definition at line 579 of file DetResponseTest.c.

◆ skygrid_avg()

REAL4 skygrid_avg ( const skygrid_t  response)

Definition at line 2284 of file DetResponseTest.c.

◆ skygrid_square()

void skygrid_square ( skygrid_t  square,
const skygrid_t  input 
)

Definition at line 2311 of file DetResponseTest.c.

◆ skygrid_rms()

REAL4 skygrid_rms ( const skygrid_t  input)

Definition at line 2333 of file DetResponseTest.c.

◆ skygrid_sqrt()

void skygrid_sqrt ( skygrid_t  result,
const skygrid_t  input 
)

Definition at line 2323 of file DetResponseTest.c.

◆ skygrid_copy()

INT4 skygrid_copy ( skygrid_t  dest,
const skygrid_t  src 
)

Definition at line 2343 of file DetResponseTest.c.

◆ skygrid_print()

void skygrid_print ( const char *  comments,
const skygrid_t  input,
const char *  filename 
)

Definition at line 2355 of file DetResponseTest.c.

◆ skygrid_fabs()

void skygrid_fabs ( skygrid_t  absgrid,
const skygrid_t  input 
)

Definition at line 2378 of file DetResponseTest.c.

◆ skygrid_add()

void skygrid_add ( skygrid_t  sum,
const skygrid_t  a,
const skygrid_t  b 
)

Definition at line 2388 of file DetResponseTest.c.

◆ skygrid_subtract()

void skygrid_subtract ( skygrid_t  sum,
const skygrid_t  a,
const skygrid_t  b 
)

Definition at line 2396 of file DetResponseTest.c.

◆ skygrid_scalar_mult()

void skygrid_scalar_mult ( skygrid_t  result,
const skygrid_t  a,
REAL4  b 
)

Definition at line 2404 of file DetResponseTest.c.

◆ setup_global_detectors()

void setup_global_detectors ( void  )

Definition at line 2506 of file DetResponseTest.c.

◆ set_source_params()

void set_source_params ( LALSource source,
const char *  name,
REAL8  ra_rad,
REAL8  dec_rad,
REAL8  orien_rad 
)

Definition at line 2801 of file DetResponseTest.c.

◆ print_source_maybe()

void print_source_maybe ( const LALSource source)

Definition at line 2888 of file DetResponseTest.c.

◆ setup_global_sources()

void setup_global_sources ( void  )

Definition at line 2813 of file DetResponseTest.c.

◆ crab_pulsar_test()

void crab_pulsar_test ( LALStatus status)

Definition at line 2903 of file DetResponseTest.c.

◆ find_zero_gmst()

void find_zero_gmst ( void  )

Definition at line 2858 of file DetResponseTest.c.

◆ resp_local()

REAL4 resp_local ( REAL8  psi,
REAL8  theta,
REAL8  phi,
GWPolarization  pol 
)

Definition at line 2478 of file DetResponseTest.c.

◆ xfopen()

FILE * xfopen ( const char *  path,
const char *  mode 
)

Definition at line 2455 of file DetResponseTest.c.

◆ xfclose()

int xfclose ( FILE *  stream)

Definition at line 2470 of file DetResponseTest.c.

◆ laldr_strlcpy()

char * laldr_strlcpy ( char *  dst,
const char *  src,
size_t  len 
)

Definition at line 2629 of file DetResponseTest.c.

◆ fudge_factor_test()

void fudge_factor_test ( LALStatus status)

Definition at line 2646 of file DetResponseTest.c.

◆ passed_special_locations_tests_p() [1/2]

BOOLEAN passed_special_locations_tests_p ( LALStatus status)

◆ passed_almost_equal_tests_p()

BOOLEAN passed_almost_equal_tests_p ( void  )

Definition at line 3306 of file DetResponseTest.c.

◆ passed_matrix_test_p()

BOOLEAN passed_matrix_test_p ( void  )

Definition at line 2958 of file DetResponseTest.c.

◆ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 800 of file DetResponseTest.c.

◆ passed_special_locations_tests_p() [2/2]

BOOLEAN passed_special_locations_tests_p ( LALStatus UNUSED *  status)

Definition at line 2622 of file DetResponseTest.c.

Variable Documentation

◆ lim

const INT4 lim = NUM_RA * NUM_DEC

Definition at line 60 of file DetResponseTest.c.

◆ declim

const INT4 declim = (NUM_DEC-1)/2

Definition at line 61 of file DetResponseTest.c.

◆ verbose_p

BOOLEAN verbose_p = FALSE

Definition at line 73 of file DetResponseTest.c.

◆ verbose_level

int verbose_level = 0

Definition at line 74 of file DetResponseTest.c.

◆ oneBillion

const INT4 oneBillion = 1000000000

Definition at line 75 of file DetResponseTest.c.

◆ zero_tolerance

const REAL8 zero_tolerance = 0.

Definition at line 77 of file DetResponseTest.c.

◆ real8_tolerance

REAL8 real8_tolerance = (REAL8)2.*LAL_REAL8_EPS

Definition at line 78 of file DetResponseTest.c.

◆ real4_tolerance

REAL4 real4_tolerance = (REAL4)2.*LAL_REAL4_EPS

Definition at line 79 of file DetResponseTest.c.

◆ det_north_pole

LALDetector det_north_pole

Definition at line 81 of file DetResponseTest.c.

◆ det_south_pole

LALDetector det_south_pole

Definition at line 82 of file DetResponseTest.c.

◆ det_green_equator

LALDetector det_green_equator

Definition at line 83 of file DetResponseTest.c.

◆ det_green_tropic_of_cancer

LALDetector det_green_tropic_of_cancer

Definition at line 84 of file DetResponseTest.c.

◆ det_foo_tropic_of_cancer

LALDetector det_foo_tropic_of_cancer

Definition at line 85 of file DetResponseTest.c.

◆ src_0_0_p

LALSource src_0_0_p

Definition at line 88 of file DetResponseTest.c.

◆ src_0_0_c

LALSource src_0_0_c

Definition at line 89 of file DetResponseTest.c.

◆ src_0_90_p

LALSource src_0_90_p

Definition at line 90 of file DetResponseTest.c.

◆ src_0_90_c

LALSource src_0_90_c

Definition at line 91 of file DetResponseTest.c.

◆ src_0_45_p

LALSource src_0_45_p

Definition at line 92 of file DetResponseTest.c.

◆ src_0_45_c

LALSource src_0_45_c

Definition at line 93 of file DetResponseTest.c.