IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 14, 2010, 8:20:14 PM (15 years ago)
Author:
bills
Message:

get PEAKS_POS2_NSIGMA_LIMIT from recipe not hard coded value of 25`:x

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppSub/src/ppSubLoop.c

    r29937 r30040  
    7070    }
    7171    if (data->forcedPhot2) {
     72        // Change the recipe to use a higher nsigma limit and quit after pass1
     73        psMetadata *recipe = psMetadataLookupPtr (NULL, config->recipes, PSPHOT_RECIPE);
     74
     75        psF32 nsigma_peak_save = psMetadataLookupF32 (NULL, recipe, "PEAKS_NSIGMA_LIMIT");
     76        char *breakPt_save =  psMetadataLookupStr (NULL, recipe, "BREAK_POINT");
     77
     78        bool mdok;
     79        psF32 pos2_nsigma_peak = psMetadataLookupF32 (&mdok, recipe, "PEAKS_POS2_NSIGMA_LIMIT");
     80        if (!mdok) {
     81            psWarning("PEAKS_POS2_NSIGMA_LIMIT not found in recipe. Will use 25.\n");
     82            pos2_nsigma_peak = 25.;
     83        }
     84        psMetadataAddF32(recipe, PS_LIST_TAIL, "PEAKS_NSIGMA_LIMIT", PS_META_REPLACE, "", pos2_nsigma_peak);
     85        psMetadataAddStr(recipe, PS_LIST_TAIL, "BREAK_POINT", PS_META_REPLACE, "", "PASS1");
     86
    7287        bool foundDetections = false;
    7388        if (!ppSubInputDetections(&foundDetections, "PPSUB.POS2.SOURCES", "PPSUB.REF", data)) {
    7489            psError(psErrorCodeLast(), false, "Unable to measure positive detections (2)");
    75             return false;
    76         }
     90            psMetadataAddF32(recipe, PS_LIST_TAIL, "PEAKS_NSIGMA_LIMIT", PS_META_REPLACE, "", nsigma_peak_save);
     91            psMetadataAddStr(recipe, PS_LIST_TAIL, "BREAK_POINT", PS_META_REPLACE, "", breakPt_save);
     92            return false;
     93        }
     94        psMetadataAddF32(recipe, PS_LIST_TAIL, "PEAKS_NSIGMA_LIMIT", PS_META_REPLACE, "", nsigma_peak_save);
     95        psMetadataAddStr(recipe, PS_LIST_TAIL, "BREAK_POINT", PS_META_REPLACE, "", breakPt_save);
    7796        // if nothing was found, don't bother doing the forced photometry below
    7897        if (!foundDetections) {
    79             psWarning ("no sources found in positive image 1, skipping forced photometry");
    80             data->forcedPhot1 = false;
     98            psWarning ("no sources found in positive image 2, skipping forced photometry");
     99            data->forcedPhot2 = false;
    81100        }
    82101    }
Note: See TracChangeset for help on using the changeset viewer.