IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 5, 2010, 1:38:43 PM (16 years ago)
Author:
eugene
Message:

updates to psphot APIs to enable stack photometry

Location:
branches/eam_branches/20091201/psphot
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/20091201/psphot

  • branches/eam_branches/20091201/psphot/src/psphotEfficiency.c

    r26705 r26788  
    66//#define TESTING
    77
     8
     9# if 0
    810
    911// Calculate the limiting magnitude for an image
     
    146148}
    147149
     150# endif
     151
     152bool psphotEfficiency (pmConfig *config, const pmFPAview *view)
     153{
     154    bool status = true;
     155
     156    // select the appropriate recipe information
     157    psMetadata *recipe  = psMetadataLookupPtr (&status, config->recipes, PSPHOT_RECIPE);
     158    psAssert (recipe, "missing recipe?");
     159
     160    int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
     161    psAssert (status, "programming error: must define PSPHOT.INPUT.NUM");
     162
     163    // loop over the available readouts
     164    for (int i = 0; i < num; i++) {
     165        if (!psphotEfficiencyReadout (config, view, "PSPHOT.INPUT", i, recipe)) {
     166            psError (PSPHOT_ERR_CONFIG, false, "failed to measure detection efficiency for PSPHOT.INPUT entry %d", i);
     167            return false;
     168        }
     169    }
     170    return true;
     171}
    148172
    149173// Determine detection efficiency
    150 bool psphotEfficiency(pmConfig *config, pmReadout *readout, const pmFPAview *view, const pmPSF *psf,
    151                 psMetadata *recipe, const psArray *realSources)
     174bool psphotEfficiencyReadout(pmConfig *config, const pmFPAview *view, const char *filename, int index, psMetadata *recipe)
    152175{
     176# if 0
     177    bool status = true;
     178
     179    psTimerStart("psphot.fake");
     180
     181    // find the currently selected readout
     182    pmFPAfile *file = pmFPAfileSelectSingle(config->files, filename, index); // File of interest
     183    psAssert (file, "missing file?");
     184
     185    pmReadout *readout = pmFPAviewThisReadout(view, file->fpa);
     186    psAssert (readout, "missing readout?");
     187
     188    pmDetections *detections = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.DETECTIONS");
     189    psAssert (detections, "missing detections?");
     190
     191    psArray *realSources = detections->allSources;
     192    psAssert (realSources, "missing sources?");
     193
     194    // XXX do we need to skip this step if we do not have a psf?
     195    pmPSF *psf = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.PSF");
     196    psAssert (psf, "missing psf?");
     197
    153198    PM_ASSERT_READOUT_NON_NULL(readout, false);
    154199    PM_ASSERT_READOUT_IMAGE(readout, false);
    155200    PS_ASSERT_PTR_NON_NULL(psf, false);
    156201    PS_ASSERT_METADATA_NON_NULL(recipe, false);
    157     PS_ASSERT_ARRAY_NON_NULL(realSources, false);
    158 
    159     psTimerStart("psphot.fake");
    160202
    161203    // Collect recipe information
     
    200242    // remove all sources, adding noise for subtracted sources
    201243    psphotRemoveAllSources(realSources, recipe);
    202     //    psphotAddNoise(readout, realSources, recipe);
     244    // psphotAddNoise(readout, realSources, recipe);
    203245
    204246
     
    474516    psLogMsg("psphot", PS_LOG_INFO, "Detection efficiency: %lf sec\n", psTimerClear("psphot.fake"));
    475517
     518# endif
    476519
    477520    return true;
Note: See TracChangeset for help on using the changeset viewer.