IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 9291


Ignore:
Timestamp:
Oct 5, 2006, 9:12:49 AM (20 years ago)
Author:
eugene
Message:

adding error checking to pmFPAfileIOChecks calls

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psphot/src/psphotImageLoop.c

    r9269 r9291  
    1919    // files associated with the science image
    2020    if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) {
     21        psError(PS_ERR_UNKNOWN, false, "failed IO for fpa in psphot\n");
    2122        psFree(view);
    2223        return false;
    2324    }
     25
    2426    while ((chip = pmFPAviewNextChip (view, input->fpa, 1)) != NULL) {
    2527        psLogMsg ("psphot", 4, "Chip %d: %x %x\n", view->chip, chip->file_exists, chip->process);
    2628        if (! chip->process || ! chip->file_exists) { continue; }
    27         pmFPAfileIOChecks (config, view, PM_FPA_BEFORE);
    28 
     29        if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) {
     30            psError(PS_ERR_UNKNOWN, false, "failed IO for chip %d in psphot\n", view->chip);
     31            psFree (view);
     32            return false;
     33        }
     34       
    2935        while ((cell = pmFPAviewNextCell (view, input->fpa, 1)) != NULL) {
    3036            psLogMsg ("psphot", 4, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process);
    3137            if (! cell->process || ! cell->file_exists) { continue; }
    32             pmFPAfileIOChecks (config, view, PM_FPA_BEFORE);
    33 
     38            if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) {
     39                psError(PS_ERR_UNKNOWN, false, "failed IO for chip %d, cell %d in psphot\n", view->chip, view->cell);
     40                psFree (view);
     41                return false;
     42            }
     43           
    3444            // process each of the readouts
    3545            while ((readout = pmFPAviewNextReadout (view, input->fpa, 1)) != NULL) {
    36                 pmFPAfileIOChecks (config, view, PM_FPA_BEFORE);
     46                if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) {
     47                    psError(PS_ERR_UNKNOWN, false, "failed IO for chip %d, cell %d, readout %d in psphot\n", view->chip, view->cell, view->readout);
     48                    psFree (view);
     49                    return false;
     50                }
     51               
    3752                if (! readout->data_exists) { continue; }
    38 
     53               
    3954                // run the actual photometry analysis
    40                 psphotReadout (config, view);
    41 
    42                 pmFPAfileIOChecks (config, view, PM_FPA_AFTER);
     55                if (!psphotReadout (config, view)) {
     56                    psError(PS_ERR_UNKNOWN, false, "failed psphotReadout for chip %d, cell %d, readout %d\n", view->chip, view->cell, view->readout);
     57                    psFree (view);
     58                    return false;
     59                }
     60               
     61                if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) {
     62                    psError(PS_ERR_UNKNOWN, false, "failed IO for chip %d, cell %d, readout %d in psphot\n", view->chip, view->cell, view->readout);
     63                    psFree (view);
     64                    return false;
     65                }
    4366            }
    44             pmFPAfileIOChecks (config, view, PM_FPA_AFTER);
     67            if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) {
     68                psError(PS_ERR_UNKNOWN, false, "failed IO for chip %d, cell %d in psphot\n", view->chip, view->cell);
     69                psFree (view);
     70                return false;
     71            }
    4572        }
    46         pmFPAfileIOChecks (config, view, PM_FPA_AFTER);
     73        if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) {
     74            psError(PS_ERR_UNKNOWN, false, "failed IO for chip %d in psphot\n", view->chip);
     75            psFree (view);
     76            return false;
     77        }
    4778    }
    48     pmFPAfileIOChecks (config, view, PM_FPA_AFTER);
    49 
     79    if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) {
     80        psError(PS_ERR_UNKNOWN, false, "failed IO for fpa in psphot\n");
     81        psFree (view);
     82        return false;
     83    }
     84   
    5085    psFree (view);
    5186    return true;
Note: See TracChangeset for help on using the changeset viewer.