IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 34721 for trunk/psphot/src


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

In psphotStack when matching PSFs if an input fails to find stamps
mark it as not matched instead of faulting.
Skip radial aperture measurments for all fhwm in this case since
the convolved input is likely faulty anyways

Location:
trunk/psphot/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/psphot/src/psphotStackMatchPSFs.c

    r34404 r34721  
    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    }
  • trunk/psphot/src/psphotStackMatchPSFsUtils.c

    r34352 r34721  
    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    }
  • trunk/psphot/src/psphotStackReadout.c

    r34542 r34721  
    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.