IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 23, 2008, 12:41:08 PM (18 years ago)
Author:
Paul Price
Message:

Merging in dual-convolution development branch.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/imcombine/pmSubtractionMatch.c

    r18202 r18287  
    117117                        pmSubtractionKernelsType type, int size, int spatialOrder,
    118118                        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)
    122123{
    123124    if (mode != PM_SUBTRACTION_MODE_2) {
     
    320321            if (optimum && (type == PM_SUBTRACTION_KERNEL_ISIS || type == PM_SUBTRACTION_KERNEL_GUNK)) {
    321322                kernels = pmSubtractionKernelsOptimumISIS(type, size, inner, spatialOrder, optFWHMs, optOrder,
    322                                                           stamps, footprint, optThreshold, mode);
     323                                                          stamps, footprint, optThreshold, penalty, mode);
    323324                if (!kernels) {
    324325                    psErrorClear();
     
    329330                // Not an ISIS/GUNK kernel, or the optimum kernel search failed
    330331                kernels = pmSubtractionKernelsGenerate(type, size, spatialOrder, isisWidths, isisOrders,
    331                                                        inner, binning, ringsOrder, mode);
     332                                                       inner, binning, ringsOrder, penalty, mode);
    332333            }
    333334
     
    450451                // Generate image with convolution kernels
    451452                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);
    453458                psImageInit(convKernels, NAN);
    454459                for (int j = -KERNEL_MOSAIC; j <= KERNEL_MOSAIC; j++) {
     
    471476                        }
    472477                        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
    473501                    }
    474502                }
Note: See TracChangeset for help on using the changeset viewer.