Changeset 18287 for trunk/psModules/src/imcombine/pmSubtractionMatch.c
- Timestamp:
- Jun 23, 2008, 12:41:08 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/imcombine/pmSubtractionMatch.c
r18202 r18287 117 117 pmSubtractionKernelsType type, int size, int spatialOrder, 118 118 const psVector *isisWidths, const psVector *isisOrders, 119 int inner, int ringsOrder, int binning, bool optimum, const psVector *optFWHMs, 120 int optOrder, float optThreshold, int iter, float rej, psMaskType maskBad, 121 psMaskType maskBlank, float badFrac, pmSubtractionMode mode) 119 int inner, int ringsOrder, int binning, float penalty, 120 bool optimum, const psVector *optFWHMs, int optOrder, float optThreshold, 121 int iter, float rej, psMaskType maskBad, psMaskType maskBlank, 122 float badFrac, pmSubtractionMode mode) 122 123 { 123 124 if (mode != PM_SUBTRACTION_MODE_2) { … … 320 321 if (optimum && (type == PM_SUBTRACTION_KERNEL_ISIS || type == PM_SUBTRACTION_KERNEL_GUNK)) { 321 322 kernels = pmSubtractionKernelsOptimumISIS(type, size, inner, spatialOrder, optFWHMs, optOrder, 322 stamps, footprint, optThreshold, mode);323 stamps, footprint, optThreshold, penalty, mode); 323 324 if (!kernels) { 324 325 psErrorClear(); … … 329 330 // Not an ISIS/GUNK kernel, or the optimum kernel search failed 330 331 kernels = pmSubtractionKernelsGenerate(type, size, spatialOrder, isisWidths, isisOrders, 331 inner, binning, ringsOrder, mode);332 inner, binning, ringsOrder, penalty, mode); 332 333 } 333 334 … … 450 451 // Generate image with convolution kernels 451 452 int fullSize = 2 * size + 1 + 1; // Full size of kernel 452 psImage *convKernels = psImageAlloc(5 * fullSize - 1, 5 * fullSize - 1, PS_TYPE_F32); 453 int imageSize = (2 * KERNEL_MOSAIC + 1) * fullSize; 454 psImage *convKernels = psImageAlloc((mode == PM_SUBTRACTION_MODE_DUAL ? 2 : 1) * 455 imageSize - 1 + 456 (mode == PM_SUBTRACTION_MODE_DUAL ? 4 : 0), 457 imageSize - 1, PS_TYPE_F32); 453 458 psImageInit(convKernels, NAN); 454 459 for (int j = -KERNEL_MOSAIC; j <= KERNEL_MOSAIC; j++) { … … 471 476 } 472 477 psFree(kernel); 478 479 if (mode == PM_SUBTRACTION_MODE_DUAL) { 480 kernel = pmSubtractionKernelImage(kernels, (float)i / (float)KERNEL_MOSAIC, 481 (float)j / (float)KERNEL_MOSAIC, 482 true); // Image of the kernel 483 if (!kernel) { 484 psError(PS_ERR_UNKNOWN, false, "Unable to generate kernel image."); 485 psFree(convKernels); 486 goto MATCH_ERROR; 487 } 488 489 if (psImageOverlaySection(convKernels, kernel, 490 (2 * KERNEL_MOSAIC + 1 + i + KERNEL_MOSAIC) * fullSize + 491 4, 492 (j + KERNEL_MOSAIC) * fullSize, "=") == 0) { 493 psError(PS_ERR_UNKNOWN, false, "Unable to overlay kernel image."); 494 psFree(kernel); 495 psFree(convKernels); 496 goto MATCH_ERROR; 497 } 498 psFree(kernel); 499 } 500 473 501 } 474 502 }
Note:
See TracChangeset
for help on using the changeset viewer.
