Changeset 15787
- Timestamp:
- Dec 11, 2007, 4:09:06 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/imcombine/pmSubtractionStamps.c
r15756 r15787 53 53 psFree(stamp->matrix2); 54 54 psFree(stamp->matrixX); 55 psFree(stamp->vector); 55 psFree(stamp->vector1); 56 psFree(stamp->vector2); 56 57 57 58 } … … 173 174 stamp->matrix2 = NULL; 174 175 stamp->matrixX = NULL; 175 stamp->vector = NULL; 176 stamp->vector1 = NULL; 177 stamp->vector2 = NULL; 176 178 177 179 return stamp; … … 348 350 if (!checkStampRegion(xPix, yPix, region)) { 349 351 // It's not in the big region 352 psTrace("psModules.imcombine", 9, "Rejecting input stamp (%d,%d) because outside region", 353 xPix, yPix); 350 354 continue; 351 355 } 352 356 if (!checkStampMask(xPix, yPix, subMask, mode)) { 353 357 // Not a good stamp 358 psTrace("psModules.imcombine", 9, "Rejecting input stamp (%d,%d) because bad mask", 359 xPix, yPix); 354 360 continue; 355 361 } 356 362 357 for (int j = 0; j < numStamps; j++) { 363 bool found = false; 364 for (int j = 0; j < numStamps && !found; j++) { 358 365 psRegion *subRegion = stamps->regions->data[j]; // Subregion of interest 359 366 if (checkStampRegion(xPix, yPix, subRegion)) { … … 362 369 363 370 int index = xList->n; // Index of new stamp candidate 371 372 psVectorExtend(xList, STAMP_LIST_BUFFER, 1); 373 psVectorExtend(yList, STAMP_LIST_BUFFER, 1); 374 psVectorExtend(fluxList, STAMP_LIST_BUFFER, 1); 375 364 376 xList->data.F32[index] = xStamp; 365 377 yList->data.F32[index] = yStamp; … … 371 383 } 372 384 373 psVectorExtend(xList, STAMP_LIST_BUFFER, 1); 374 psVectorExtend(yList, STAMP_LIST_BUFFER, 1); 375 psVectorExtend(fluxList, STAMP_LIST_BUFFER, 1); 376 377 break; 385 found = true; 386 psTrace("psModules.imcombine", 9, "Putting input stamp (%d,%d) into subregion %d", 387 xPix, yPix, j); 378 388 } 389 } 390 391 if (!found) { 392 psTrace("psModules.imcombine", 9, "Unable to find subregion for stamp (%d,%d)", 393 xPix, yPix); 379 394 } 380 395 } … … 563 578 564 579 565 pmSubtractionStampList *pmSubtractionStampsSetFromFile(const char *filename, const psImage * subMask,566 const ps Region *region, int footprint, float spacing,567 pmSubtractionMode mode)580 pmSubtractionStampList *pmSubtractionStampsSetFromFile(const char *filename, const psImage *image, 581 const psImage *subMask, const psRegion *region, 582 int footprint, float spacing, pmSubtractionMode mode) 568 583 { 569 584 PS_ASSERT_STRING_NON_EMPTY(filename, NULL); … … 583 598 psBinaryOp(y, y, "-", psScalarAlloc(1.0, PS_TYPE_F32)); 584 599 585 pmSubtractionStampList *stamps = pmSubtractionStampsSet(x, y, flux, NULL, subMask, region, footprint,600 pmSubtractionStampList *stamps = pmSubtractionStampsSet(x, y, flux, image, subMask, region, footprint, 586 601 spacing, mode); 587 602 psFree(data);
Note:
See TracChangeset
for help on using the changeset viewer.
