IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 17, 2010, 5:36:13 PM (16 years ago)
Author:
Paul Price
Message:

Being better about errors and their mapping to exit codes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppSub/src/ppSubLoop.c

    r26899 r26982  
    4343
    4444    if (!ppSubSetMasks(config)) {
    45         psError(PS_ERR_UNKNOWN, false, "Unable to set masks.");
     45        psError(psErrorCodeLast(), false, "Unable to set masks.");
    4646        return false;
    4747    }
    4848
    4949    if (!ppSubMatchPSFs(data)) {
    50         psError(PS_ERR_UNKNOWN, false, "Unable to match PSFs.");
     50        psError(psErrorCodeLast(), false, "Unable to match PSFs.");
    5151        return false;
    5252    }
     
    5757    // generate the residual stamp grid for visualization
    5858    if (!ppSubResidualSampleJpeg(config)) {
    59         psError(PS_ERR_UNKNOWN, false, "Unable to update.");
     59        psError(psErrorCodeLast(), false, "Unable to update.");
    6060        return false;
    6161    }
     
    7171
    7272    if (!ppSubLowThreshold(data)) {
    73         psError(PS_ERR_UNKNOWN, false, "Unable to threshold images.");
     73        psError(psErrorCodeLast(), false, "Unable to threshold images.");
    7474        return false;
    7575    }
     
    8282
    8383    if (!ppSubDefineOutput("PPSUB.OUTPUT", config)) {
    84         psError(PS_ERR_UNKNOWN, false, "Unable to define output.");
     84        psError(psErrorCodeLast(), false, "Unable to define output.");
    8585        return false;
    8686    }
    8787
    8888    if (!data->quality && !ppSubMakePSF(data)) {
    89         psError(PS_ERR_UNKNOWN, false, "Unable to generate PSF.");
     89        psError(psErrorCodeLast(), false, "Unable to generate PSF.");
    9090        return false;
    9191    }
    9292
    9393    if (!ppSubReadoutSubtract(config)) {
    94         psError(PS_ERR_UNKNOWN, false, "Unable to subtract images.");
     94        psError(psErrorCodeLast(), false, "Unable to subtract images.");
    9595        return false;
    9696    }
     
    104104    // Higher order background subtraction using psphot
    105105    if (!ppSubBackground(config)) {
    106         psError(PS_ERR_UNKNOWN, false, "Unable to subtract background.");
     106        psError(psErrorCodeLast(), false, "Unable to subtract background.");
    107107        return false;
    108108    }
     
    110110    // Perform Variance correction (rescale within a modest range)
    111111    if (!ppSubVarianceRescale(config)) {
    112         psError(PS_ERR_UNKNOWN, false, "Unable to rescale variance.");
     112        psError(psErrorCodeLast(), false, "Unable to rescale variance.");
    113113        return false;
    114114    }
     
    120120
    121121    if (!data->quality && !ppSubReadoutPhotometry("PPSUB.OUTPUT", data)) {
    122         psError(PS_ERR_UNKNOWN, false, "Unable to perform photometry.");
     122        psError(psErrorCodeLast(), false, "Unable to perform photometry.");
    123123        return false;
    124124    }
     
    131131    // Perform statistics on the cell
    132132    if (!ppSubReadoutStats(data)) {
    133         psError(PS_ERR_UNKNOWN, false, "Unable to collect statistics");
     133        psError(psErrorCodeLast(), false, "Unable to collect statistics");
    134134        return false;
    135135    }
     
    137137    // generate the binned image used to write the jpeg
    138138    if (!ppSubReadoutJpeg(config)) {
    139         psError(PS_ERR_UNKNOWN, false, "Unable to update.");
     139        psError(psErrorCodeLast(), false, "Unable to update.");
    140140        return false;
    141141    }
     
    149149
    150150        if (data->inverse && !ppSubDefineOutput("PPSUB.INVERSE", config)) {
    151             psError(PS_ERR_UNKNOWN, false, "Unable to define inverse.");
     151            psError(psErrorCodeLast(), false, "Unable to define inverse.");
    152152            return false;
    153153        }
    154154
    155155        if (!ppSubReadoutInverse(config)) {
    156             psError(PS_ERR_UNKNOWN, false, "Unable to invert images.");
     156            psError(psErrorCodeLast(), false, "Unable to invert images.");
    157157            return false;
    158158        }
     
    170170
    171171        if (!data->quality && !ppSubReadoutPhotometry("PPSUB.INVERSE", data)) {
    172             psError(PS_ERR_UNKNOWN, false, "Unable to perform photometry.");
     172            psError(psErrorCodeLast(), false, "Unable to perform photometry.");
    173173            return false;
    174174        }
Note: See TracChangeset for help on using the changeset viewer.