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

    r25989 r26643  
    1010
    1111// 2006.02.02 : no leaks
    12 bool psphotRoughClass (pmReadout *readout, psArray *sources, psMetadata *recipe, const bool havePSF) {
     12bool psphotRoughClassReadout (pmConfig *config, const pmFPAview *view, const char *filename, int index, const bool havePSF) {
    1313
    1414    bool status;
    1515
    1616    psTimerStart ("psphot.rough");
     17
     18    // find the currently selected readout
     19    pmFPAfile *file = pmFPAfileSelectSingle(config->files, filename, index); // File of interest
     20    psAssert (readout, "missing file?");
     21
     22    pmReadout *readout = pmFPAviewThisReadout(view, file->fpa);
     23    psAssert (readout, "missing readout?");
     24
     25    psArray *sources = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.SOURCES");
     26    psAssert (sources, "missing sources?");
     27
     28    // select the appropriate recipe information
     29    psMetadata *recipe  = psMetadataLookupPtr (&status, config->recipes, PSPHOT_RECIPE);
     30    psAssert (recipe, "missing recipe?");
    1731
    1832    // we make this measurement on a NxM grid of regions across the readout
     
    111125    return true;
    112126}
     127
     128// for now, let's store the detections on the readout->analysis for each readout
     129bool psphotRoughClass (pmConfig *config, const pmFPAview *view, const bool havePSF)
     130{
     131    bool status = true;
     132
     133    int num = psMetadataAddS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
     134    psAssert (status, "programming error: must define PSPHOT.INPUT.NUM");
     135
     136    // loop over the available readouts
     137    for (int i = 0; i < num; i++) {
     138        if (!psphotRoughClassReadout (config, view, "PSPHOT.INPUT", i, havePSF)) {
     139            psError (PSPHOT_ERR_CONFIG, false, "failed on saturated star deblend analysis for PSPHOT.INPUT entry %d", i);
     140            return false;
     141        }
     142    }
     143    return true;
     144}
Note: See TracChangeset for help on using the changeset viewer.