103#include <lal/HoughMap.h>
106#define TESTHOUGHMAPC_ENORM 0
107#define TESTHOUGHMAPC_ESUB 1
108#define TESTHOUGHMAPC_EARG 2
109#define TESTHOUGHMAPC_EBAD 3
110#define TESTHOUGHMAPC_EFILE 4
112#define TESTHOUGHMAPC_MSGENORM "Normal exit"
113#define TESTHOUGHMAPC_MSGESUB "Subroutine failed"
114#define TESTHOUGHMAPC_MSGEARG "Error parsing arguments"
115#define TESTHOUGHMAPC_MSGEBAD "Bad argument values"
116#define TESTHOUGHMAPC_MSGEFILE "Could not create output file"
131#define FILEOUT "OutHough.asc"
135#define USAGE "Usage: %s [-d debuglevel] [-o outfile] [-f f0] [-p alpha delta] [-s patchSizeX patchSizeY]\n"
141#define ERROR( code, msg, statement ) \
143 if ( lalDebugLevel & LALERROR ) \
144 XLALPrintError( "Error[0] %d: program %s, file %s, line %d, %s\n" \
145 " %s %s\n", (code), *argv, __FILE__, \
146 __LINE__, "$Id$", statement ? statement : \
150#define INFO( statement ) \
152 if ( lalDebugLevel & LALINFO ) \
153 XLALPrintError( "Info[0]: program %s, file %s, line %d, %s\n" \
154 " %s\n", *argv, __FILE__, __LINE__, \
155 "$Id$", (statement) ); \
158#define SUB( func, statusptr ) \
160 if ( (func), (statusptr)->statusCode ) { \
161 ERROR( TESTHOUGHMAPC_ESUB, TESTHOUGHMAPC_MSGESUB, \
162 "Function call \"" #func "\" failed:" ); \
163 return TESTHOUGHMAPC_ESUB; \
170int main(
int argc,
char *argv[] )
186 UINT2 maxNBins, maxNBorders;
199 REAL8 patchSizeX, patchSizeY;
211 parRes.
f0Bin = f0Bin;
233 while ( arg < argc ) {
235 if ( !strcmp( argv[arg],
"-d" ) ) {
236 if ( argc > arg + 1 ) {
245 else if ( !strcmp( argv[arg],
"-o" ) ) {
246 if ( argc > arg + 1 ) {
256 else if ( !strcmp( argv[arg],
"-f" ) ) {
257 if ( argc > arg + 1 ) {
259 f0 = atof( argv[arg++] );
261 parRes.
f0Bin = f0Bin;
269 else if ( !strcmp( argv[arg],
"-p" ) ) {
270 if ( argc > arg + 2 ) {
272 alpha = atof( argv[arg++] );
273 delta = atof( argv[arg++] );
281 else if ( !strcmp( argv[arg],
"-s" ) ) {
282 if ( argc > arg + 2 ) {
313 xSide = parSize.
xSide;
314 ySide = parSize.
ySide;
363 for (
i = 0;
i < maxNBorders; ++
i ) {
389 phmd.
fBin = f0Bin + 21;
451 fp = fopen( fname,
"w" );
462 for (
j = ySide - 1;
j >= 0; --
j ) {
463 for (
i = 0;
i < xSide; ++
i ) {
480 for (
i = 0;
i < maxNBorders; ++
i ) {
#define SUB(func, statusptr)
#define ERROR(code, msg, statement)
#define TESTHOUGHMAPC_MSGEFILE
#define TESTHOUGHMAPC_MSGENORM
#define TESTHOUGHMAPC_MSGEARG
#define TESTHOUGHMAPC_EFILE
#define TESTHOUGHMAPC_ENORM
#define TESTHOUGHMAPC_MSGEBAD
#define TESTHOUGHMAPC_EBAD
#define TESTHOUGHMAPC_EARG
void LALCheckMemoryLeaks(void)
static double double delta
int main(int argc, char **argv)
void LALHOUGHInitializeHD(LALStatus *status, HOUGHMapDeriv *hd)
This function initializes the Hough map derivative space HOUGHMapDeriv *hd to zero.
REAL8 HoughTT
Total Hough Map pixel type.
void LALHOUGHAddPHMD2HD(LALStatus *status, HOUGHMapDeriv *hd, HOUGHphmd *phmd)
Given an initial Hough map derivative HOUGHMapDeriv *hd and a representation of a phmd HOUGHphmd *phm...
void LALHOUGHIntegrHD2HT(LALStatus *status, HOUGHMapTotal *ht, HOUGHMapDeriv *hd)
This function constructs a total Hough map HOUGHMapTotal *ht from its derivative HOUGHMapDeriv *hd by...
void LALHOUGHInitializeHT(LALStatus *status, HOUGHMapTotal *ht, HOUGHPatchGrid *patch)
This function initializes the total Hough map HOUGHMapTotal *ht to zero and checks consistency betwee...
#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
This structure stores the Hough map derivative.
UINT2 ySide
number of physical pixels in the y direction
UINT2 xSide
number of physical pixels in the x direction
HoughDT * map
the pixel count derivatives; the number of elements to allocate is ySide*(xSide+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
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.
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 [ ].