94#define TESTNDPEAK2PHMDC_ENORM 0
95#define TESTNDPEAK2PHMDC_ESUB 1
96#define TESTNDPEAK2PHMDC_EARG 2
97#define TESTNDPEAK2PHMDC_EBAD 3
98#define TESTNDPEAK2PHMDC_EFILE 4
100#define TESTNDPEAK2PHMDC_MSGENORM "Normal exit"
101#define TESTNDPEAK2PHMDC_MSGESUB "Subroutine failed"
102#define TESTNDPEAK2PHMDC_MSGEARG "Error parsing arguments"
103#define TESTNDPEAK2PHMDC_MSGEBAD "Bad argument values"
104#define TESTNDPEAK2PHMDC_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( TESTNDPEAK2PHMDC_ESUB, TESTNDPEAK2PHMDC_MSGESUB, \
148 "Function call \"" #func "\" failed:" ); \
149 return TESTNDPEAK2PHMDC_ESUB; \
160int main(
int argc,
char *argv[] )
176 UINT4 maxNBins, maxNBorders;
194 REAL8 patchSizeX, patchSizeY;
203 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 ) {
365 phmd.
fBin = f0Bin + 21;
402 pointer = &( PHMD[0] );
403 for (
k = 0;
k < ( xSide + 1 ) * ySide; ++
k ) {
409 for (
k = 0;
k < ySide; ++
k ) {
415 INT2 xindex, yLower, yUpper;
422 for (
j = yLower;
j <= yUpper; ++
j ) {
424 PHMD[
j * ( xSide + 1 ) + xindex] += 1;
430 INT2 xindex, yLower, yUpper;
437 for (
j = yLower;
j <= yUpper; ++
j ) {
439 PHMD[
j * ( xSide + 1 ) + xindex] -= 1;
450 fp = fopen( fname,
"w" );
461 for (
j = ySide - 1;
j >= 0; --
j ) {
462 for (
i = 0;
i < xSide; ++
i ) {
479 for (
i = 0;
i < maxNBorders; ++
i ) {
#define SUB(func, statusptr)
#define ERROR(code, msg, statement)
void LALCheckMemoryLeaks(void)
static double double delta
#define TESTNDPEAK2PHMDC_MSGEARG
#define TESTNDPEAK2PHMDC_EARG
#define TESTNDPEAK2PHMDC_EFILE
#define TESTNDPEAK2PHMDC_MSGEFILE
#define TESTNDPEAK2PHMDC_MSGEBAD
#define TESTNDPEAK2PHMDC_MSGENORM
#define TESTNDPEAK2PHMDC_ENORM
#define TESTNDPEAK2PHMDC_EBAD
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.
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...
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.
INT4 offset
Frequency bin corresponding to center of patch measured with respect to f0Bin (zero in modulated case...
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 [ ].