IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 20, 2010, 12:59:49 PM (17 years ago)
Author:
eugene
Message:

updating code so more functions can handle the multi-input concept

File:
1 edited

Legend:

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

    r20453 r26643  
    11# include "psphotInternal.h"
    22
    3 bool psphotBasicDeblend (psArray *sources, psMetadata *recipe) {
     3bool psphotBasicDeblend (pmConfig *config, const pmFPAview *view, const char *filename, int index) {
    44
    55    int N;
     
    88    pmSource *source, *testSource;
    99
     10    psTimerStart ("psphot.deblend.basic");
     11
    1012    int Nblend = 0;
    1113
    12     psTimerStart ("psphot.deblend.basic");
     14    // find the currently selected readout
     15    pmFPAfile *file = pmFPAfileSelectSingle(config->files, filename, index); // File of interest
     16    psAssert (readout, "missing file?");
     17
     18    pmReadout *readout = pmFPAviewThisReadout(view, file->fpa);
     19    psAssert (readout, "missing readout?");
     20
     21    psArray *sources = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.SOURCES");
     22    psAssert (sources, "missing sources?");
     23
     24    // select the appropriate recipe information
     25    psMetadata *recipe  = psMetadataLookupPtr (&status, config->recipes, PSPHOT_RECIPE);
     26    psAssert (recipe, "missing recipe?");
    1327
    1428    float FRACTION = psMetadataLookupF32 (&status, recipe, "DEBLEND_PEAK_FRACTION");
     
    128142    return true;
    129143}
     144
     145// for now, let's store the detections on the readout->analysis for each readout
     146bool psphotBasicDeblend (pmConfig *config, const pmFPAview *view)
     147{
     148    bool status = true;
     149
     150    int num = psMetadataAddS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
     151    psAssert (status, "programming error: must define PSPHOT.INPUT.NUM");
     152
     153    // loop over the available readouts
     154    for (int i = 0; i < num; i++) {
     155        if (!psphotBasicDeblendReadout (config, view, "PSPHOT.INPUT", i)) {
     156            psError (PSPHOT_ERR_CONFIG, false, "failed on saturated star deblend analysis for PSPHOT.INPUT entry %d", i);
     157            return false;
     158        }
     159    }
     160    return true;
     161}
Note: See TracChangeset for help on using the changeset viewer.