IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 32131


Ignore:
Timestamp:
Aug 18, 2011, 6:40:25 PM (15 years ago)
Author:
mhuber
Message:

first test changes for convol choice

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/meh_branches/ppsub_test/psModules/src/imcombine/pmSubtractionEquation.c

    r30622 r32131  
    797797    stamp->normSquare2 = normSquare2;
    798798
    799     // psLogMsg ("psModules.imcombine", PS_LOG_DETAIL, "normValue: %f %f %f  (%f %f)\n", normI1, normI2, stamp->norm, normSquare1, normSquare2);
     799    //MEH
     800    psLogMsg ("psModules.imcombine", PS_LOG_DETAIL, "normValue: %f %f %f  (%f %f)\n", normI1, normI2, stamp->norm, normSquare1, normSquare2);
    800801
    801802    return true;
     
    13821383        float Myy = fluxY2 / fluxC1;
    13831384
     1385        //MEH uncomment and update
    13841386        // fprintf (stderr, "conv1, flux2: %f, Mx: %f, My: %f, Mxx: %f, Myy: %f, chisq: %f, npix: %d\n", flux2, Mx, My, Mxx, Myy, chisq, npix);
     1387        fprintf (stderr, "conv1, flux2: %f, fluxC1: %f, Mxx: %f, Myy: %f, chisqR: %f, npix: %d\n", flux2, fluxC1, Mxx, Myy, chisqR, npix);
    13851388        moment += Mxx + Myy;
    13861389    }
    13871390
    1388     // get the moments from convolved1
     1391    // get the moments from convolved2
    13891392    if (convolved2) {
    13901393        for (int y = residual->yMin; y <= residual->yMax; y++) {
     
    15461549            }
    15471550
    1548             // Generate the difference, residual, and convolved source images.  Note the we
     1551            // Generate the difference, residual, and convolved source images.  Note that we
    15491552            // accumulate the convolution of (A-B), so we need to replace it to generate the
    15501553            // images of the convolved source image.
     
    15541557                    residual->kernel[y][x] = difference->kernel[y][x] - convolved1->kernel[y][x];
    15551558                    convolved1->kernel[y][x] += source->kernel[y][x] * norm;
     1559
     1560                    //MEH
     1561                    //psLogMsg("psModules.imcombine", PS_LOG_INFO, "xy: %d %d, norm: %6.3f, bg: %6.3f, difference: %6.3f, target: %6.3f, source: %6.3f, residual: %6.3f, convolved1: %6.3f \n",x,y,norm,background,difference->kernel[y][x],target->kernel[y][x],source->kernel[y][x],residual->kernel[y][x],convolved1->kernel[y][x]);
    15561562                }
    15571563            }
     
    16511657        psFree (modelKernel);
    16521658    } else {
    1653         sumKernel2 = 1.0;
    1654     }
     1659        //MEH leave at 0 or make it small e to avoid x/0?
     1660//      sumKernel2 = 1.0;
     1661        sumKernel2 = 0.001;
     1662    }
     1663
     1664    //MEH if sumKernel2 not use essentially, then not need to be 2.0*?
    16551665
    16561666    // if we modify the chisq value by the (sumKernel1 + sumKernel2), we account for the
     
    16581668    // penalized by increasing the score somewhat.  the 0.01 value is not well-chosen.
    16591669    float orderFactor = 0.01 * kernels->spatialOrder;
    1660     float score = 2.0 * chisqRValue / (sumKernel1 + sumKernel2) + orderFactor;
    1661     psLogMsg("psModules.imcombine", PS_LOG_INFO, "chisq: %6.3f, chisqD: %6.3f, moment: %6.3f, sumKernel_1: %6.3f, sumKernel_2, score: %6.3f: %6.3f\n", chisqRValue, chisqDValue, momentValue, sumKernel1, sumKernel2, score);
     1670    //MEH
     1671    //float score = 2.0 * chisqRValue / (sumKernel1 + sumKernel2) + orderFactor;
     1672    float score = 2.0 * chisqRValue / (sqrt(sumKernel1) + sqrt(sumKernel2)) + orderFactor;
     1673    psLogMsg("psModules.imcombine", PS_LOG_INFO, "chisq: %6.3f, chisqD: %6.3f, moment: %6.3f, sumKernel_1: %6.3f, sumKernel_2: %6.3f, score: %6.3f\n", chisqRValue, chisqDValue, momentValue, sumKernel1, sumKernel2, score);
    16621674
    16631675    // save this result if it is the first or the best (skip if bestMatch is NULL)
Note: See TracChangeset for help on using the changeset viewer.