69#include <lal/LALStdio.h>
70#include <lal/Statistics.h>
74#define TESTSTATISTICSC_ENORM 0
75#define TESTSTATISTICSC_ESUB 1
76#define TESTSTATISTICSC_EARG 2
77#define TESTSTATISTICSC_EBAD 3
78#define TESTSTATISTICSC_EFILE 4
80#define TESTSTATISTICSC_MSGENORM "Normal exit"
81#define TESTSTATISTICSC_MSGESUB "Subroutine failed"
82#define TESTSTATISTICSC_MSGEARG "Error parsing arguments"
83#define TESTSTATISTICSC_MSGEBAD "Bad argument values"
84#define TESTSTATISTICSC_MSGEFILE "Could not create output file"
91#define FILEOUT "OutHistogram.asc"
94#define USAGE "Usage: %s [-d debuglevel] [-o outfile]\n"
100#define ERROR( code, msg, statement ) \
102 if ( lalDebugLevel & LALERROR ) \
103 XLALPrintError( "Error[0] %d: program %s, file %s, line %d, %s\n" \
104 " %s %s\n", (code), *argv, __FILE__, \
105 __LINE__, "$Id$", statement ? statement : \
109#define INFO( statement ) \
111 if ( lalDebugLevel & LALINFO ) \
112 XLALPrintError( "Info[0]: program %s, file %s, line %d, %s\n" \
113 " %s\n", *argv, __FILE__, __LINE__, \
114 "$Id$", (statement) ); \
117#define SUB( func, statusptr ) \
119 if ( (func), (statusptr)->statusCode ) { \
120 ERROR( TESTSTATISTICSC_ESUB, TESTSTATISTICSC_MSGESUB, \
121 "Function call \"" #func "\" failed:" ); \
122 return TESTSTATISTICSC_ESUB; \
129int main(
int argc,
char *argv[] )
137 const CHAR *fname = NULL;
147 while ( arg < argc ) {
149 if ( !strcmp( argv[arg],
"-d" ) ) {
150 if ( argc > arg + 1 ) {
159 else if ( !strcmp( argv[arg],
"-o" ) ) {
160 if ( argc > arg + 1 ) {
195 printf(
" Maximum number count: %d\n", (
int )
stats.maxCount );
196 printf(
" Location: %d %d\n",
stats.maxIndex[0],
stats.maxIndex[1] );
197 printf(
" Minimum number count: %d\n", (
int )
stats.minCount );
198 printf(
" Location: %d %d\n",
stats.minIndex[0],
stats.minIndex[1] );
199 printf(
" Average number count: %f\n",
stats.avgCount );
200 printf(
" Standard deviation of number count: %f\n",
stats.stdDev );
211 fp = fopen( fname,
"w" );
#define SUB(func, statusptr)
#define ERROR(code, msg, statement)
void LALCheckMemoryLeaks(void)
#define TESTSTATISTICSC_MSGEARG
#define TESTSTATISTICSC_MSGEFILE
#define TESTSTATISTICSC_ENORM
#define TESTSTATISTICSC_MSGENORM
#define TESTSTATISTICSC_EARG
#define TESTSTATISTICSC_EFILE
int main(int argc, char **argv)
REAL8 HoughTT
Total Hough Map pixel type.
void LALHoughStatistics(LALStatus *status, HoughStats *out, HOUGHMapTotal *in)
This function calculates the maximum number count, minimum number count, average and standard deviati...
void LALHoughHistogram(LALStatus *status, UINT8Vector *out, HOUGHMapTotal *in)
Produces a histogram of the number counts in a total Hough map.
int XLALPrintError(const char *fmt,...) _LAL_GCC_PRINTF_FORMAT_(1
This structure stores the Hough map.
UINT2 ySide
number of physical pixels in the y direction
UINT2 xSide
number of physical pixels in the x direction
HoughTT * map
the pixel counts; the number of elements to allocate is ySide*xSide
UINT4 mObsCoh
ratio of observation time and coherent timescale
Structure for storing statistical information about a Hough map.