IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 22, 2004, 3:33:02 PM (22 years ago)
Author:
harman
Message:

Added more new error messages

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/pmMaskBadPixels.c

    r1832 r1853  
    1919 *  @author Ross Harman, MHPCC
    2020 *
    21  *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
    22  *  @date $Date: 2004-09-20 20:36:46 $
     21 *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
     22 *  @date $Date: 2004-09-23 01:33:02 $
    2323 *
    2424 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    3333
    3434#include "pmMaskBadPixels.h"
     35#include "pmMaskBadPixelsErrors.h"
    3536
    3637bool pmMaskBadPixels(psReadout *in, const psImage *mask, unsigned int maskVal, float sat,
     
    5758    // Check for nulls
    5859    if (in == NULL) {
    59         psError(__func__, " : Line %d - Null not allowed for input readout", __LINE__);
    60         return false;
     60        return true;   // Readout may not have data in it
    6161    } else if(mask==NULL) {
    62         psError(__func__, " : Line %d - Null not allowed for mask", __LINE__);
     62        psErrorMsg(PS_ERRORNAME_DOMAIN "pmMaskBadPixels", PS_ERR_BAD_PARAMETER_NULL, true,
     63                   PS_ERRORTEXT_pmMaskBadPixels_NULL_MASK_IMAGE);
    6364        return false;
    6465    }
     
    6667    inImage = in->image;
    6768    if (inImage == NULL) {
    68         psError(__func__, " : Line %d - Null not allowed for input image", __LINE__);
     69        psErrorMsg(PS_ERRORNAME_DOMAIN "pmMaskBadPixels", PS_ERR_BAD_PARAMETER_NULL, true,
     70                   PS_ERRORTEXT_pmMaskBadPixels_NULL_INPUT_IMAGE);
    6971        return false;
    7072    } else if(inMask == NULL) {
     
    7476
    7577    // Check input image and its mask are not larger than mask
    76     if(inImage->numRows > mask->numRows) {
    77         psError(__func__, " : Line %d - Input image exceeds mask image in number of rows. (%d vs %d).",
    78                 __LINE__, inImage->numRows, mask->numRows);
     78    if(inImage->numRows>mask->numRows || inImage->numCols > mask->numCols) {
     79        psErrorMsg(PS_ERRORNAME_DOMAIN "pmMaskBadPixels", PS_ERR_BAD_PARAMETER_SIZE, true,
     80                   PS_ERRORTEXT_pmMaskBadPixels_SIZE_INPUT_IMAGE,
     81                   inImage->numRows, inImage->numCols, mask->numRows, mask->numCols);
    7982        return false;
    80     } else if(inImage->numCols > mask->numCols) {
    81         psError(__func__, " : Line %d - Input image exceeds mask image in number of columns. (%d vs %d).",
    82                 __LINE__, inImage->numCols, mask->numCols);
    83         return false;
    84     } else if(inMask->numRows > mask->numRows) {
    85         psError(__func__, " : Line %d - Input image mask exceeds mask image in number of rows. (%d vs %d).",
    86                 __LINE__, inImage->numRows, mask->numRows);
    87         return false;
    88     } else if(inMask->numCols > mask->numCols) {
    89         psError(__func__, " : Line %d - Input image mask exceeds mask image in number of columns. (%d vs %d).",
    90                 __LINE__, inImage->numCols, mask->numCols);
     83    } else if(inMask->numRows>mask->numRows || inMask->numCols>mask->numCols) {
     84        psErrorMsg(PS_ERRORNAME_DOMAIN "pmMaskBadPixels", PS_ERR_BAD_PARAMETER_SIZE, true,
     85                   PS_ERRORTEXT_pmMaskBadPixels_SIZE_MASK_IMAGE,
     86                   inImage->numRows, inImage->numCols, mask->numRows, mask->numCols);
    9187        return false;
    9288    }
     
    9793
    9894    // Check that offsets are within image limits
    99     if(totOffRow > mask->numRows-1) {
    100         psError(__func__, " : Line %d - Initial row offset exceeds that of mask image. (%d vs %d).",
    101                 __LINE__, totOffRow, mask->numRows);
     95    if(totOffRow>=mask->numRows || totOffCol>=mask->numCols) {
     96        psErrorMsg(PS_ERRORNAME_DOMAIN "pmMaskBadPixels", PS_ERR_BAD_PARAMETER_SIZE, true,
     97                   PS_ERRORTEXT_pmMaskBadPixels_OFFSET_MASK_IMAGE,
     98                   totOffRow, totOffCol, mask->numRows, mask->numCols);
    10299        return false;
    103     } else if(totOffCol > mask->numCols-1) {
    104         psError(__func__, " : Line %d - Initial column offset exceeds that of mask image. (%d vs %d).",
    105                 __LINE__, totOffCol, mask->numCols);
     100    } else if(totOffRow>=inImage->numRows || totOffCol>=inImage->numCols) {
     101        psErrorMsg(PS_ERRORNAME_DOMAIN "pmMaskBadPixels", PS_ERR_BAD_PARAMETER_SIZE, true,
     102                   PS_ERRORTEXT_pmMaskBadPixels_OFFSET_INPUT_IMAGE,
     103                   totOffRow, totOffCol, inImage->numRows, inImage->numCols);
    106104        return false;
    107     } else if(totOffRow > inImage->numRows-1) {
    108         psError(__func__, " : Line %d - Initial row offset exceeds that of input image. (%d vs %d).",
    109                 __LINE__, totOffRow, inImage->numRows);
    110         return false;
    111     } else if(totOffCol > inImage->numCols-1) {
    112         psError(__func__, " : Line %d - Initial column offset exceeds that of input image. (%d vs %d).",
    113                 __LINE__, totOffCol, inImage->numCols);
    114         return false;
    115     } else if(totOffRow > inMask->numRows-1) {
    116         psError(__func__, " : Line %d - Initial row offset exceeds that of input image mask. (%d vs %d).",
    117                 __LINE__, totOffRow, inMask->numRows);
    118         return false;
    119     } else if(totOffCol > inMask->numCols-1) {
    120         psError(__func__, " : Line %d - Initial column offset exceeds that of input image mask. (%d vs %d).",
    121                 __LINE__, totOffCol, inMask->numCols);
     105    } else if(totOffRow>=inMask->numRows || totOffCol>=inMask->numCols) {
     106        psErrorMsg(PS_ERRORNAME_DOMAIN "pmMaskBadPixels", PS_ERR_BAD_PARAMETER_SIZE, true,
     107                   PS_ERRORTEXT_pmMaskBadPixels_OFFSET_INPUT_IMAGE_MASK,
     108                   totOffRow, totOffCol, inMask->numRows, inMask->numCols);
    122109        return false;
    123110    }
     
    127114    maskType = mask->type.type;
    128115    if(PS_IS_PSELEMTYPE_COMPLEX(inType)) {
    129         psError(__func__, " : Line %d - Complex types not allowed for input image. Type: %d", __LINE__,
    130                 inType);
     116        psErrorMsg(PS_ERRORNAME_DOMAIN "pmMaskBadPixels", PS_ERR_BAD_PARAMETER_TYPE, true,
     117                   PS_ERRORTEXT_pmMaskBadPixels_TYPE_INPUT_IMAGE,
     118                   inType);
    131119        return false;
    132120    } else if(maskType!=PS_TYPE_MASK) {
    133         psError(__func__, " : Line %d - Mask must be PS_TYPE_MASK type. Type: %d", __LINE__, maskType);
     121        psErrorMsg(PS_ERRORNAME_DOMAIN "pmMaskBadPixels", PS_ERR_BAD_PARAMETER_TYPE, true,
     122                   PS_ERRORTEXT_pmMaskBadPixels_TYPE_MASK_IMAGE,
     123                   maskType);
    134124        return false;
    135125    }
     
    183173        PM_BAD_PIXELS(F64);
    184174    default:
    185         psError(__func__, "Unsupported image datatype. Type: %d", inType);
     175        psErrorMsg(PS_ERRORNAME_DOMAIN "pmMaskBadPixels", PS_ERR_BAD_PARAMETER_TYPE, true,
     176                   PS_ERRORTEXT_pmMaskBadPixels_TYPE_UNSUPPORTED,
     177                   inType);
    186178    }
    187179
Note: See TracChangeset for help on using the changeset viewer.