IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 4, 2007, 9:55:03 AM (19 years ago)
Author:
eugene
Message:

clean up error handling on pmFPAfileIO

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psastro/src/psastroDataLoad.c

    r12806 r15216  
    55// into the correct fpa structure locations (readout.analysis:PSPHOT.SOURCES)
    66
     7# define ESCAPE { \
     8  psError(PS_ERR_UNKNOWN, false, "Failure in psastroDataSave"); \
     9  psFree (view); \
     10  return false; \
     11}
     12 
    713// all of the different astrometry analysis modes use the same data load loop
    814bool psastroDataLoad (pmConfig *config) {
     
    3339
    3440    // files associated with the science image
    35     pmFPAfileIOChecks (config, view, PM_FPA_BEFORE);
     41    if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) ESCAPE;
    3642
    3743    while ((chip = pmFPAviewNextChip (view, input->fpa, 1)) != NULL) {
    3844        psTrace ("psastro", 4, "Chip %d: %x %x\n", view->chip, chip->file_exists, chip->process);
    3945        if (!chip->process || !chip->file_exists) { continue; }
    40         pmFPAfileIOChecks (config, view, PM_FPA_BEFORE);
     46        if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) ESCAPE;
    4147
    4248        while ((cell = pmFPAviewNextCell (view, input->fpa, 1)) != NULL) {
    4349            psTrace ("psastro", 4, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process);
    4450            if (!cell->process || !cell->file_exists) { continue; }
    45             pmFPAfileIOChecks (config, view, PM_FPA_BEFORE);
     51            if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) ESCAPE;
    4652
    4753            // process each of the readouts
    4854            while ((readout = pmFPAviewNextReadout (view, input->fpa, 1)) != NULL) {
    49                 pmFPAfileIOChecks (config, view, PM_FPA_BEFORE);
    50                 if (! readout->data_exists) { continue; }
     55                if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) ESCAPE;
     56                if (!readout->data_exists) { continue; }
    5157
    52                 psastroConvertReadout (readout, recipe);
     58                if (!psastroConvertReadout (readout, recipe)) ESCAPE;
    5359
    54                 pmFPAfileIOChecks (config, view, PM_FPA_AFTER);
     60                if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) ESCAPE;
    5561            }
    56             pmFPAfileIOChecks (config, view, PM_FPA_AFTER);
     62            if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) ESCAPE;
    5763        }
    58         pmFPAfileIOChecks (config, view, PM_FPA_AFTER);
     64        if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) ESCAPE;
    5965    }
    60     pmFPAfileIOChecks (config, view, PM_FPA_AFTER);
     66    if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) ESCAPE;
     67
    6168    psFree (view);
    6269    return true;
Note: See TracChangeset for help on using the changeset viewer.