IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 26, 2010, 5:10:34 PM (16 years ago)
Author:
eugene
Message:

various API fixes for multi-inputs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/psphot.stack.20100120/src/psphotEfficiency.c

    r26266 r26688  
    149149
    150150
     151bool psphotEfficiency (pmConfig *config, const pmFPAview *view)
     152{
     153    bool status = true;
     154
     155    // select the appropriate recipe information
     156    psMetadata *recipe  = psMetadataLookupPtr (&status, config->recipes, PSPHOT_RECIPE);
     157    psAssert (recipe, "missing recipe?");
     158
     159    int num = psMetadataAddS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
     160    psAssert (status, "programming error: must define PSPHOT.INPUT.NUM");
     161
     162    // loop over the available readouts
     163    for (int i = 0; i < num; i++) {
     164        if (!psphotReadout (config, view, "PSPHOT.INPUT", i, recipe)) {
     165            psError (PSPHOT_ERR_CONFIG, false, "failed on saturated star deblend analysis for PSPHOT.INPUT entry %d", i);
     166            return false;
     167        }
     168    }
     169    return true;
     170}
     171
    151172// Determine detection efficiency
    152 bool psphotEfficiency(pmConfig *config, pmReadout *readout, const pmFPAview *view, const pmPSF *psf,
    153                 psMetadata *recipe, const psArray *realSources)
     173bool psphotEfficiencyReadout(pmConfig *config, const pmFPAview *view, const char *filename, int index, psMetadata *recipe)
    154174{
     175    psTimerStart("psphot.fake");
     176
     177    // find the currently selected readout
     178    pmFPAfile *file = pmFPAfileSelectSingle(config->files, filename, index); // File of interest
     179    psAssert (readout, "missing file?");
     180
     181    pmReadout *readout = pmFPAviewThisReadout(view, file->fpa);
     182    psAssert (readout, "missing readout?");
     183
     184    pmDetections *detections = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.DETECTIONS");
     185    psAssert (detections, "missing detections?");
     186
     187    psArray *realSources = detections->allSources;
     188    psAssert (realSources, "missing sources?");
     189
     190    // XXX do we need to skip this step if we do not have a psf?
     191    pmPSF *psf = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.PSF");
     192    psAssert (psf, "missing psf?");
     193
    155194    PM_ASSERT_READOUT_NON_NULL(readout, false);
    156195    PM_ASSERT_READOUT_IMAGE(readout, false);
    157196    PS_ASSERT_PTR_NON_NULL(psf, false);
    158197    PS_ASSERT_METADATA_NON_NULL(recipe, false);
    159     PS_ASSERT_ARRAY_NON_NULL(realSources, false);
    160 
    161     psTimerStart("psphot.fake");
    162198
    163199    // Collect recipe information
     
    202238    // remove all sources, adding noise for subtracted sources
    203239    psphotRemoveAllSources(realSources, recipe);
    204     //    psphotAddNoise(readout, realSources, recipe);
     240    // psphotAddNoise(readout, realSources, recipe);
    205241
    206242
Note: See TracChangeset for help on using the changeset viewer.