IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 34492


Ignore:
Timestamp:
Oct 2, 2012, 11:18:35 AM (14 years ago)
Author:
eugene
Message:

attempt to reinsert sources on the second pass (actually on the "not-first-pass"). However, it is not an error for no sources to be present if no sources are added and/or subtracted, the significance image will not be regenerated

Location:
trunk/psphot/src
Files:
4 edited

Legend:

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

    r34418 r34492  
    3434static int Nmasked = 0;
    3535
     36// the return state indicates if any sources were actually replaced
    3637bool psphotAddOrSubNoiseReadout (pmConfig *config, const pmFPAview *view, const char *filerule, int index, psMetadata *recipe, bool add) {
    3738
     
    5152
    5253    psArray *sources = detections->allSources;
    53     //psAssert (sources, "missing sources?");
    54     // if no work, should just return true
    55     if (!sources) return true;
     54    // if no work to do, should just return true
     55    if (!sources) return false;
    5656
    5757    psTimerStart ("psphot.noise");
     
    7474
    7575    if (SIZE <= 0) {
    76        return true;
     76       return false;
    7777    }
    7878
  • trunk/psphot/src/psphotDeblendSatstars.c

    r34418 r34492  
    10481048}
    10491049
     1050// the return state indicates if any sources were actually subtracted
    10501051bool psphotAddOrSubSatstarsReadout (pmConfig *config, const pmFPAview *view, const char *filerule, int fileIndex, psMetadata *recipe, bool add) {
    10511052
    10521053    bool status;
     1054    bool modified = false;
    10531055
    10541056    psTimerStart ("psphot.deblend.sat");
     
    10651067
    10661068    psArray *sources = detections->allSources;
    1067     psAssert (sources, "missing sources?");
     1069    // if no work to do, should just return false
     1070    if (!sources) return false;
    10681071
    10691072    if (!sources->n) {
    10701073        psLogMsg ("psphot", PS_LOG_INFO, "no sources, skipping satstar blend");
    1071         return true;
     1074        return false;
    10721075    }
    10731076
     
    10821085        if (!(source->mode2 & PM_SOURCE_MODE2_SATSTAR_PROFILE)) continue;
    10831086
     1087        // tell the calling function that we modified the image
     1088        modified = true;
     1089
    10841090        if (!psphotSatstarProfileOp (source, maskVal, 1.0, 0, add)) continue;
    10851091    }
    10861092
    10871093    psLogMsg ("psphot", PS_LOG_DETAIL, "satstar op: %f sec\n", psTimerMark ("psphot.deblend.sat"));
    1088     return true;
     1094    return modified;
    10891095}
    10901096
  • trunk/psphot/src/psphotFindDetections.c

    r34418 r34492  
    7171    }
    7272
     73    // first pass vs other: if this is the first pass, the code will use PEAKS_NSIGMA_LIMIT and
     74    // only attempt to detect PEAKS_NMAX entries.  If 'firstPass' is false, the code will
     75    // attempt to replace the subtracted sources in order to measure the footprints.  After
     76    // replacement, it is necessary to regenerate the significance image.  If no sources are
     77    // available, the code will skip the significance image regeneration step.
     78
    7379    bool replaceSourcesForFootprints = false;
    7480    if (firstPass) {
     
    126132    if (useFootprints) {
    127133        if (replaceSourcesForFootprints) {
     134            bool modified = false;
    128135            // subtract the noise for all sources including satstars
    129             psphotAddOrSubNoiseReadout(config, view, filerule, index, recipe, false);
    130             psphotReplaceAllSourcesReadout (config, view, filerule, index, recipe, false);
     136            modified |= psphotAddOrSubNoiseReadout(config, view, filerule, index, recipe, false);
     137            modified | psphotReplaceAllSourcesReadout (config, view, filerule, index, recipe, false);
    131138
    132139            // add in the satstars
    133             psphotAddOrSubSatstarsReadout (config, view, filerule, index, recipe, true);
     140            modified |= psphotAddOrSubSatstarsReadout (config, view, filerule, index, recipe, true);
    134141
    135             psFree (significance);
    136             significance = psphotSignificanceImage (readout, recipe, maskVal);
     142            if (modified) {
     143                psFree (significance);
     144                significance = psphotSignificanceImage (readout, recipe, maskVal);
     145            }
    137146
    138147            // display the significance image
  • trunk/psphot/src/psphotReplaceUnfit.c

    r34136 r34492  
    4343}
    4444
     45// the return state indicates if any sources were actually replaced
    4546bool psphotReplaceAllSourcesReadout (pmConfig *config, const pmFPAview *view, const char *filename, int index, psMetadata *recipe, bool ignoreState) {
    4647
     
    5859    if (psMetadataLookupBool (&status, readout->analysis, "PSPHOT.SKIP.INPUT")) {
    5960        psLogMsg ("psphot", PS_LOG_DETAIL, "skipping replace all sources for input file %d", index);
    60         return true;
     61        return false;
    6162    }
    6263
     
    6566
    6667    psArray *sources = detections->allSources;
    67     //psAssert (sources, "missing sources?");
    68     if (!sources) return true;
     68    // if no work to do, should just return false
     69    if (!sources) return false;
    6970
    7071    // user-defined masks to test for good/bad pixels (build from recipe list if not yet set)
Note: See TracChangeset for help on using the changeset viewer.