IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 1852


Ignore:
Timestamp:
Sep 22, 2004, 1:58:20 PM (22 years ago)
Author:
harman
Message:

Added new error message format

Location:
trunk/psModules/src
Files:
2 added
1 edited

Legend:

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

    r1849 r1852  
    1818 *  @author Ross Harman, MHPCC
    1919 *
    20  *  @version $Revision: 1.10 $ $Name: not supported by cvs2svn $
    21  *  @date $Date: 2004-09-22 19:58:57 $
     20 *  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
     21 *  @date $Date: 2004-09-22 23:58:20 $
    2222 *
    2323 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    3434#include "pmFlatField.h"
    3535#include "pmMaskBadPixels.h"
     36#include "pmFlatFieldErrors.h"
     37
    3638
    3739bool pmFlatField(psReadout *in, const psReadout *flat)
     
    5355        return false;
    5456    } else if(flat==NULL) {
    55         psError(__func__, " : Line %d - Null not allowed for flat readout", __LINE__);
     57        psErrorMsg(PS_ERRORNAME_DOMAIN "pmFlatField", PS_ERR_BAD_PARAMETER_NULL, true,
     58                   PS_ERRORTEXT_pmFlatField_NULL_FLAT_READOUT);
    5659        return false;
    5760    }
     
    6063    flatImage = flat->image;
    6164    if (inImage == NULL) {
    62         psError(__func__, " : Line %d - Null not allowed for input image", __LINE__);
     65        psErrorMsg(PS_ERRORNAME_DOMAIN "pmFlatField", PS_ERR_BAD_PARAMETER_NULL, true,
     66                   PS_ERRORTEXT_pmFlatField_NULL_INPUT_IMAGE);
    6367        return false;
    6468    } else if(flatImage == NULL) {
    65         psError(__func__, " : Line %d - Null not allowed for flat image", __LINE__);
     69        psErrorMsg(PS_ERRORNAME_DOMAIN "pmFlatField", PS_ERR_BAD_PARAMETER_NULL, true,
     70                   PS_ERRORTEXT_pmFlatField_NULL_FLAT_IMAGE);
    6671        return false;
    6772    } else if(in->mask == NULL) {
     
    7277    // Check input image and its mask are not larger than flat image
    7378    if(inImage->numRows>flatImage->numRows || inImage->numCols>flatImage->numCols) {
    74         psError(__func__, " : Line %d - Input image size exceeds that of flat image: (%d, %d) vs (%d, %d)",
    75                 __LINE__, inImage->numRows, inImage->numCols, flatImage->numRows, flatImage->numCols);
     79        psErrorMsg(PS_ERRORNAME_DOMAIN "pmFlatField", PS_ERR_BAD_PARAMETER_SIZE, true,
     80                   PS_ERRORTEXT_pmFlatField_SIZE_INPUT_IMAGE,
     81                   inImage->numRows, inImage->numCols, flatImage->numRows, flatImage->numCols);
    7682        return false;
    7783    } else if(inMask->numRows>flatImage->numRows || inMask->numCols > flatImage->numCols) {
    78         psError(__func__, " : Line %d - Input image mask size exceeds that of flat image: (%d, %d) vs (%d, %d)",
    79                 __LINE__, inMask->numRows, inMask->numCols, flatImage->numRows, flatImage->numCols);
     84        psErrorMsg(PS_ERRORNAME_DOMAIN "pmFlatField", PS_ERR_BAD_PARAMETER_SIZE, true,
     85                   PS_ERRORTEXT_pmFlatField_SIZE_MASK_IMAGE,
     86                   inMask->numRows, inMask->numCols, flatImage->numRows, flatImage->numCols);
    8087        return false;
    8188    }
     
    8794    // Check that offsets are within image limits
    8895    if(totOffRow>=flatImage->numRows || totOffCol>=flatImage->numCols) {
    89         psError(__func__, " : Line %d - Total offset >= flat image size: (%d, %d) vs (%d, %d)",
    90                 __LINE__, totOffRow, totOffCol, flatImage->numRows, flatImage->numCols);
     96        psErrorMsg(PS_ERRORNAME_DOMAIN "pmFlatField", PS_ERR_BAD_PARAMETER_SIZE, true,
     97                   PS_ERRORTEXT_pmFlatField_OFFSET_FLAT_IMAGE,
     98                   totOffRow, totOffCol, flatImage->numRows, flatImage->numCols);
    9199        return false;
    92100    } else if(totOffRow>=inImage->numRows || totOffCol>=inImage->numCols) {
    93         psError(__func__, " : Line %d - Total offset >= input image: (%d, %d) vs (%d, %d)",
    94                 __LINE__, totOffRow, totOffCol, inImage->numRows, inImage->numCols);
     101        psErrorMsg(PS_ERRORNAME_DOMAIN "pmFlatField", PS_ERR_BAD_PARAMETER_SIZE, true,
     102                   PS_ERRORTEXT_pmFlatField_OFFSET_INPUT_IMAGE,
     103                   totOffRow, totOffCol, inImage->numRows, inImage->numCols);
    95104        return false;
    96105    } else if(totOffRow>=inMask->numRows || totOffCol>=inMask->numCols) {
    97         psError(__func__, " : Line %d - Total offset >= input image mask: (%d, %d) vs (%d, %d)",
    98                 __LINE__, totOffRow, totOffCol, inMask->numRows, inMask->numCols);
     106        psErrorMsg(PS_ERRORNAME_DOMAIN "pmFlatField", PS_ERR_BAD_PARAMETER_SIZE, true,
     107                   PS_ERRORTEXT_pmFlatField_OFFSET_MASK_IMAGE,
     108                   totOffRow, totOffCol, inMask->numRows, inMask->numCols);
    99109        return false;
    100110    }
     
    105115    maskType = inMask->type.type;
    106116    if(PS_IS_PSELEMTYPE_COMPLEX(inType)) {
    107         psError(__func__, " : Line %d - Complex types not allowed for input image. Type: %d", __LINE__,
    108                 inType);
     117        psErrorMsg(PS_ERRORNAME_DOMAIN "pmFlatField", PS_ERR_BAD_PARAMETER_TYPE, true,
     118                   PS_ERRORTEXT_pmFlatField_TYPE_INPUT_IMAGE,
     119                   inType);
    109120        return false;
    110121    } else if(PS_IS_PSELEMTYPE_COMPLEX(flatType)) {
    111         psError(__func__, " : Line %d - Complex types not allowed for flat image. Type: %d", __LINE__,
    112                 flatType);
     122        psErrorMsg(PS_ERRORNAME_DOMAIN "pmFlatField", PS_ERR_BAD_PARAMETER_TYPE, true,
     123                   PS_ERRORTEXT_pmFlatField_TYPE_FLAT_IMAGE,
     124                   flatType);
    113125        return false;
    114126    } else if(maskType != PS_TYPE_MASK) {
    115         psError(__func__, " : Line %d - Mask must be PS_TYPE_MASK type. Type: %d", __LINE__, maskType);
     127        psErrorMsg(PS_ERRORNAME_DOMAIN "pmFlatField", PS_ERR_BAD_PARAMETER_TYPE, true,
     128                   PS_ERRORTEXT_pmFlatField_TYPE_MASK_IMAGE,
     129                   maskType);
    116130        return false;
    117131    } else if(inType != flatType) {
    118         psError(__func__, " : Line %d - Input and flat image types differ: (%d vs %d)", __LINE__, inType,
    119                 flatType);
     132        psErrorMsg(PS_ERRORNAME_DOMAIN "pmFlatField", PS_ERR_BAD_PARAMETER_TYPE, true,
     133                   PS_ERRORTEXT_pmFlatField_TYPE_MISMATCH,
     134                   inType, flatType);
    120135        return false;
    121136    }
     
    155170        PM_FLAT_DIVISION(F64);
    156171    default:
    157         psError(__func__, "Unsupported image datatype. Type: %d", inType);
     172        psErrorMsg(PS_ERRORNAME_DOMAIN "pmFlatField", PS_ERR_BAD_PARAMETER_TYPE, true,
     173                   PS_ERRORTEXT_pmFlatField_TYPE_UNSUPPORTED,
     174                   inType);
    158175    }
    159176
Note: See TracChangeset for help on using the changeset viewer.