IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 18, 2010, 6:42:01 PM (16 years ago)
Author:
Paul Price
Message:

Reworked ppStack to be better about error codes and their translation to exit codes.

Location:
trunk/ppStack/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppStack/src

    • Property svn:ignore
      •  

        old new  
        1010stamp-h1
        1111ppStackVersionDefinitions.h
         12ppStackErrorCodes.c
         13ppStackErrorCodes.h
  • trunk/ppStack/src/ppStackPrepare.c

    r26918 r27004  
    2626    float zpRadius = psMetadataLookupS32(&mdok, recipe, "PHOT.RADIUS"); // Radius for PHOT measurement
    2727    if (!mdok) {
    28         psError(PS_ERR_UNKNOWN, true, "Unable to find PHOT.RADIUS in recipe");
     28        psError(PPSTACK_ERR_CONFIG, true, "Unable to find PHOT.RADIUS in recipe");
    2929        return false;
    3030    }
    3131    float zpSigma = psMetadataLookupF32(&mdok, recipe, "PHOT.SIGMA"); // Gaussian sigma for photometry
    3232    if (!mdok) {
    33         psError(PS_ERR_UNKNOWN, true, "Unable to find PHOT.SIGMA in recipe");
     33        psError(PPSTACK_ERR_CONFIG, true, "Unable to find PHOT.SIGMA in recipe");
    3434        return false;
    3535    }
    3636    float zpFrac = psMetadataLookupF32(&mdok, recipe, "PHOT.FRAC"); // Fraction of good pixels for photometry
    3737    if (!mdok) {
    38         psError(PS_ERR_UNKNOWN, true, "Unable to find PHOT.FRAC in recipe");
     38        psError(PPSTACK_ERR_CONFIG, true, "Unable to find PHOT.FRAC in recipe");
    3939        return false;
    4040    }
     
    4242    psString maskValStr = psMetadataLookupStr(&mdok, recipe, "MASK.VAL"); // Name of bits to mask going in
    4343    if (!mdok || !maskValStr) {
    44         psError(PS_ERR_UNKNOWN, false, "Unable to find MASK.VAL in recipe");
     44        psError(PPSTACK_ERR_CONFIG, false, "Unable to find MASK.VAL in recipe");
    4545        return false;
    4646    }
     
    5353    psStats *stats = psStatsAlloc(PS_STAT_ROBUST_MEDIAN | PS_STAT_ROBUST_STDEV); // Statistics
    5454    if (!psImageBackground(stats, NULL, image, mask, maskVal, rng)) {
    55         psError(PS_ERR_UNKNOWN, false, "Unable to measure background for image");
     55        psError(PPSTACK_ERR_DATA, false, "Unable to measure background for image");
    5656        psFree(stats);
    5757        psFree(rng);
     
    148148            pmPSF *psf = psMetadataLookupPtr(NULL, chip->analysis, "PSPHOT.PSF"); // PSF
    149149            if (!psf) {
    150                 psError(PS_ERR_UNKNOWN, false, "Unable to find PSF.");
     150                psError(PPSTACK_ERR_PROG, false, "Unable to find PSF.");
    151151                psFree(view);
    152152                psFree(fileIter);
     
    163163            int naxis2 = psMetadataLookupS32(NULL, hdu->header, "NAXIS2"); // Number of rows
    164164            if (naxis1 <= 0 || naxis2 <= 0) {
    165                 psError(PS_ERR_UNKNOWN, false, "Unable to determine size of image from PSF.");
     165                psError(PPSTACK_ERR_PROG, false, "Unable to determine size of image from PSF.");
    166166                psFree(view);
    167167                psFree(fileIter);
     
    183183            detections = psMetadataLookupPtr(NULL, ro->analysis, "PSPHOT.DETECTIONS"); // Sources
    184184            if (!detections) {
    185                 psError(PS_ERR_UNEXPECTED_NULL, false, "Unable to find source detections in readout.");
     185                psError(PPSTACK_ERR_PROG, false, "Unable to find source detections in readout.");
    186186                return NULL;
    187187            }
     
    209209
    210210            if (!ppStackInputPhotometer(ro, detections->allSources, config)) {
    211                 psError(PS_ERR_UNKNOWN, false, "Unable to do photometry on input sources");
     211                psError(psErrorCodeLast(), false, "Unable to do photometry on input sources");
    212212                psFree(view);
    213213                psFree(photView);
     
    273273        psFree(psfs);
    274274        if (!options->psf) {
    275             psError(PS_ERR_UNKNOWN, false, "Unable to determine output PSF.");
     275            psError(psErrorCodeLast(), false, "Unable to determine output PSF.");
    276276            psFree(view);
    277277            return false;
     
    290290    // Zero point calibration
    291291    if (!ppStackSourcesTransparency(options, view, config)) {
    292         psError(PS_ERR_UNKNOWN, false, "Unable to calculate transparency differences");
     292        psError(PPSTACK_ERR_DATA, false, "Unable to calculate transparency differences");
    293293        psFree(view);
    294294        return false;
Note: See TracChangeset for help on using the changeset viewer.