Changeset 26805
- Timestamp:
- Feb 6, 2010, 1:59:52 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/20091201/psModules/src/imcombine/pmSubtractionStamps.c
r26739 r26805 89 89 *fluxStamp = -INFINITY; // Flux of best stamp 90 90 91 // fprintf (stderr, "xMin, xMax: %d, %d -> ", xMin, xMax); 92 91 93 // Ensure we're not going to go outside the bounds of the image 92 94 xMin = PS_MAX(border, xMin); … … 94 96 yMin = PS_MAX(border, yMin); 95 97 yMax = PS_MIN(numRows - border - 1, yMax); 98 99 if (xMax < xMin) return false; 100 if (yMax < yMin) return false; 101 102 psAssert (xMin <= xMax, "x mismatch?"); 103 psAssert (yMin <= yMax, "y mismatch?"); 96 104 97 105 for (int y = yMin; y <= yMax; y++) { … … 425 433 426 434 // Search bounds 427 int xCentre = xList->data.F32[j] + 0.5, yCentre = yList->data.F32[j] +0.5;// Stamp centre435 int xCentre = xList->data.F32[j] - 0.5, yCentre = yList->data.F32[j] - 0.5;// Stamp centre 428 436 int search = footprint - size; // Search radius 429 437 int xMin = PS_MAX(border, xCentre - search); … … 434 442 goodStamp = stampSearch(&xStamp, &yStamp, &fluxStamp, image1, image2, thresh1, thresh2, 435 443 subMask, xMin, xMax, yMin, yMax, numCols, numRows, border); 444 // fprintf (stderr, "find: %d %d ==> %5.1f %5.1f (\n", xCentre, yCentre, xStamp, yStamp); 436 445 #else 437 446 // Only search the exact centre pixel … … 440 449 yList->data.F32[j], yList->data.F32[j], numCols, numRows, border); 441 450 #endif 442 // fprintf (stderr, "find: %d %d ==> %5.1f %5.1f\n", xCentre, yCentre, xStamp, yStamp); 451 if (0 && goodStamp) { 452 fprintf (stderr, "find: %6.1f < %6.1f < %6.1f, %6.1f < %6.1f %6.1f\n", 453 region->x0 + size, xStamp, region->x1 - size, 454 region->y0 + size, yStamp, region->y1 - size); 455 } 443 456 } 444 457 } else { … … 539 552 for (int i = 0; i < numStars; i++) { 540 553 float xStamp = x->data.F32[i], yStamp = y->data.F32[i]; // Coordinates of stamp 541 int xPix = xStamp + 0.5, yPix = yStamp +0.5; // Pixel coordinate of stamp554 int xPix = xStamp - 0.5, yPix = yStamp - 0.5; // Pixel coordinate of stamp 542 555 if (!checkStampRegion(xPix, yPix, region)) { 543 556 // It's not in the big region … … 768 781 bounds.x0, bounds.x1, bounds.y0, bounds.y1); 769 782 770 int x = stamp->x + 0.5, y = stamp->y + 0.5; // Stamp coordinates 783 int x = stamp->x - 0.5, y = stamp->y - 0.5; // Stamp coordinates 784 // fprintf (stderr, "stamp: %5.1f %5.1f == %d %d (size: %d)\n", stamp->x, stamp->y, x, y, size); 785 771 786 if (x < bounds.x0 + size || x > bounds.x1 - size || y < bounds.y0 + size || y > bounds.y1 - size) { 772 787 psError(PS_ERR_UNKNOWN, false, "Stamp %d (%d,%d) is within the region border.\n", i, x, y); 773 788 return false; 774 789 } 775 // fprintf (stderr, "stamp: %5.1f %5.1f == %d %d\n", stamp->x, stamp->y, x, y);776 790 777 791 // Catch memory leaks --- these should have been freed and NULLed before
Note:
See TracChangeset
for help on using the changeset viewer.
