20 #include <lal/Statistics.h>
39 INT4 maxIndexX, maxIndexY, minIndexX, minIndexY;
40 REAL8 average, nPixel, variance, ep,
temp, sum;
61 maxIndexX = maxIndexY = minIndexX = minIndexY = 0;
65 for (
i = 0;
i < ySide;
i++ ) {
66 for (
j = 0;
j < xSide;
j++ ) {
89 nPixel = 1.0 * xSide * ySide;
90 average = sum / nPixel;
96 for (
i = 0;
i < ySide;
i++ ) {
97 for (
j = 0;
j < xSide;
j++ ) {
104 variance = ( variance - ep * ep / nPixel ) / ( nPixel - 1 );
109 out->maxIndex[0] = maxIndexX;
110 out->maxIndex[1] = maxIndexY;
112 out->minIndex[0] = minIndexX;
113 out->minIndex[1] = minIndexY;
114 out->avgCount = average;
115 out->stdDev = sqrt( variance );
132 INT4 i,
j, xSide, ySide, nPixel;
133 REAL8 sum, tempVariance, tempMean, ep,
temp;
142 nPixel = 1.0 * xSide * ySide;
147 for (
i = 0;
i < ySide;
i++ ) {
148 for (
j = 0;
j < xSide;
j++ ) {
150 sum += in->
map[
i * xSide +
j];
154 tempMean = sum / nPixel;
158 for (
i = 0;
i < ySide;
i++ ) {
159 for (
j = 0;
j < xSide;
j++ ) {
166 tempVariance = ( tempVariance - ep * ep / nPixel ) / ( nPixel - 1 );
169 *variance = tempVariance;
206 length =
out->length;
211 for (
i = 0;
i < length;
i++ ) {
216 for (
i = 0;
i < ySide;
i++ ) {
217 for (
j = 0;
j < xSide;
j++ ) {
223 if ( (
temp > length ) || (
temp < 0 ) ) {
#define ABORT(statusptr, code, mesg)
#define ATTATCHSTATUSPTR(statusptr)
#define ASSERT(assertion, statusptr, code, mesg)
#define DETATCHSTATUSPTR(statusptr)
#define INITSTATUS(statusptr)
#define RETURN(statusptr)
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...
#define STATISTICSH_ENULL
void LALHoughHistogram(LALStatus *status, UINT8Vector *out, HOUGHMapTotal *in)
Produces a histogram of the number counts in a total Hough map.
#define STATISTICSH_MSGEVAL
#define STATISTICSH_MSGENULL
void LALHoughmapMeanVariance(LALStatus *status, REAL8 *mean, REAL8 *variance, HOUGHMapTotal *in)
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.