IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 34136


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

Location:
trunk/psphot/src
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/psphot/src/psphot.h

    r34086 r34136  
    419419// bool loadKernel (pmConfig *config, pmReadout *readoutCnv, psphotStackOptions *options, int index);
    420420
     421bool psphotStackSetInputsToSkip(pmConfig *config, const pmFPAview *view, const char *filerule, bool set) ;
     422
    421423bool psphotStackRenormaliseVariance(const pmConfig *config, pmReadout *readout);
    422424
  • trunk/psphot/src/psphotChoosePSF.c

    r32348 r34136  
    4747    if (psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.PSF")) {
    4848        psLogMsg ("psphot", PS_LOG_DETAIL, "psf model supplied for input file %d", index);
     49        return true;
     50    }
     51
     52    if (psMetadataLookupBool (&status, readout->analysis, "PSPHOT.SKIP.INPUT")) {
     53        psLogMsg ("psphot", PS_LOG_DETAIL, "skipping choose PSF for input file %d", index);
    4954        return true;
    5055    }
  • trunk/psphot/src/psphotFitSourcesLinear.c

    r34086 r34136  
    5050        pmReadout *readout = pmFPAviewThisReadout(view, file->fpa);
    5151        psAssert (readout, "missing readout?");
     52
     53        if (psMetadataLookupBool (&status, readout->analysis, "PSPHOT.SKIP.INPUT")) {
     54            psLogMsg ("psphot", PS_LOG_DETAIL, "skipping fit sources for input file %d", i);
     55            continue;
     56        }
     57
    5258
    5359        pmDetections *detections = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.DETECTIONS");
  • trunk/psphot/src/psphotRadialApertures.c

    r33089 r34136  
    7171    pmReadout *readout = pmFPAviewThisReadout(view, file->fpa);
    7272    psAssert (readout, "missing readout?");
     73   
     74    if (psMetadataLookupBool (&status, readout->analysis, "PSPHOT.SKIP.INPUT")) {
     75        psLogMsg ("psphot", PS_LOG_DETAIL, "skipping radial aptertures for input file %d", index);
     76        return true;
     77    }
     78
    7379
    7480    pmDetections *detections = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.DETECTIONS");
  • trunk/psphot/src/psphotReplaceUnfit.c

    r33980 r34136  
    5555    pmReadout *readout = pmFPAviewThisReadout(view, file->fpa);
    5656    psAssert (readout, "missing readout?");
     57
     58    if (psMetadataLookupBool (&status, readout->analysis, "PSPHOT.SKIP.INPUT")) {
     59        psLogMsg ("psphot", PS_LOG_DETAIL, "skipping replace all sources for input file %d", index);
     60        return true;
     61    }
    5762
    5863    pmDetections *detections = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.DETECTIONS");
     
    304309    psAssert (readout, "missing readout?");
    305310
     311    if (psMetadataLookupBool (&status, readout->analysis, "PSPHOT.SKIP.INPUT")) {
     312        psLogMsg ("psphot", PS_LOG_DETAIL, "skipping reset models for input file %d", index);
     313        return true;
     314    }
     315
     316
    306317    // XXX the sources have already been copied (merge into here?)
    307318    pmDetections *detections = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.DETECTIONS");
  • trunk/psphot/src/psphotStackMatchPSFs.c

    r32868 r34136  
    8787    }
    8888
    89     // copy the header data from Src to Out
    90     // pmHDU *hduSrc = pmHDUFromReadout(readoutSrc);
    91     // psAssert (hduSrc, "input missing hdu?");
    92 
    93 
    9489    // set NAN pixels to 'SAT'
    9590    psImageMaskType maskSat = pmConfigMaskGet("SAT", config);
     
    116111    // save the output fwhm values in the readout->analysis.  we may have / will have multiple output PSF sizes,
    117112    // so we save this in a vector.  if the vector is not yet defined, create it
     113    // Skip this if the readout deconvolution fraction was over the limit.
    118114    // NOTE: fwhmValues as defined here has 1 + nMatched PSF : 0 == unmatched
    119115    psVector *fwhmValues = psVectorAllocEmpty(10, PS_TYPE_F32);
    120116    psVectorAppend(fwhmValues, NAN); // XXX this corresponds to the unmatched image set
    121     for (int i = 0; i < options->targetSeeing->n; i++) {
    122         psVectorAppend(fwhmValues, options->targetSeeing->data.F32[i]);
     117
     118    bool overLimit = psMetadataLookupBool(NULL, readoutOut->analysis, "DECONV.OVERLIMIT");
     119    if (!overLimit) {
     120        for (int i = 0; i < options->targetSeeing->n; i++) {
     121            psVectorAppend(fwhmValues, options->targetSeeing->data.F32[i]);
     122        }
    123123    }
    124124    psMetadataAddVector(readoutSrc->analysis, PS_LIST_TAIL, "STACK.PSF.FWHM.VALUES", PS_META_REPLACE, "PSF sizes", fwhmValues);
  • trunk/psphot/src/psphotStackMatchPSFsNext.c

    r32996 r34136  
    77    int nRadialEntries = 0;
    88
    9     // find the currently selected readout
    10     pmFPAfile *file = pmFPAfileSelectSingle(config->files, filerule, 0); // File of interest
    11     psAssert (file, "missing file?");
     9    // find the numer of fwhmValues in the first non-skipped input
     10    int num = psphotFileruleCount(config, filerule);
     11    for (int i=0; i<num; i++) {
     12        pmFPAfile *file = pmFPAfileSelectSingle(config->files, filerule, i); // File of interest
     13        psAssert (file, "missing file?");
    1214   
    13     pmReadout *readout = pmFPAviewThisReadout(view, file->fpa);
    14     psAssert (readout, "missing readout?");
    15    
    16     bool status = false;
    17     psVector *fwhmValues = psMetadataLookupVector(&status, readout->analysis, "STACK.PSF.FWHM.VALUES");
    18     if (!fwhmValues) {
    19         return 1;
     15        pmReadout *readout = pmFPAviewThisReadout(view, file->fpa);
     16        psAssert (readout, "missing readout?");
     17        bool status = false;
     18        if (!psMetadataLookupBool (&status, readout->analysis, "PSPHOT.SKIP.INPUT")) {
     19            psVector *fwhmValues = psMetadataLookupVector(&status, readout->analysis, "STACK.PSF.FWHM.VALUES");
     20            if (fwhmValues) {
     21                nRadialEntries = fwhmValues->n;
     22            } else {
     23                nRadialEntries = 1;
     24            }
     25            break;
     26        }
    2027    }
    21    
    22     nRadialEntries = fwhmValues->n;
    2328    return nRadialEntries;
    2429}
     
    6065    pmReadout *readout = pmFPAviewThisReadout(view, file->fpa);
    6166    psAssert (readout, "missing readout?");
     67
     68    if (psMetadataLookupBool (&status, readout->analysis, "PSPHOT.SKIP.INPUT")) {
     69        psLogMsg("psphot", PS_LOG_INFO, "skipping smooth %d to next psf", index);
     70        return true;
     71    }
    6272
    6373    psLogMsg("psphot", PS_LOG_INFO, "smooth %d to next psf", index);
  • 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.