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/ppSubSetMasks.c

    r23740 r26982  
    2828    psImageMaskType maskValue, markValue; // Mask values
    2929    if (!pmConfigMaskSetBits(&maskValue, &markValue, config)) {
    30         psError(PS_ERR_UNKNOWN, false, "Unable to determine mask value.");
     30        psError(PPSUB_ERR_CONFIG, false, "Unable to determine mask value.");
    3131        return false;
    3232    }
    3333
    3434    // Set the mask bits needed by psphot (in psphot recipe)
    35     psphotSetMaskRecipe (config, maskValue, markValue);
     35    psphotSetMaskRecipe(config, maskValue, markValue);
    3636
    3737    // Look up recipe values
     
    7979    // Mask the NAN values
    8080    if (!pmReadoutMaskNonfinite(inRO, satValue)) {
    81         psError(PS_ERR_UNKNOWN, false, "Unable to mask non-finite pixels in input.");
     81        psError(PPSUB_ERR_DATA, false, "Unable to mask non-finite pixels in input.");
    8282        return false;
    8383    }
    8484    if (!pmReadoutMaskNonfinite(refRO, satValue)) {
    85         psError(PS_ERR_UNKNOWN, false, "Unable to mask non-finite pixels in reference.");
     85        psError(PPSUB_ERR_DATA, false, "Unable to mask non-finite pixels in reference.");
    8686        return false;
    8787    }
     
    9494    psImageInterpolateMode interpMode = psImageInterpolateModeFromString(interpModeStr); // Interp
    9595    if (interpMode == PS_INTERPOLATE_NONE) {
    96         psError(PS_ERR_BAD_PARAMETER_VALUE, false, "Unknown interpolation mode: %s", interpModeStr);
     96        psError(PPSUB_ERR_CONFIG, false, "Unknown interpolation mode: %s", interpModeStr);
    9797        return false;
    9898    }
     
    104104    // Interpolate over bad pixels, so the bad pixels don't explode
    105105    if (!pmReadoutInterpolateBadPixels(inRO, maskVal, interpMode, poorFrac, maskPoor, maskBad)) {
    106         psError(PS_ERR_UNKNOWN, false, "Unable to interpolate bad pixels for input image.");
     106        psError(PPSUB_ERR_DATA, false, "Unable to interpolate bad pixels for input image.");
    107107        return false;
    108108    }
    109109    if (!pmReadoutInterpolateBadPixels(refRO, maskVal, interpMode, poorFrac, maskPoor, maskBad)) {
    110         psError(PS_ERR_UNKNOWN, false, "Unable to interpolate bad pixels for reference image.");
     110        psError(PPSUB_ERR_DATA, false, "Unable to interpolate bad pixels for reference image.");
    111111        return false;
    112112    }
Note: See TracChangeset for help on using the changeset viewer.