IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 10, 2010, 7:38:54 PM (16 years ago)
Author:
eugene
Message:

updates from eam_branches/20091201

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/pswarp/src/pswarpLoop.c

    r25847 r26896  
    162162        pmChip *chip;
    163163        pmFPAview *view = pmFPAviewAlloc(0);
    164         pmFPAfileIOChecks (config, view, PM_FPA_BEFORE);
     164        if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) {
     165            return false;
     166        }
    165167        while ((chip = pmFPAviewNextChip (view, input->fpa, 1)) != NULL) {
    166168            psTrace ("pswarp", 4, "Chip %d: %x %x\n", view->chip, chip->file_exists, chip->process);
    167169            if (!chip->process || !chip->file_exists) { continue; }
    168             pmFPAfileIOChecks(config, view, PM_FPA_BEFORE);
     170            if (!pmFPAfileIOChecks(config, view, PM_FPA_BEFORE)) {
     171                return false;
     172            }
    169173            pmCell *cell;
    170174            while ((cell = pmFPAviewNextCell (view, input->fpa, 1)) != NULL) {
    171175                psTrace ("pswarp", 4, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process);
    172176                if (!cell->process || !cell->file_exists) { continue; }
    173                 pmFPAfileIOChecks (config, view, PM_FPA_BEFORE);
    174                 pmFPAfileIOChecks (config, view, PM_FPA_AFTER);
    175             }
    176             pmFPAfileIOChecks (config, view, PM_FPA_AFTER);
    177         }
    178         pmFPAfileIOChecks (config, view, PM_FPA_AFTER);
     177                if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE) ||
     178                    !pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) {
     179                    return false;
     180                }
     181            }
     182            if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) {
     183                return false;
     184            }
     185        }
     186        if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) {
     187            return false;
     188        }
    179189        psFree(view);
    180190
     
    211221
    212222    // files associated with the science image
    213     pmFPAfileIOChecks (config, view, PM_FPA_BEFORE);
     223    if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) {
     224        return false;
     225    }
    214226
    215227    pmChip *chip;
     
    217229        psTrace ("pswarp", 4, "Chip %d: %x %x\n", view->chip, chip->file_exists, chip->process);
    218230        if (!chip->process || !chip->file_exists) { continue; }
    219         pmFPAfileIOChecks (config, view, PM_FPA_BEFORE);
     231        if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) {
     232            return false;
     233        }
    220234
    221235        // read WCS data from the corresponding header
     
    242256            psTrace ("pswarp", 4, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process);
    243257            if (!cell->process || !cell->file_exists) { continue; }
    244             pmFPAfileIOChecks (config, view, PM_FPA_BEFORE);
     258            if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) {
     259                return false;
     260            }
    245261
    246262            psListAdd(cells, PS_LIST_TAIL, cell);
     
    249265            pmReadout *readout;
    250266            while ((readout = pmFPAviewNextReadout(view, input->fpa, 1)) != NULL) {
    251                 pmFPAfileIOChecks(config, view, PM_FPA_BEFORE);
     267                if (!pmFPAfileIOChecks(config, view, PM_FPA_BEFORE)) {
     268                    return false;
     269                }
    252270                if (!readout->data_exists) {
    253271                    continue;
    254272                }
    255273
    256                 // Copy the sources from the astrometry carrier to the input, so they can be accessed by
     274                // Copy the detections from the astrometry carrier to the input, so they can be accessed by
    257275                // pswarpTransformReadout
    258276                pmReadout *astromRO = pmFPAviewThisReadout(view, astrom->fpa); // Readout for astrometry
    259                 psArray *sources = psMetadataLookupPtr(&mdok, astromRO->analysis,
    260                                                        "PSPHOT.SOURCES"); // Sources from astrometry
    261                 if (sources) {
    262                     psMetadataAddPtr(readout->analysis, PS_LIST_TAIL, "PSPHOT.SOURCES", PS_DATA_ARRAY,
    263                                      "Sources from input astrometry", sources);
     277                pmDetections *detections = psMetadataLookupPtr(&mdok, astromRO->analysis, "PSPHOT.DETECTIONS"); // Sources from astrometry
     278                if (detections) {
     279                    psMetadataAddPtr(readout->analysis, PS_LIST_TAIL, "PSPHOT.DETECTIONS", PS_DATA_ARRAY, "Sources from input astrometry", detections);
    264280                }
    265281
    266282                pswarpTransformReadout(output, readout, config);
    267283
    268                 pmFPAfileIOChecks(config, view, PM_FPA_AFTER);
    269             }
    270             pmFPAfileIOChecks(config, view, PM_FPA_AFTER);
    271         }
    272         pmFPAfileIOChecks(config, view, PM_FPA_AFTER);
     284                if (!pmFPAfileIOChecks(config, view, PM_FPA_AFTER)) {
     285                    return false;
     286                }
     287            }
     288            if (!pmFPAfileIOChecks(config, view, PM_FPA_AFTER)) {
     289                return false;
     290            }
     291        }
     292        if (!pmFPAfileIOChecks(config, view, PM_FPA_AFTER)) {
     293            return false;
     294        }
    273295    }
    274296
     
    370392    }
    371393
    372     pmFPAfileIOChecks(config, view, PM_FPA_AFTER);
     394    if (!pmFPAfileIOChecks(config, view, PM_FPA_AFTER)) {
     395        return false;
     396    }
    373397
    374398    // Done with the detector side of things
     
    478502        }
    479503        fprintf(statsFile, "%s", statsMDC);
    480         psFree((void*)statsMDC);
     504        psFree(statsMDC);
    481505        fclose(statsFile);
    482506        pmConfigRunFilenameAddWrite(config, "STATS", statsName);
Note: See TracChangeset for help on using the changeset viewer.