20 #include <lal/HoughMap.h>
51 pointer = &( hd->
map[0]);
54 for (
k=0;
k< maxk; ++
k ){
103 pointer = &(ht->
map[0]);
104 for (
k=0;
k< maxk; ++
k ){
130 UINT2 lengthLeft,lengthRight, xSide,ySide;
150 for (
k=0;
k< ySide; ++
k ){
158 for (
k=0;
k< lengthLeft; ++
k){
166 yLower = (*borderP).
yLower;
167 yUpper = (*borderP).yUpper;
168 xPixel = &( (*borderP).xPixel[0] );
172 fprintf(stderr,
"WARNING: Fixing yLower (%d -> 0) [HoughMap.c %d]\n",
176 if (yUpper >= ySide) {
177 fprintf(stderr,
"WARNING: Fixing yUpper (%d -> %d) [HoughMap.c %d]\n",
178 yUpper, ySide-1, __LINE__);
182 for(
j=yLower;
j<=yUpper;++
j){
183 hd->
map[
j *(xSide+1) + xPixel[
j] ] += 1;
188 for (
k=0;
k< lengthRight; ++
k){
196 yLower = (*borderP).
yLower;
197 yUpper = (*borderP).yUpper;
198 xPixel = &( (*borderP).xPixel[0] );
202 fprintf(stderr,
"WARNING: Fixing yLower (%d -> 0) [HoughMap.c %d]\n",
206 if (yUpper >= ySide) {
207 fprintf(stderr,
"WARNING: Fixing yUpper (%d -> %d) [HoughMap.c %d]\n",
208 yUpper, ySide-1, __LINE__);
212 for(
j=yLower;
j<=yUpper;++
j){
213 hd->
map[
j*(xSide+1) + xPixel[
j] ] -= 1;
238 UINT2 lengthLeft,lengthRight, xSide,ySide;
262 for (
k=0;
k< ySide; ++
k ){
270 for (
k=0;
k< lengthLeft; ++
k){
278 yLower = (*borderP).
yLower;
279 yUpper = (*borderP).yUpper;
280 xPixel = &( (*borderP).xPixel[0] );
283 fprintf(stderr,
"WARNING: Fixing yLower (%d -> 0) [HoughMap.c %d]\n",
287 if (yUpper >= ySide) {
288 fprintf(stderr,
"WARNING: Fixing yUpper (%d -> %d) [HoughMap.c %d]\n",
289 yUpper, ySide-1, __LINE__);
293 for(
j=yLower;
j<=yUpper;++
j){
294 sidx =
j *(xSide+1) + xPixel[
j];
295 if ((sidx < 0) || (sidx >= ySide*(xSide+1))) {
296 fprintf(stderr,
"\nERROR: %s %d: map index out of bounds: %d [0..%d] j:%d xp[j]:%d\n",
297 __FILE__,__LINE__,sidx,ySide*(xSide+1),
j,xPixel[
j] );
300 hd->
map[sidx] += weight;
305 for (
k=0;
k< lengthRight; ++
k){
313 yLower = (*borderP).
yLower;
314 yUpper = (*borderP).yUpper;
315 xPixel = &( (*borderP).xPixel[0] );
318 fprintf(stderr,
"WARNING: Fixing yLower (%d -> 0) [HoughMap.c %d]\n",
322 if (yUpper >= ySide) {
323 fprintf(stderr,
"WARNING: Fixing yUpper (%d -> %d) [HoughMap.c %d]\n",
324 yUpper, ySide-1, __LINE__);
328 for(
j=yLower;
j<=yUpper;++
j){
329 sidx =
j*(xSide+1) + xPixel[
j];
330 if ((sidx < 0) || (sidx >= ySide*(xSide+1))) {
331 fprintf(stderr,
"\nERROR: %s %d: map index out of bounds: %d [0..%d] j:%d xp[j]:%d\n",
332 __FILE__,__LINE__,sidx,ySide*(xSide+1),
j,xPixel[
j] );
335 hd->
map[sidx] -= weight;
387 for (
j=0;
j< ySide; ++
j){
389 for (
i=0;
i<xSide; ++
i){
390 ht->
map[
j*xSide +
i] = ( accumulator += hd->
map[
j*(xSide+1) +
i]);
424 sourceProjected.
x = patch->
xCoor[xPos];
425 sourceProjected.
y = patch->
yCoor[yPos];
432 &sourceRotated, &sourceProjected ),
status );
436 sourceLocation, &sourceRotated, &skyPatchCenter ),
status );
#define ABORT(statusptr, code, mesg)
#define TRY(func, statusptr)
#define ATTATCHSTATUSPTR(statusptr)
#define ASSERT(assertion, statusptr, code, mesg)
#define DETATCHSTATUSPTR(statusptr)
#define INITSTATUS(statusptr)
#define RETURN(statusptr)
void LALHOUGHAddPHMD2HD_W(LALStatus *status, HOUGHMapDeriv *hd, HOUGHphmd *phmd)
Adds a hough map derivative into a total hough map derivative taking into account the weight of the p...
void LALStereo2SkyLocation(LALStatus *status, REAL8UnitPolarCoor *sourceLocation, UINT2 xPos, UINT2 yPos, HOUGHPatchGrid *patch, HOUGHDemodPar *parDem)
Find source sky location given stereographic coordinates indexes.
void LALHOUGHInitializeHD(LALStatus *status, HOUGHMapDeriv *hd)
This function initializes the Hough map derivative space HOUGHMapDeriv *hd to zero.
#define HOUGHMAPH_MSGESIZE
#define HOUGHMAPH_MSGESZMM
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...
#define HOUGHMAPH_MSGENULL
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...
void LALInvRotatePolarU(LALStatus *status, REAL8UnitPolarCoor *out, REAL8UnitPolarCoor *in, REAL8UnitPolarCoor *par)
void LALStereoInvProjectCart(LALStatus *status, REAL8UnitPolarCoor *out, REAL8Cart2Coor *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.
This structure stores the border of a circle clipped on the projected plane.
INT4 yLower
lower y pixel affected by this border and yUpper<yLower or yUpper<0 are possible
Demodulation parameters needed for the Hough transform; all coordinates are assumed to be with respec...
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
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 a partial Hough map derivative.
UINT2 lengthRight
Exact number of Right borders.
UINT2 lengthLeft
Exact number of Left borders.
HoughDT weight
First column border, containing the edge effects when clipping on a finite patch.
UCHAR * firstColumn
Number of elements of firstColumn.
HOUGHBorder ** rightBorderP
Pointers to borders.
HOUGHBorder ** leftBorderP
Pointers to borders.
Two dimensional Cartessian coordinates.
Polar coordinates of a unitary vector on the sphere.
REAL8 delta
In the interval [ ].