IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 26, 2010, 5:10:34 PM (16 years ago)
Author:
eugene
Message:

various API fixes for multi-inputs

File:
1 edited

Legend:

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

    r12792 r26688  
    11# include "psphotInternal.h"
    22
    3 void psphotSourceFreePixels (psArray *sources) {
     3bool psphotSourceFreePixels (pmConfig *config, const pmFPAview *view)
     4{
     5    bool status = true;
    46
    5     if (!sources) return;
     7    int num = psMetadataAddS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
     8    psAssert (status, "programming error: must define PSPHOT.INPUT.NUM");
     9
     10    // loop over the available readouts
     11    for (int i = 0; i < num; i++) {
     12        if (!psphotSourceFreePixelsReadout (config, view, "PSPHOT.INPUT", i)) {
     13            psError (PSPHOT_ERR_CONFIG, false, "failed on saturated star deblend analysis for PSPHOT.INPUT entry %d", i);
     14            return false;
     15        }
     16    }
     17    return true;
     18}
     19
     20bool psphotSourceFreePixelsReadout(pmConfig *config, const pmFPAview *view, const char *filename, int index) {
     21
     22    // find the currently selected readout
     23    pmFPAfile *file = pmFPAfileSelectSingle(config->files, filename, index); // File of interest
     24    psAssert (readout, "missing file?");
     25
     26    pmReadout *readout = pmFPAviewThisReadout(view, file->fpa);
     27    psAssert (readout, "missing readout?");
     28
     29    pmDetections *detections = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.DETECTIONS");
     30    psAssert (detections, "missing detections?");
     31
     32    psArray *sources = detections->allSources;
     33    psAssert (sources, "missing sources?");
    634
    735    for (int i = 0; i < sources->n; i++) {
     
    937        pmSourceFreePixels (source);
    1038    }
    11     return;
     39    return true;
    1240}
Note: See TracChangeset for help on using the changeset viewer.