IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 8, 2008, 10:11:20 AM (18 years ago)
Author:
Paul Price
Message:

Fixing API to be consistent with that used in reworked ppStackLoop.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/pap_branch_080207/ppStack/src/ppStackMatch.c

    r15850 r16373  
    1111//#define TESTING
    1212
    13 bool ppStackMatch(pmReadout *output, const pmReadout *input, const pmReadout *sourcesRO,
    14                   const pmPSF *psf, const pmConfig *config)
     13bool ppStackMatch(pmReadout *readout, const pmReadout *sourcesRO, const pmPSF *psf, const pmConfig *config)
    1514{
    1615    // Look up appropriate values from the ppSub recipe
     
    6867    pmReadout *fake = pmReadoutAlloc(NULL); // Fake readout with target PSF
    6968
    70     if (!pmReadoutFakeFromSources(fake, input->image->numCols, input->image->numRows, sources, NULL, NULL,
     69    if (!pmReadoutFakeFromSources(fake, readout->image->numCols, readout->image->numRows, sources, NULL, NULL,
    7170                                  psf, powf(10.0, -0.4 * maxMag), 0, false)) {
    7271        psError(PS_ERR_UNKNOWN, false, "Unable to generate fake image with target PSF.");
     
    8584
    8685    // Do the image matching
    87     if (!pmSubtractionMatch(output, NULL, input, fake, footprint, regionSize, spacing, threshold,
     86    pmReadout *output = pmReadoutAlloc(NULL); // Output readout, for holding results temporarily
     87    if (!pmSubtractionMatch(output, NULL, readout, fake, footprint, regionSize, spacing, threshold,
    8888                            sources, stampsName, type, size, order, widths, orders, inner, ringsOrder,
    8989                            binning, optimum, optWidths, optOrder, optThresh, iter, rej, maskBad,
     
    9292        psFree(fake);
    9393        psFree(optWidths);
     94        psFree(output);
    9495        return false;
    9596    }
     
    9798    psFree(optWidths);
    9899
     100    // Replace original images with convolved
     101    psFree(readout->image);
     102    psFree(readout->mask);
     103    psFree(readout->weight);
     104    readout->image  = psMemIncrRefCounter(output->image);
     105    readout->mask   = psMemIncrRefCounter(output->mask);
     106    readout->weight = psMemIncrRefCounter(output->weight);
     107    psFree(output);
     108
    99109    return true;
    100110}
Note: See TracChangeset for help on using the changeset viewer.