95#include <lal/LALHough.h>
100#define TESTDRIVENDHOUGHC_ENORM 0
101#define TESTDRIVENDHOUGHC_ESUB 1
102#define TESTDRIVENDHOUGHC_EARG 2
103#define TESTDRIVENDHOUGHC_EBAD 3
104#define TESTDRIVENDHOUGHC_EFILE 4
106#define TESTDRIVENDHOUGHC_MSGENORM "Normal exit"
107#define TESTDRIVENDHOUGHC_MSGESUB "Subroutine failed"
108#define TESTDRIVENDHOUGHC_MSGEARG "Error parsing arguments"
109#define TESTDRIVENDHOUGHC_MSGEBAD "Bad argument values"
110#define TESTDRIVENDHOUGHC_MSGEFILE "Could not create output file"
124#define FILEOUT "OutHough.asc"
127#define STEPALPHA 0.005
131#define USAGE "Usage: %s [-d debuglevel] [-o outfile] [-f f0] [-p alpha delta] [-s patchSizeX patchSizeY]\n"
137#define ERROR( code, msg, statement ) \
139 if ( lalDebugLevel & LALERROR ) \
140 XLALPrintError( "Error[0] %d: program %s, file %s, line %d, %s\n" \
141 " %s %s\n", (code), *argv, __FILE__, \
142 __LINE__, "$Id$", statement ? statement : \
146#define INFO( statement ) \
148 if ( lalDebugLevel & LALINFO ) \
149 XLALPrintError( "Info[0]: program %s, file %s, line %d, %s\n" \
150 " %s\n", *argv, __FILE__, __LINE__, \
151 "$Id$", (statement) ); \
154#define SUB( func, statusptr ) \
156 if ( (func), (statusptr)->statusCode ) { \
157 ERROR( TESTDRIVENDHOUGHC_ESUB, TESTDRIVENDHOUGHC_MSGESUB, \
158 "Function call \"" #func "\" failed:" ); \
159 return TESTDRIVENDHOUGHC_ESUB; \
166int main(
int argc,
char *argv[] )
185 UINT2 maxNBins, maxNBorders;
199 REAL8 patchSizeX, patchSizeY;
223 parRes.
f0Bin = f0Bin;
241 while ( arg < argc ) {
243 if ( !strcmp( argv[arg],
"-d" ) ) {
244 if ( argc > arg + 1 ) {
253 else if ( !strcmp( argv[arg],
"-o" ) ) {
254 if ( argc > arg + 1 ) {
264 else if ( !strcmp( argv[arg],
"-f" ) ) {
265 if ( argc > arg + 1 ) {
267 f0 = atof( argv[arg++] );
269 parRes.
f0Bin = f0Bin;
277 else if ( !strcmp( argv[arg],
"-p" ) ) {
278 if ( argc > arg + 2 ) {
280 alpha = atof( argv[arg++] );
281 delta = atof( argv[arg++] );
289 else if ( !strcmp( argv[arg],
"-s" ) ) {
290 if ( argc > arg + 2 ) {
322 xSide = parSize.
xSide;
323 ySide = parSize.
ySide;
378 for (
i = 0;
i < maxNBorders; ++
i ) {
399 for (
j = 0;
j < MOBSCOH; ++
j ) {
421 for (
j = 0;
j < MOBSCOH; ++
j ) {
457 for (
j = 0;
j < MOBSCOH; ++
j ) {
458 freqInd.
data[
j] = fBin + 2;
469 fp = fopen( fname,
"w" );
480 for (
k = ySide - 1;
k >= 0; --
k ) {
481 for (
i = 0;
i < xSide; ++
i ) {
495 for (
j = 0;
j < MOBSCOH; ++
j ) {
501 for (
i = 0;
i < maxNBorders; ++
i ) {
#define SUB(func, statusptr)
#define ERROR(code, msg, statement)
#define TESTDRIVENDHOUGHC_MSGEFILE
#define TESTDRIVENDHOUGHC_ENORM
#define TESTDRIVENDHOUGHC_EARG
#define TESTDRIVENDHOUGHC_MSGEBAD
#define TESTDRIVENDHOUGHC_EFILE
#define TESTDRIVENDHOUGHC_MSGEARG
#define TESTDRIVENDHOUGHC_MSGENORM
#define TESTDRIVENDHOUGHC_EBAD
void LALCheckMemoryLeaks(void)
static double double delta
int main(int argc, char **argv)
REAL8 HoughTT
Total Hough Map pixel type.
void LALHOUGHInitializeHT(LALStatus *status, HOUGHMapTotal *ht, HOUGHPatchGrid *patch)
This function initializes the total Hough map HOUGHMapTotal *ht to zero and checks consistency betwee...
void LALHOUGHConstructSpacePHMD(LALStatus *status, PHMDVectorSequence *phmdVS, HOUGHPeakGramVector *pgV, HOUGHptfLUTVector *lutV)
constructs the space of phmd PHMDVectorSequence *phmdVS, given a HOUGHPeakGramVector *pgV and HOUGHpt...
void LALHOUGHupdateSpacePHMDup(LALStatus *status, PHMDVectorSequence *phmdVS, HOUGHPeakGramVector *pgV, HOUGHptfLUTVector *lutV)
This function updates the space of phmd increasing the frequency phmdVS->fBinMin by one.
void LALHOUGHConstructHMT(LALStatus *status, HOUGHMapTotal *ht, UINT8FrequencyIndexVector *freqInd, PHMDVectorSequence *phmdVS)
Given PHMDVectorSequence *phmdVS, the space of phmd, and UINT8FrequencyIndexVector *freqInd,...
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.
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
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.
This structure contains a vector of peak-grams (for the different time stamps)
UINT4 length
number of elements
HOUGHPeakGram * pg
the Peakgrams
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.
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)
This structure contains a vector of partial look up tables (for the different time stamps)
HOUGHptfLUT * lut
the partial Look Up Tables
UINT4 length
number of elements
This structure contains a vector sequence of partial-Hough maps derivatives (for different time stamp...
UINT8 fBinMin
frequency index of smallest intrinsic frequency in circular buffer
UINT4 nfSize
number of different frequencies
REAL8 deltaF
frequency resolution
HOUGHphmd * phmd
the partial Hough map derivatives
UINT4 length
number of elements for each frequency
REAL8 delta
In the interval [ ].
This structure stores the frequency indexes of the partial-Hough map derivatives at different time st...
UINT8 * data
the frequency indexes
REAL8 deltaF
frequency resolution
UINT4 length
number of elements