IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 10, 2006, 10:54:52 AM (20 years ago)
Author:
Paul Price
Message:

Fixing error messages. Fixing the image size limit check (was >= needed to be >).

File:
1 edited

Legend:

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

    r7857 r7858  
    1818 *  @author Ross Harman, MHPCC
    1919 *
    20  *  @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
    21  *  @date $Date: 2006-07-10 20:46:57 $
     20 *  @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
     21 *  @date $Date: 2006-07-10 20:54:52 $
    2222 *
    2323 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    3333
    3434#include <pslib.h>
     35#include "pmFPA.h"
    3536#include "pmFlatField.h"
    3637#include "pmFPAMaskWeight.h"
     
    5657    psImage *flatImage = flat->image;   // Flat-field image
    5758
    58     // Check input image and its mask are not larger than flat image
     59    // Check input image is not larger than flat image; mask is the same size as the input
    5960    if (inImage->numRows > flatImage->numRows || inImage->numCols > flatImage->numCols) {
    60         psError(PS_ERR_BAD_PARAMETER_SIZE, true,
    61                 PS_ERRORTEXT_pmFlatField_SIZE_INPUT_IMAGE,
    62                 inImage->numRows, inImage->numCols, flatImage->numRows, flatImage->numCols);
    63         return false;
    64     }
    65     if (inMask && (inMask->numRows > flatImage->numRows || inMask->numCols > flatImage->numCols)) {
    66         psError(PS_ERR_BAD_PARAMETER_SIZE, true,
    67                 PS_ERRORTEXT_pmFlatField_SIZE_MASK_IMAGE,
    68                 inMask->numRows, inMask->numCols, flatImage->numRows, flatImage->numCols);
     61        psError(PS_ERR_BAD_PARAMETER_SIZE, true, "Input image (%dx%d) is larger than flat-field image "
     62                "(%dx%d).\n", inImage->numCols, inImage->numRows, flatImage->numCols, flatImage->numRows);
    6963        return false;
    7064    }
     
    8175
    8276    // Check that offsets are within image limits
    83     if (inImage->numRows + yOffset >= flatImage->numRows ||
    84             inImage->numCols + xOffset >= flatImage->numCols) {
    85         psError(PS_ERR_BAD_PARAMETER_SIZE, true,
    86                 PS_ERRORTEXT_pmFlatField_OFFSET_FLAT_IMAGE,
    87                 yOffset, xOffset, flatImage->numRows, flatImage->numCols);
     77    if (inImage->numRows + yOffset > flatImage->numRows ||
     78            inImage->numCols + xOffset > flatImage->numCols) {
     79        psError(PS_ERR_BAD_PARAMETER_SIZE, true, "Input image (%dx%d) with offsets (%d,%d) is larger than "
     80                "flat-field image (%dx%d).\n", inImage->numCols, inImage->numRows, xOffset, yOffset,
     81                flatImage->numCols, flatImage->numRows);
    8882        return false;
    8983    }
     
    118112        FLAT_DIVISION_CASE(F64, NAN);
    119113    default:
    120         psError(PS_ERR_BAD_PARAMETER_TYPE, true,
    121                 PS_ERRORTEXT_pmFlatField_TYPE_UNSUPPORTED,
    122                 inImage->type.type);
     114        psError(PS_ERR_BAD_PARAMETER_TYPE, true, "Unsupported type for input image: %x\n", inImage->type.type);
    123115        return false;
    124116    }
Note: See TracChangeset for help on using the changeset viewer.