IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 10, 2012, 3:44:12 PM (14 years ago)
Author:
bills
Message:

If one of the inputs to psphotStack fails the deconvolution limit cut don't
fault the run, instead proceed with the analysis but mark that input to
be skipped in the Radial Aperture section. This was a bit more complicated
than expected

File:
1 edited

Legend:

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

    r33841 r34136  
    310310    float deconv = psMetadataLookupF32(NULL, readoutOut->analysis, PM_SUBTRACTION_ANALYSIS_DECONV_MAX); // Max deconvolution fraction
    311311    if (deconv > deconvLimit) {
     312#if (1)
     313        // XXX: don't reject the image set
     314        psWarning("Maximum deconvolution fraction (%f) exceeds limit (%f) --- rejecting image for matched psf analysis%d\n", deconv, deconvLimit, index);
     315        psMetadataAddBool(readoutOut->analysis, PS_LIST_TAIL, "DECONV.OVERLIMIT", PS_META_REPLACE, "", true);
     316#else
    312317        psWarning("Maximum deconvolution fraction (%f) exceeds limit (%f) --- rejecting image %d\n", deconv, deconvLimit, index);
    313318        goto escape;
     319#endif
     320    } else {
     321        psMetadataAddBool(readoutOut->analysis, PS_LIST_TAIL, "DECONV.OVERLIMIT", PS_META_REPLACE, "", false);
    314322    }
    315323
     
    461469    return optWidths;
    462470}
     471
     472// Set input to be skipped if the decovolution fraction was overlimit. Use for radial apertures
     473// This interface can be potentiall be extended for other uses
     474bool psphotStackSetInputsToSkip(pmConfig *config, const pmFPAview *view, const char *filerule, bool set) {
     475    int num = psphotFileruleCount(config, filerule);
     476    bool status;
     477    int chisqNum = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.CHISQ.NUM");
     478    if (!status) chisqNum = -1;
     479    for (int i = 0; i < num; i++) {
     480        if (i == chisqNum) {
     481            continue;
     482        }
     483        pmFPAfile *file = pmFPAfileSelectSingle(config->files, filerule, i); // File of interest
     484        psAssert (file, "missing file?");
     485
     486        pmReadout *readout = pmFPAviewThisReadout(view, file->fpa);
     487        psAssert (readout, "missing readout?");
     488        if (set) {
     489            bool overLimit = psMetadataLookupBool(&status, readout->analysis, "DECONV.OVERLIMIT");
     490            psMetadataAddBool(readout->analysis, PS_LIST_TAIL, "PSPHOT.SKIP.INPUT", PS_META_REPLACE, "Skip analysis", overLimit);
     491        } else {
     492            psMetadataAddBool(readout->analysis, PS_LIST_TAIL, "PSPHOT.SKIP.INPUT", PS_META_REPLACE, "Skip analysis", false);
     493        }
     494    }
     495
     496    return true;
     497}
Note: See TracChangeset for help on using the changeset viewer.