Provides structures and function prototypes required for the construction of look up tables that are the core for building the Hough maps.
History: Created by Sintes May 11, 2001 Modified by Badri Krishnan Feb 2003
Our goal is the construction of Hough maps. In order to produce them efficiently, the present implemetation makes use of lut
s. Here we provide the necessary routines for their construction and use.
In principle, the subroutines provided are valid for any Hough master equation of the form:
\[ \nu-F_0 =\vec\xi (t) \cdot (\hat n -\hat N )\, ,\]
where \( \nu \) is the measured frequency of the signal at time \( t \) , \( F_0 \) intrinsic frequency of the signal at that time, \( \hat n \) location of the souce in the sky, \( \hat N \) the center of the sky patch used in the demodulation procedure, and \( \vec\xi (t) \) any vector.
The form of this vector \( \vec\xi (t) \) depends on the demodulation procedure used in the previous step. In our case this corresponds to
\[\vec\xi (t) = \left( F_0+ \sum_k F_k \left[ \Delta T \right]^k\right) \frac{\vec v(t)}{c} + \left( \sum_k k F_k \left[ \Delta T \right]^{k-1}\right) \frac {\vec x(t)- \vec x(\hat t_0)}{c}\, ,\]
and
\[F_0 \equiv f_0 + \sum_k \Delta f_k \left[ \Delta T \right]^k \, , \]
where \( \vec v(t) \) is the velocity of the detector, \( \vec x(t) \) is the detector position, \( T_{\hat N}(t) \) is the time at the solar system barycenter (for a given sky location \( \hat N \) ), \( \Delta T \equiv T_{\hat N}(t)-T_{\hat N}(\hat t_0) \) , \( \Delta f_k = f_k-F_k \) the residual spin-down parameter, \( F_k \) the spin-down parameter used in the demodulation, and \( f_0 \) , \( f_k \) the intrinsic frequency and spin-down parameters of the source at time \( \hat t_0 \) .
Looking at the generic Hough master equation, one realizes that for a fixed time, a given value of \( F_0 \) , and a measured frequency \( \nu \) p(from a selected peak), the source could be located anywhere on a circle (whose center points in the same direction of \( \vec\xi (t) \) and is characterized by \( \phi \) , the angle between \( \hat n \) and \( \vec\xi \) ). Since the Hough transform is performed on a set of spectra with discrete frequencies, a peak on the spectrum appearing at \( \nu \) could correspond to any source with a demodulated frequency in a certain interval. As a consequence, the location of the sources compatible with \( F_0 \) and \( \nu \) is not a circle but an annulus with a certain width.
Our purpose is to map these annuli on a discrete space. An estimation of the average thickness of the annuli tells us that the vast majority of annuli will be very thin, and therefore our algorithm should not be optimized for drawing thick annuli but for thin ones. Also, the mapping implementation should be one with a uniform probability distribution in order to avoid discretization errors. In order to remove border effects, we use a biunivocal mapping, which requires that a pixel in a partial Hough map can belong only to one annulus, just touched by one peak of the spectrum. The criteria for the biunivocal mapping is that if and only if the center of the pixel is inside the annulus, then the pixel will be enhanced.
In order to simplify (reduce the computational cost of) this task we construct look up tables (lut
) where the borders of these annuli are marked for any possible \( \nu -F_0 \) value. Since we work on a discrete space these lut
are valid for many \( F_0 \) values.
At this point we have already chosen a sky tiling to produce the Hough map efficiently. It consists of changing coordinates so that the center of the patch is located at \( (0,-\pi/2) \) in ( \( \alpha-\delta \) ) (or in any other coordinate system), then we make use of the stereographic projection (see this figure) and we take horizontal and vertical lines on the projected plane at constant space separation. This projection is advantageous because it avoids distortions, i.e. the pixel size is almost constant independently of the sky location, and makes the algorithm simpler. The stereographic projection has the property to map circles on the celestial sphere to circles on the projected plane.
Data Structures | |
struct | HOUGHBorder |
This structure stores the border of a circle clipped on the projected plane. More... | |
struct | HOUGHBin2Border |
This structure stores the border indexes corresponding to one frequency bin plus the corrections to be added to the first column of the patch. More... | |
struct | HOUGHptfLUT |
This structure stores the patch-time-frequency look up table. More... | |
struct | HOUGHPatchGrid |
This structure stores patch-frequency grid information. More... | |
struct | HOUGHResolutionPar |
parameters needed for gridding the patch More... | |
struct | HOUGHSizePar |
required for constructing patch More... | |
struct | REAL8Cart3Coor |
Three dimensional Cartessian coordinates. More... | |
struct | REAL8Cart2Coor |
Two dimensional Cartessian coordinates. More... | |
struct | REAL8Polar2Coor |
Two dimensional polar coordinates. More... | |
struct | REAL8UnitPolarCoor |
Polar coordinates of a unitary vector on the sphere. More... | |
struct | HOUGHParamPLUT |
Parameters needed to construct the partial look up table. More... | |
struct | HOUGHDemodPar |
Demodulation parameters needed for the Hough transform; all coordinates are assumed to be with respect to the same reference system. More... | |
Typedefs | |
typedef INT2 | COORType |
To be changed to {INT2 COORType } if the number of pixels in the x-direction exceeds 255. More... | |
Macros | |
#define | MAX(A, B) (((A) < (B)) ? (B) : (A)) |
#define | MIN(A, B) (((A) < (B)) ? (A) : (B)) |
#define | cot(A) (1./tan(A)) |
Files | |
file | ConstructPLUT.c |
Construction of the look up table for generating partial Hough maps assuming the use of the stereographic projection. | |
file | NDParamPLUT.c |
Function that calculates the parameters needed for generating the look-up-table. | |
file | ParamPLUT.c |
Function that calculates the parameters needed for generating the look-up-table. | |
file | PatchGrid.c |
Function for tiling the sky-patch (on the projected plane). | |
file | Stereographic.c |
Routines to perform rotations on the celestial sphere and stereographic projection. | |
file | ConstructPLUTTest.c |
Tests the construction of the Look up Table (LUT ) | |
file | NDConstructPLUTTest.c |
Tests the construction of the Look up Table (LUT ) | |
Error Codes | |
#define | LUTH_ENULL 1 |
#define | LUTH_ESIZE 2 |
#define | LUTH_ESZMM 4 |
#define | LUTH_EINT 6 |
#define | LUTH_ESAME 8 |
#define | LUTH_EFREQ 10 |
#define | LUTH_EVAL 12 |
#define | LUTH_MSGENULL "Null pointer" |
#define | LUTH_MSGESIZE "Invalid input size" |
#define | LUTH_MSGESZMM "Size mismatch" |
#define | LUTH_MSGEINT "Invalid interval" |
#define | LUTH_MSGESAME "Input/Output data vectors are the same" |
#define | LUTH_MSGEFREQ "Invalid frequency" |
#define | LUTH_MSGEVAL "Invalid value" |
Constant declarations | |
#define | LINERR 0.001 |
Maximum `‘error’' (as a fraction of the width of the thinnest annulus) which allows to represent a circle by a line. More... | |
#define | PIXERR 0.5 |
Maximum `‘error’' (as a fraction of the width of the thinnest annulus) which allows to consider two border equivalents! It is relevant for determining the LUT frequency range validity. More... | |
#define | VEPI LAL_TWOPI * LAL_REARTH_SI / ( LAL_DAYSID_SI * LAL_C_SI ) |
Earth v_epicycle/c TO BE CHANGED DEPENDING ON DETECTOR. More... | |
#define | VTOT LAL_TWOPI * LAL_AU_SI / ( LAL_YRSID_SI * LAL_C_SI ) |
Total detector velocity/c TO BE CHANGED DEPENDING ON DETECTOR. More... | |
void LALHOUGHComputeSizePar | ( | LALStatus * | status, |
HOUGHSizePar * | out, | ||
HOUGHResolutionPar * | in | ||
) |
Definition at line 92 of file PatchGrid.c.
void LALHOUGHComputeNDSizePar | ( | LALStatus * | status, |
HOUGHSizePar * | out, | ||
HOUGHResolutionPar * | in | ||
) |
Definition at line 204 of file PatchGrid.c.
void LALHOUGHFillPatchGrid | ( | LALStatus * | status, |
HOUGHPatchGrid * | out, | ||
HOUGHSizePar * | par | ||
) |
Definition at line 331 of file PatchGrid.c.
void LALHOUGHCalcParamPLUT | ( | LALStatus * | status, |
HOUGHParamPLUT * | out, | ||
HOUGHSizePar * | sizePar, | ||
HOUGHDemodPar * | par | ||
) |
Definition at line 71 of file ParamPLUT.c.
void LALNDHOUGHParamPLUT | ( | LALStatus * | status, |
HOUGHParamPLUT * | out, | ||
HOUGHSizePar * | sizePar, | ||
HOUGHDemodPar * | par | ||
) |
Definition at line 72 of file NDParamPLUT.c.
void LALRotatePolarU | ( | LALStatus * | status, |
REAL8UnitPolarCoor * | out, | ||
REAL8UnitPolarCoor * | in, | ||
REAL8UnitPolarCoor * | par | ||
) |
Definition at line 97 of file Stereographic.c.
void LALInvRotatePolarU | ( | LALStatus * | status, |
REAL8UnitPolarCoor * | out, | ||
REAL8UnitPolarCoor * | in, | ||
REAL8UnitPolarCoor * | par | ||
) |
Definition at line 177 of file Stereographic.c.
void LALStereoProjectPolar | ( | LALStatus * | status, |
REAL8Polar2Coor * | out, | ||
REAL8UnitPolarCoor * | in | ||
) |
Definition at line 257 of file Stereographic.c.
void LALStereoProjectCart | ( | LALStatus * | status, |
REAL8Cart2Coor * | out, | ||
REAL8UnitPolarCoor * | in | ||
) |
Definition at line 290 of file Stereographic.c.
void LALStereoInvProjectPolar | ( | LALStatus * | status, |
REAL8UnitPolarCoor * | out, | ||
REAL8Polar2Coor * | in | ||
) |
Definition at line 325 of file Stereographic.c.
void LALStereoInvProjectCart | ( | LALStatus * | status, |
REAL8UnitPolarCoor * | out, | ||
REAL8Cart2Coor * | in | ||
) |
Definition at line 357 of file Stereographic.c.
void LALHOUGHConstructPLUT | ( | LALStatus * | status, |
HOUGHptfLUT * | lut, | ||
HOUGHPatchGrid * | patch, | ||
HOUGHParamPLUT * | par | ||
) |
Definition at line 149 of file ConstructPLUT.c.
#define LUTH_MSGESAME "Input/Output data vectors are the same" |
#define LINERR 0.001 |
#define PIXERR 0.5 |
#define VEPI LAL_TWOPI * LAL_REARTH_SI / ( LAL_DAYSID_SI * LAL_C_SI ) |