61 #define DETECTORSITETESTC_ENOM 0
62 #define DETECTORSITETESTC_ECHK 1
63 #define DETECTORSITETESTC_EFLS 2
68 #define DETECTORSITETESTC_MSGENOM "Nominal exit"
69 #define DETECTORSITETESTC_MSGECHK "Error checking failed to catch bad data"
70 #define DETECTORSITETESTC_MSGEFLS "Incorrect answer for valid data"
76 #include <lal/LALStdlib.h>
77 #include <lal/LALConstants.h>
78 #include <lal/DetectorSite.h>
79 #include <lal/LALgetopt.h>
82 #define CODES(x) CODES_(x)
92 #define DETECTORSITETESTC_LOCTOL 3e-2
93 #define DETECTORSITETESTC_RESTOL 1e-06
99 printf(
" = { { %.15e, %.15e, %.15e },\n", detector->
location[0],
101 printf(
" { { %.15g, %.15g, %.15g },\n", detector->
response[0][0],
103 printf(
" { %.15g, %.15g, %.15g },\n", detector->
response[1][0],
105 printf(
" { %.15g, %.15g, %.15g } },\n", detector->
response[2][0],
108 printf(
" %.15g, %.15g, %.15g,\n",
112 printf(
" %.15e, %.15g,\n",
115 printf(
" %.15e, %.15g } }\n",
131 printf(
" Name is \"%s\",\n", frDetector.
name);
133 frDetector.
name[1] =
'?';
135 printf(
" Changing to \"%s\",\n", frDetector.
name);
139 printf(
" Enum'ed type is %d (LALDETECTORTYPE_IFODIFF=%d)\n",
144 printf(
" x[%d]:\n cached: %.15g calc: %.15g diff: %g\n", i+1,
149 >= DETECTORSITETESTC_LOCTOL )
159 printf(
" d[%d,%d]:\n cached: %g calc: %g diff: %g\n", i+1, j+1,
163 - constructedDetector.
response[i][j]);
165 - constructedDetector.
response[i][j] >= DETECTORSITETESTC_RESTOL )
172 printf(
" Latitude:\n cached: %g calc: %g diff: %g\n",
184 printf(
" Longitude:\n cached: %g calc: %g diff: %g\n",
196 printf(
" X Arm altitide:\n cached: %g calc: %g diff: %g\n",
208 printf(
" X Arm azimuth:\n cached: %g calc: %g diff: %g\n",
220 printf(
" Y Arm altitide:\n cached: %g calc: %g diff: %g\n",
231 printf(
" Y Arm azimuth:\n cached: %g calc: %g diff: %g\n",
247 int main(
int argc,
char *argv[] )
300 printf(
"Checking LHO...\n");
303 if ( (
code = CheckDetector( &cachedDetector ) ) )
308 printf(
"Checking LLO...\n");
310 if ( (
code = CheckDetector( &cachedDetector ) ) )
315 printf(
"Checking VIRGO...\n");
317 if ( (
code = CheckDetector( &cachedDetector ) ) )
322 printf(
"Checking GEO600...\n");
324 if ( (
code = CheckDetector( &cachedDetector ) ) )
330 printf(
"Checking TAMA300...\n");
332 if ( (
code = CheckDetector( &cachedDetector ) ) )
337 printf(
"Checking CIT40...\n");
339 if ( (
code = CheckDetector( &cachedDetector ) ) )
379 printf(
"PASS: All tests\n");
398 fprintf (stderr,
"Options:\n");
399 fprintf (stderr,
" -h print this message\n");
400 fprintf (stderr,
" -q quiet: run silently\n");
401 fprintf (stderr,
" -v verbose: print extra information\n");
402 fprintf (stderr,
" -d level set lalDebugLevel to level\n");
436 if ( freopen (
"/dev/null",
"w", stderr) == NULL )
437 printf (
"Failed call: freopen(/dev/null, 'w', stderr)\n");
438 if ( freopen (
"/dev/null",
"w", stdout) == NULL )
439 printf (
"Failed call: freopen(/dev/null, 'w', stdout)\n");
@ LALDetectorIndexLLODIFF
@ LALDetectorIndexGEO600DIFF
@ LALDetectorIndexTAMA300DIFF
@ LALDetectorIndexVIRGODIFF
@ LALDetectorIndexCIT40DIFF
@ LALDetectorIndexLHODIFF
#define DETECTORSITETESTC_ENOM
Nominal exit.
#define DETECTORSITETESTC_EFLS
Incorrect answer for valid data.
void PrintLALDetector(const LALDetector *detector)
void LALCheckMemoryLeaks(void)
int LALgetopt(int argc, char *const *argv, const char *optstring)
static void Usage(const char *program, int exitcode)
static void ParseOptions(int argc, char *argv[])
int main(int argc, char *argv[])
LALDetector * XLALCreateDetector(LALDetector *detector, const LALFrDetector *frDetector, LALDetectorType type)
UNDOCUMENTED.
const LALDetector lalCachedDetectors[LAL_NUM_DETECTORS]
Pre-existing detectors.
int16_t INT2
Two-byte signed integer.
LALDetectorType
Detector type, which determines how the detector response is determined.
@ LALDETECTORTYPE_IFODIFF
IFO in differential mode.
REAL4 response[3][3]
The Earth-fixed Cartesian components of the detector's response tensor .
LALDetectorType type
The type of the detector (e.g., IFO in differential mode, cylindrical bar, etc.)
REAL8 location[3]
The three components, in an Earth-fixed Cartesian coordinate system, of the position vector from the ...
LALFrDetector frDetector
The original LALFrDetector structure from which this was created.
Detector frame data structure Structure to contain the data that appears in a FrDetector structure in...
REAL8 vertexLongitudeRadians
The geodetic longitude of the vertex in radians.
REAL8 vertexLatitudeRadians
The geodetic latitude of the vertex in radians.
REAL4 vertexElevation
The height of the vertex above the reference ellipsoid in meters.
REAL4 xArmAzimuthRadians
The angle clockwise from North to the projection of the X arm (or bar's cylidrical axis) into the lo...
REAL4 yArmAltitudeRadians
The angle up from the local tangent plane of the reference ellipsoid to the Y arm in radians (unused...
REAL4 yArmAzimuthRadians
The angle clockwise from North to the projection of the Y arm into the local tangent plane of the re...
REAL4 xArmAltitudeRadians
The angle up from the local tangent plane of the reference ellipsoid to the X arm (or bar's cylidric...
CHAR name[LALNameLength]
A unique identifying string.