IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 34722


Ignore:
Timestamp:
Nov 27, 2012, 3:21:06 PM (14 years ago)
Author:
bills
Message:

In psphotStack if an input fails psf matching skip it completely for the radial aperture measurements since the convovled stack is likely no good and the measurements will be suspect.
Fix memory leak when empty extensions are found in cmf

Location:
tags/ipp-20121026
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • tags/ipp-20121026/psModules

  • tags/ipp-20121026/psModules/src/objects/pmSourceIO.c

    r34527 r34722  
    10281028        if (strcmp (xtension, "BINTABLE")) {
    10291029            psWarning ("no binary table in extension %s, skipping\n", dataname);
     1030            psFree(tableHeader);
    10301031            return false;
    10311032        }
     
    12421243    if (!xtension) psAbort("cannot read table type");
    12431244    if (strcmp (xtension, "BINTABLE")) {
     1245        psFree(tableHeader);
    12441246        psWarning ("no binary table in extension %s, skipping\n", xsrcname);
    12451247        return false;
     
    12811283    if (strcmp (xtension, "BINTABLE")) {
    12821284        psWarning ("no binary table in extension %s, skipping\n", extname);
     1285        psFree(tableHeader);
    12831286        return false;
    12841287    }
     
    13181321    if (strcmp (xtension, "BINTABLE")) {
    13191322        psWarning ("no binary table in extension %s, skipping\n", extname);
     1323        psFree(tableHeader);
    13201324        return false;
    13211325    }
  • tags/ipp-20121026/psphot

  • tags/ipp-20121026/psphot/src

  • tags/ipp-20121026/psphot/src/psphotStackImageLoop.c

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • tags/ipp-20121026/psphot/src/psphotStackMatchPSFs.c

    r34404 r34722  
    108108    bool notMatched = psMetadataLookupBool(NULL, readoutOut->analysis, "NOT.PSF.MATCHED");
    109109    if (notMatched) {
    110         if (!readoutOut->image) {
    111             // our images got freed in the matching process. Recreate them so that they
    112             // are available when sources are copied to this readout.
    113             readoutOut->image = psImageCopy(NULL, readoutSrc->image, PS_TYPE_F32);
    114             if (readoutSrc->variance) {
    115                 psFree(readoutOut->variance);
    116                 readoutOut->variance = psImageCopy(NULL, readoutSrc->variance, PS_TYPE_F32);
    117             }
    118             if (readoutSrc->mask) {
    119                 psFree(readoutOut->mask);
    120                 readoutOut->mask = psImageCopy(NULL, readoutSrc->mask, PS_TYPE_IMAGE_MASK);
    121             }
     110        psFree(readoutOut->image);
     111        readoutOut->image = psImageCopy(NULL, readoutSrc->image, PS_TYPE_F32);
     112        psFree(readoutOut->variance);
     113        if (readoutSrc->variance) {
     114            readoutOut->variance = psImageCopy(NULL, readoutSrc->variance, PS_TYPE_F32);
     115        }
     116        psFree(readoutOut->mask);
     117        if (readoutSrc->mask) {
     118            readoutOut->mask = psImageCopy(NULL, readoutSrc->mask, PS_TYPE_IMAGE_MASK);
    122119        }
    123120    }
  • tags/ipp-20121026/psphot/src/psphotStackMatchPSFsUtils.c

    r34352 r34722  
    303303        if (!pmSubtractionMatch(NULL, readoutOut, fake, readoutSrc, footprint, stride, regionSize, spacing, threshold, stampSources, stampsName, type, size, order, widthsCopy, orders, inner, ringsOrder, binning, penalty, optimum, optWidths, optOrder, optThresh, iter, rej, normFrac, sysError, skyErr, kernelError, covarFrac, maskVal, maskBad, maskPoor, poorFrac, badFrac, PM_SUBTRACTION_MODE_2)) {
    304304            int errorCode = psErrorCodeLast();
    305             if (errorCode == PM_ERR_SMALL_AREA) {
     305            if (errorCode == PM_ERR_SMALL_AREA || errorCode == PM_ERR_STAMPS) {
    306306                // failed to match but, don't fault. Just drop this input from measurements that need the
    307307                // matched readout.
     308                psErrorClear();
    308309                rejectReadout = true;
    309                 psLogMsg("psphot", PS_LOG_WARN, "PSF match failed for input %d. Too few pixels.", index);
     310                if (errorCode == PM_ERR_SMALL_AREA) {
     311                    psLogMsg("psphot", PS_LOG_WARN, "PSF match failed for input %d. Too few pixels.", index);
     312                } else if (errorCode == PM_ERR_STAMPS) {
     313                    psLogMsg("psphot", PS_LOG_WARN, "PSF match failed for input %d. Failed to find stamps.", index);
     314                }
    310315            } else {
    311316                psError(psErrorCodeLast(), false, "Unable to match images.");
     
    324329   
    325330    if (rejectReadout) {
     331        psMetadataAddBool(readoutSrc->analysis, PS_LIST_TAIL, "NOT.PSF.MATCHED", PS_META_REPLACE, "", true);
    326332        psMetadataAddBool(readoutOut->analysis, PS_LIST_TAIL, "NOT.PSF.MATCHED", PS_META_REPLACE, "", true);
    327333    } else {
     334        psMetadataAddBool(readoutSrc->analysis, PS_LIST_TAIL, "NOT.PSF.MATCHED", PS_META_REPLACE, "", false);
    328335        psMetadataAddBool(readoutOut->analysis, PS_LIST_TAIL, "NOT.PSF.MATCHED", PS_META_REPLACE, "", false);
    329336    }
  • tags/ipp-20121026/psphot/src/psphotStackReadout.c

    r34542 r34722  
    409409            }
    410410        }
     411        // mark any inputs that we want to skip the matched apertures for
     412        psphotStackSetInputsToSkip(config, view, STACK_CNV, true);
     413        psphotStackSetInputsToSkip(config, view, STACK_OUT, true);
    411414        psphotRadialApertures (config, view, STACK_CNV, 0); // entry 0 == unmatched
    412415        psMemDump("extmeas");
    413416
    414         // mark any inputs that we want to skip the matched apertures for
    415         psphotStackSetInputsToSkip(config, view, STACK_OUT, true);
    416417
    417418        int nRadialEntries = psphotStackMatchPSFsEntries(config, view, STACK_OUT);
     
    439440        }
    440441    }
     442    psphotStackSetInputsToSkip(config, view, STACK_CNV, false);
    441443    psphotStackSetInputsToSkip(config, view, STACK_OUT, false);
    442444
Note: See TracChangeset for help on using the changeset viewer.