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/psphotDeblendSatstars.c

    r25885 r26643  
    11# include "psphotInternal.h"
    22
    3 bool psphotDeblendSatstars (pmReadout *readout, psArray *sources, psMetadata *recipe) {
     3bool psphotDeblendSatstarsReadout (pmConfig *config, const pmFPAview *view, const char *filename, int index) {
    44
    55    int N;
     
    1010    int Nblend = 0;
    1111    float SAT_MIN_RADIUS = 5.0;
     12
     13    // find the currently selected readout
     14    pmFPAfile *file = pmFPAfileSelectSingle(config->files, filename, index); // File of interest
     15    psAssert (readout, "missing file?");
     16
     17    pmReadout *readout = pmFPAviewThisReadout(view, file->fpa);
     18    psAssert (readout, "missing readout?");
     19
     20    psArray *sources = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.SOURCES");
     21    psAssert (sources, "missing sources?");
     22
     23    // select the appropriate recipe information
     24    psMetadata *recipe  = psMetadataLookupPtr (&status, config->recipes, PSPHOT_RECIPE);
     25    psAssert (recipe, "missing recipe?");
    1226
    1327    bool status;
     
    169183    return true;
    170184}
     185
     186// for now, let's store the detections on the readout->analysis for each readout
     187bool psphotDeblendSatstars (pmConfig *config, const pmFPAview *view)
     188{
     189    bool status = true;
     190
     191    int num = psMetadataAddS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
     192    psAssert (status, "programming error: must define PSPHOT.INPUT.NUM");
     193
     194    // loop over the available readouts
     195    for (int i = 0; i < num; i++) {
     196        if (!psphotDeblendSatstarsReadout (config, view, "PSPHOT.INPUT", i)) {
     197            psError (PSPHOT_ERR_CONFIG, false, "failed on saturated star deblend analysis for PSPHOT.INPUT entry %d", i);
     198            return false;
     199        }
     200    }
     201    return true;
     202}
Note: See TracChangeset for help on using the changeset viewer.