88#define TESTNDCONSTRUCTPLUTC_ENORM 0
89#define TESTNDCONSTRUCTPLUTC_ESUB 1
90#define TESTNDCONSTRUCTPLUTC_EARG 2
91#define TESTNDCONSTRUCTPLUTC_EBAD 3
92#define TESTNDCONSTRUCTPLUTC_EFILE 4
94#define TESTNDCONSTRUCTPLUTC_MSGENORM "Normal exit"
95#define TESTNDCONSTRUCTPLUTC_MSGESUB "Subroutine failed"
96#define TESTNDCONSTRUCTPLUTC_MSGEARG "Error parsing arguments"
97#define TESTNDCONSTRUCTPLUTC_MSGEBAD "Bad argument values"
98#define TESTNDCONSTRUCTPLUTC_MSGEFILE "Could not create output file"
113#define FILEOUT "OutHough.asc"
117#define USAGE "Usage: %s [-d debuglevel] [-o outfile] [-f f0] [-p alpha delta][-s patchSizeX patchSizeY]\n"
123#define ERROR( code, msg, statement ) \
125 if ( lalDebugLevel & LALERROR ) \
126 XLALPrintError( "Error[0] %d: program %s, file %s, line %d, %s\n" \
127 " %s %s\n", (code), *argv, __FILE__, \
128 __LINE__, "$Id$", statement ? statement : \
132#define INFO( statement ) \
134 if ( lalDebugLevel & LALINFO ) \
135 XLALPrintError( "Info[0]: program %s, file %s, line %d, %s\n" \
136 " %s\n", *argv, __FILE__, __LINE__, \
137 "$Id$", (statement) ); \
140#define SUB( func, statusptr ) \
142 if ( (func), (statusptr)->statusCode ) { \
143 ERROR( TESTNDCONSTRUCTPLUTC_ESUB, TESTNDCONSTRUCTPLUTC_MSGESUB, \
144 "Function call \"" #func "\" failed:" ); \
145 return TESTNDCONSTRUCTPLUTC_ESUB; \
156int main(
int argc,
char *argv[] )
170 UINT2 maxNBins, maxNBorders;
186 REAL8 patchSizeX, patchSizeY;
195 parRes.
f0Bin = f0Bin;
218 while ( arg < argc ) {
220 if ( !strcmp( argv[arg],
"-d" ) ) {
221 if ( argc > arg + 1 ) {
230 else if ( !strcmp( argv[arg],
"-o" ) ) {
231 if ( argc > arg + 1 ) {
241 else if ( !strcmp( argv[arg],
"-f" ) ) {
242 if ( argc > arg + 1 ) {
244 f0 = atof( argv[arg++] );
246 parRes.
f0Bin = f0Bin;
254 else if ( !strcmp( argv[arg],
"-p" ) ) {
255 if ( argc > arg + 2 ) {
257 alpha = atof( argv[arg++] );
258 delta = atof( argv[arg++] );
266 else if ( !strcmp( argv[arg],
"-s" ) ) {
267 if ( argc > arg + 2 ) {
298 xSide = parSize.
xSide;
299 ySide = parSize.
ySide;
328 for (
i = 0;
i < maxNBorders; ++
i ) {
364 pointer = &( PHMD[0] );
365 for (
k = 0;
k < ( xSide + 1 ) * ySide; ++
k ) {
374 for (
k = lut.
iniBin;
k < binPoint ;
k += 2 ) {
382 INT2 lb1, rb1, lb2, rb2;
384 INT2 max1, min1, max2, min2;
392 i = binPoint - 1 -
k;
412 PHMD[
j * ( xSide + 1 ) + xindex] += 1;
419 PHMD[
j * ( xSide + 1 ) + xindex] += 1;
426 PHMD[
j * ( xSide + 1 ) + xindex] -= 1;
433 PHMD[
j * ( xSide + 1 ) + xindex] -= 1;
440 for (
j = min1;
j <= max1; ++
j ) {
441 PHMD[
j * ( xSide + 1 )] += 1;
444 for (
j = min2;
j <= max2; ++
j ) {
445 PHMD[
j * ( xSide + 1 )] += 1;
457 fp = fopen( fname,
"w" );
468 for (
j = ySide - 1;
j >= 0; --
j ) {
469 for (
i = 0;
i < xSide; ++
i ) {
483 for (
i = 0;
i < maxNBorders; ++
i ) {
#define SUB(func, statusptr)
#define ERROR(code, msg, statement)
void LALCheckMemoryLeaks(void)
static double double delta
#define TESTNDCONSTRUCTPLUTC_MSGEFILE
#define TESTNDCONSTRUCTPLUTC_EFILE
#define TESTNDCONSTRUCTPLUTC_EARG
#define TESTNDCONSTRUCTPLUTC_MSGEARG
#define TESTNDCONSTRUCTPLUTC_EBAD
#define TESTNDCONSTRUCTPLUTC_MSGENORM
#define TESTNDCONSTRUCTPLUTC_ENORM
#define TESTNDCONSTRUCTPLUTC_MSGEBAD
int main(int argc, char **argv)
void LALNDHOUGHParamPLUT(LALStatus *status, HOUGHParamPLUT *out, HOUGHSizePar *sizePar, HOUGHDemodPar *par)
#define VTOT
Total detector velocity/c TO BE CHANGED DEPENDING ON DETECTOR.
#define PIXERR
Maximum `‘error’' (as a fraction of the width of the thinnest annulus) which allows to consider two b...
#define LINERR
Maximum `‘error’' (as a fraction of the width of the thinnest annulus) which allows to represent a ci...
void LALHOUGHComputeNDSizePar(LALStatus *status, HOUGHSizePar *out, HOUGHResolutionPar *in)
void LALHOUGHFillPatchGrid(LALStatus *status, HOUGHPatchGrid *out, HOUGHSizePar *par)
#define VEPI
Earth v_epicycle/c TO BE CHANGED DEPENDING ON DETECTOR.
void LALHOUGHConstructPLUT(LALStatus *status, HOUGHptfLUT *lut, HOUGHPatchGrid *patch, HOUGHParamPLUT *par)
INT2 COORType
To be changed to {INT2 COORType} if the number of pixels in the x-direction exceeds 255.
REAL8 HoughDT
Hough Map derivative pixel type.
int XLALPrintError(const char *fmt,...) _LAL_GCC_PRINTF_FORMAT_(1
This structure stores the border indexes corresponding to one frequency bin plus the corrections to b...
INT2 rightB2
Border index to be used (stop-border ‘ ’)
INT2 leftB1
Border index to be used (start-border ‘ ’)
INT2 piece1min
If piece1min piece1max no corrections should be added.
INT2 piece2max
Interval limits of the (second piece) correction to the first column.
INT2 rightB1
Border index to be used (stop-border ‘ ’)
INT2 piece1max
Interval limits of the (first piece) correction to the first column.
INT2 leftB2
Border index to be used (start-border ‘ ’)
INT2 piece2min
If piece2min piece2max no corrections should be added.
This structure stores the border of a circle clipped on the projected plane.
COORType * xPixel
x pixel index to be marked
INT4 yLower
lower y pixel affected by this border and yUpper<yLower or yUpper<0 are possible
UINT2 ySide
length of xPixel
INT4 yUpper
upper y pixel affected by this border
Demodulation parameters needed for the Hough transform; all coordinates are assumed to be with respec...
REAL8 deltaF
Frequency resolution: df=1/TCOH
REAL8 timeDiff
: time difference
REAL8Cart3Coor veloC
(x,y,z): Relative detector velocity
REAL8Vector spin
Spin down information.
REAL8UnitPolarCoor skyPatch
(alpha, delta): position of the center of the patch
Parameters needed to construct the partial look up table.
This structure stores patch-frequency grid information.
UINT2 ySide
Real number of pixels in the y-direction (in the projected plane).
REAL8 * xCoor
Coordinates of the pixel centers.
UINT2 xSide
Real number of pixels in the x direction (in the projected plane); it should be less than or equal to...
REAL8 * yCoor
Coordinates of the pixel centers.
parameters needed for gridding the patch
REAL8 deltaF
Frequency resolution: df=1/TCOH
REAL8 pixErr
for validity of LUT as PIXERR
INT8 f0Bin
Frequency bin at which construct the grid.
REAL8 patchSkySizeY
Patch size in radians along y-axis.
REAL8 patchSkySizeX
Patch size in radians along x-axis.
REAL8 pixelFactor
number of pixel that fit in the thinnest annulus
REAL8 vTotC
estimate value of v-total/C as VTOT
REAL8 linErr
as LINERR circle ->line
required for constructing patch
UINT2 maxNBorders
maximum number of borders affecting the patch; for memory allocation
UINT2 maxNBins
maximum number of bins affecting the patch; for memory allocation
UINT2 ySide
number of pixels in the y direction
UINT2 xSide
number of pixels in the x direction (projected plane)
This structure stores the patch-time-frequency look up table.
UINT2 maxNBins
Maximum number of bins affecting the patch (for memory allocation purposes)
INT4 nBin
Exact number of bins affecting the patch.
HOUGHBorder * border
The annulus borders.
INT4 iniBin
First bin affecting the patch with respect to f0.
HOUGHBin2Border * bin
Bin to border correspondence.
UINT2 maxNBorders
Maximum number of borders affecting the patch (for memory allocation purposes)
REAL8 delta
In the interval [ ].