IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 27267


Ignore:
Timestamp:
Mar 12, 2010, 9:37:09 AM (16 years ago)
Author:
eugene
Message:

redo apis slightly to allow efficiency to work

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/20100225/psphot/src/psphotMagnitudes.c

    r26894 r27267  
    1414    // loop over the available readouts
    1515    for (int i = 0; i < num; i++) {
    16         if (!psphotMagnitudesReadout (config, view, "PSPHOT.INPUT", i, recipe)) {
     16
     17        // find the currently selected readout
     18        pmFPAfile *file = pmFPAfileSelectSingle(config->files, "PSPHOT.INPUT", i); // File of interest
     19        psAssert (file, "missing file?");
     20
     21        pmReadout *readout = pmFPAviewThisReadout(view, file->fpa);
     22        psAssert (readout, "missing readout?");
     23
     24        pmDetections *detections = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.DETECTIONS");
     25        psAssert (detections, "missing detections?");
     26
     27        psArray *sources = detections->allSources;
     28        psAssert (sources, "missing sources?");
     29
     30        pmPSF *psf = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.PSF");
     31        psAssert (psf, "missing psf?");
     32
     33        if (!psphotMagnitudesReadout (config, recipe, view, readout, sources, psf)) {
    1734            psError (PSPHOT_ERR_CONFIG, false, "failed to measure magnitudes for PSPHOT.INPUT entry %d", i);
    1835            return false;
     
    2239}
    2340
    24 bool psphotMagnitudesReadout(pmConfig *config, const pmFPAview *view, const char *filename, int index, psMetadata *recipe) {
     41bool psphotMagnitudesReadout(pmConfig *config, psMetadata *recipe, const pmFPAview *view, pmReadout *readout, psArray *sources, pmPSF *psf) {
    2542
    2643    bool status = false;
    2744    int Nap = 0;
    2845
     46    if (!sources->n) {
     47        psLogMsg ("psphot", PS_LOG_INFO, "no sources, skipping source magnitudes");
     48        return true;
     49    }
     50       
    2951    psTimerStart ("psphot.mags");
    30 
    31     // find the currently selected readout
    32     pmFPAfile *file = pmFPAfileSelectSingle(config->files, filename, index); // File of interest
    33     psAssert (file, "missing file?");
    34 
    35     pmReadout *readout = pmFPAviewThisReadout(view, file->fpa);
    36     psAssert (readout, "missing readout?");
    37 
    38     pmDetections *detections = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.DETECTIONS");
    39     psAssert (detections, "missing detections?");
    40 
    41     psArray *sources = detections->allSources;
    42     psAssert (sources, "missing sources?");
    43 
    44     if (!sources->n) {
    45         psLogMsg ("psphot", PS_LOG_INFO, "no sources, skipping source size");
    46         return true;
    47     }
    48 
    49     pmPSF *psf = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.PSF");
    50     psAssert (psf, "missing psf?");
    5152
    5253    // determine the number of allowed threads
Note: See TracChangeset for help on using the changeset viewer.