92#define TESTPEAK2PHMDC_ENORM 0
93#define TESTPEAK2PHMDC_ESUB 1
94#define TESTPEAK2PHMDC_EARG 2
95#define TESTPEAK2PHMDC_EBAD 3
96#define TESTPEAK2PHMDC_EFILE 4
98#define TESTPEAK2PHMDC_MSGENORM "Normal exit"
99#define TESTPEAK2PHMDC_MSGESUB "Subroutine failed"
100#define TESTPEAK2PHMDC_MSGEARG "Error parsing arguments"
101#define TESTPEAK2PHMDC_MSGEBAD "Bad argument values"
102#define TESTPEAK2PHMDC_MSGEFILE "Could not create output file"
117#define FILEOUT "OutHough.asc"
121#define USAGE "Usage: %s [-d debuglevel] [-o outfile] [-f f0] [-p alpha delta] [-s patchSizeX patchSizeY]\n"
127#define ERROR( code, msg, statement ) \
129 if ( lalDebugLevel & LALERROR ) \
130 XLALPrintError( "Error[0] %d: program %s, file %s, line %d, %s\n" \
131 " %s %s\n", (code), *argv, __FILE__, \
132 __LINE__, "$Id$", statement ? statement : \
136#define INFO( statement ) \
138 if ( lalDebugLevel & LALINFO ) \
139 XLALPrintError( "Info[0]: program %s, file %s, line %d, %s\n" \
140 " %s\n", *argv, __FILE__, __LINE__, \
141 "$Id$", (statement) ); \
144#define SUB( func, statusptr ) \
146 if ( (func), (statusptr)->statusCode ) { \
147 ERROR( TESTPEAK2PHMDC_ESUB, TESTPEAK2PHMDC_MSGESUB, \
148 "Function call \"" #func "\" failed:" ); \
149 return TESTPEAK2PHMDC_ESUB; \
160int main(
int argc,
char *argv[] )
176 UINT2 maxNBins, maxNBorders;
193 REAL8 patchSizeX, patchSizeY;
202 parRes.
f0Bin = f0Bin;
225 while ( arg < argc ) {
227 if ( !strcmp( argv[arg],
"-d" ) ) {
228 if ( argc > arg + 1 ) {
237 else if ( !strcmp( argv[arg],
"-o" ) ) {
238 if ( argc > arg + 1 ) {
248 else if ( !strcmp( argv[arg],
"-f" ) ) {
249 if ( argc > arg + 1 ) {
251 f0 = atof( argv[arg++] );
253 parRes.
f0Bin = f0Bin;
261 else if ( !strcmp( argv[arg],
"-p" ) ) {
262 if ( argc > arg + 2 ) {
264 alpha = atof( argv[arg++] );
265 delta = atof( argv[arg++] );
273 else if ( !strcmp( argv[arg],
"-s" ) ) {
274 if ( argc > arg + 2 ) {
305 xSide = parSize.
xSide;
306 ySide = parSize.
ySide;
344 for (
i = 0;
i < maxNBorders; ++
i ) {
368 phmd.
fBin = f0Bin + 21;
382 pg.
peak[0] = maxNBins;
406 pointer = &( PHMD[0] );
407 for (
k = 0;
k < ( xSide + 1 ) * ySide; ++
k ) {
413 for (
k = 0;
k < ySide; ++
k ) {
419 INT2 xindex, yLower, yUpper;
426 for (
j = yLower;
j <= yUpper; ++
j ) {
428 PHMD[
j * ( xSide + 1 ) + xindex] += 1;
434 INT2 xindex, yLower, yUpper;
441 for (
j = yLower;
j <= yUpper; ++
j ) {
443 PHMD[
j * ( xSide + 1 ) + xindex] -= 1;
454 fp = fopen( fname,
"w" );
465 for (
j = ySide - 1;
j >= 0; --
j ) {
466 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 TESTPEAK2PHMDC_MSGEARG
#define TESTPEAK2PHMDC_EBAD
#define TESTPEAK2PHMDC_MSGEBAD
#define TESTPEAK2PHMDC_MSGEFILE
#define TESTPEAK2PHMDC_ENORM
#define TESTPEAK2PHMDC_EARG
#define TESTPEAK2PHMDC_MSGENORM
#define TESTPEAK2PHMDC_EFILE
int main(int argc, char **argv)
#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 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)
void LALHOUGHCalcParamPLUT(LALStatus *status, HOUGHParamPLUT *out, HOUGHSizePar *sizePar, HOUGHDemodPar *par)
void LALHOUGHComputeSizePar(LALStatus *status, HOUGHSizePar *out, HOUGHResolutionPar *in)
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.
void LALHOUGHPeak2PHMD(LALStatus *status, HOUGHphmd *phmd, HOUGHptfLUT *lut, HOUGHPeakGram *pg)
Construction of Partial-Hough-Map-Derivatives (phmd) given a peak-gram and the look-up-table.
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...
This structure stores the border of a circle clipped on the projected plane.
COORType * xPixel
x pixel index to be marked
UINT2 ySide
length of xPixel
Demodulation parameters needed for the Hough transform; all coordinates are assumed to be with respec...
REAL8Cart3Coor positC
(x,y,z): Position of the detector
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.
This structure stores the `‘peak-gram’'.
REAL8 deltaF
Frequency resolution: df=1/TCOH
UINT4 length
Number of peaks present in the peak-gram.
UINT8 fBinFin
Frequency index of the last element of the spectrum covered by this peak-gram.
UINT8 fBinIni
Frequency index of the first element of the spectrum covered by this peak-gram; it can be seen as an ...
INT4 * peak
The peak indices relative to fBinIni, i.e., the zero peak corresponds to fBinIni.
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 a partial Hough map derivative.
UINT2 lengthRight
Exact number of Right borders.
UINT2 lengthLeft
Exact number of Left borders.
UINT8 fBin
Frequency bin of this partial map derivative.
UCHAR * firstColumn
Number of elements of firstColumn.
UINT2 ySide
number of elements of firstColumn
HOUGHBorder ** rightBorderP
Pointers to borders.
UINT2 maxNBorders
Maximun number of borders of each type (for memory allocation purposes), i.e. length of *leftBorderP ...
HOUGHBorder ** leftBorderP
Pointers to borders.
This structure stores the patch-time-frequency look up table.
UINT2 maxNBins
Maximum number of bins affecting the patch (for memory allocation purposes)
HOUGHBorder * border
The annulus borders.
HOUGHBin2Border * bin
Bin to border correspondence.
UINT2 maxNBorders
Maximum number of borders affecting the patch (for memory allocation purposes)
REAL8 delta
In the interval [ ].