IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 30400


Ignore:
Timestamp:
Jan 27, 2011, 4:47:32 PM (15 years ago)
Author:
eugene
Message:

add option to generate sum of matched images (not diff); straight average of covars, not weighted

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20101205/ppSub/src/ppSubReadoutSubtract.c

    r30285 r30400  
    3131
    3232    bool reverse = psMetadataLookupBool(&mdok, config->arguments, "REVERSE"); // Reverse sense of subtraction?
     33    bool addPair = psMetadataLookupBool(&mdok, recipe, "ADD.NOT.SUBTRACT"); // add instead of subtracting
    3334
    3435    pmFPAview *view = ppSubViewReadout(); // View to readout
     
    4748    // Do the actual subtraction
    4849    pmReadout *outRO = pmFPAfileThisReadout(config->files, view, "PPSUB.OUTPUT");
    49     outRO->image = (psImage*)psBinaryOp(outRO->image, minuend->image, "-", subtrahend->image);
     50
     51    if (addPair) {
     52        outRO->image = (psImage*)psBinaryOp(outRO->image, minuend->image, "+", subtrahend->image);
     53    } else {
     54        outRO->image = (psImage*)psBinaryOp(outRO->image, minuend->image, "-", subtrahend->image);
     55    }
    5056    outRO->mask = (psImage*)psBinaryOp(outRO->mask, minuend->mask, "|", subtrahend->mask);
    5157    outRO->variance = (psImage*)psBinaryOp(outRO->variance, minuend->variance, "+", subtrahend->variance);
     
    7076    psFree(rng);
    7177
     78    // XXX EAM : I suspect that the weighted averaging is giving the wrong answer for
     79    // single-direction PSF matching (and maybe DUAL as well).  I am testing the difference by
     80    // generating A+B images instead of A-B images and then checking the significance of the
     81    // sources in the image
     82
    7283    // Combine the covariances
    7384    // These are weighted by the appropriate mean variance.  This is probably not perfectly correct, but it
     
    7990    covarWeights->data.F32[0] = minuendVar;
    8091    covarWeights->data.F32[1] = subtrahendVar;
     92# if (0)   
    8193    outRO->covariance = psImageCovarianceAverageWeighted(covars, covarWeights);
     94# else
     95    outRO->covariance = psImageCovarianceAverage(covars);
     96# endif
    8297    psFree(covars);
    8398    psFree(covarWeights);
Note: See TracChangeset for help on using the changeset viewer.