IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 25, 2010, 7:52:41 PM (16 years ago)
Author:
eugene
Message:

various API updates to work with multiple INPUT files (not yet finished)

File:
1 edited

Legend:

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

    r26643 r26681  
    77        } }
    88
    9 bool psphotRoughClassRegion (int nRegion, psRegion *region, psArray *sources, psMetadata *target, psMetadata *recipe, const bool havePSF);
     9// for now, let's store the detections on the readout->analysis for each readout
     10bool psphotRoughClass (pmConfig *config, const pmFPAview *view)
     11{
     12    bool status = true;
    1013
    11 // 2006.02.02 : no leaks
    12 bool psphotRoughClassReadout (pmConfig *config, const pmFPAview *view, const char *filename, int index, const bool havePSF) {
     14    // select the appropriate recipe information
     15    psMetadata *recipe  = psMetadataLookupPtr (&status, config->recipes, PSPHOT_RECIPE);
     16    psAssert (recipe, "missing recipe?");
     17
     18    int num = psMetadataAddS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
     19    psAssert (status, "programming error: must define PSPHOT.INPUT.NUM");
     20
     21    // loop over the available readouts
     22    for (int i = 0; i < num; i++) {
     23        if (!psphotRoughClassReadout (config, view, "PSPHOT.INPUT", i, recipe)) {
     24            psError (PSPHOT_ERR_CONFIG, false, "failed on saturated star deblend analysis for PSPHOT.INPUT entry %d", i);
     25            return false;
     26        }
     27    }
     28    return true;
     29}
     30
     31bool psphotRoughClassReadout (pmConfig *config, const pmFPAview *view, const char *filename, int index, psMetadata *recipe) {
    1332
    1433    bool status;
     
    2342    psAssert (readout, "missing readout?");
    2443
     44    // if we have a PSF, use the existing PSF clump region below
     45    bool havePSF = false;
     46    if (psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.PSF")) {
     47        havePSF = true;
     48    }
     49
    2550    psArray *sources = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.SOURCES");
    2651    psAssert (sources, "missing sources?");
    2752
    28     // select the appropriate recipe information
    29     psMetadata *recipe  = psMetadataLookupPtr (&status, config->recipes, PSPHOT_RECIPE);
    30     psAssert (recipe, "missing recipe?");
     53    if (!sources->n) {
     54        psLogMsg ("psphot", PS_LOG_INFO, "no sources, skipping rough classification");
     55        return true;
     56    }
    3157
    3258    // we make this measurement on a NxM grid of regions across the readout
     
    125151    return true;
    126152}
    127 
    128 // for now, let's store the detections on the readout->analysis for each readout
    129 bool 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.