IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 30, 2004, 12:22:00 PM (22 years ago)
Author:
gusciora
Message:

Added better error checking.

File:
1 edited

Legend:

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

    r2832 r2857  
    55 *  @author GLG, MHPCC
    66 *
    7  *  @version $Revision: 1.17 $ $Name: not supported by cvs2svn $
    8  *  @date $Date: 2004-12-27 23:16:51 $
     7 *  @version $Revision: 1.18 $ $Name: not supported by cvs2svn $
     8 *  @date $Date: 2004-12-30 22:22:00 $
    99 *
    1010 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    8282    if (1 < DetermineNumBits(params->stats->options)) {
    8383        psError(PS_ERR_UNKNOWN, true,
    84                 "Multiple statistical options have been requested.\n");
     84                "Multiple statistical options have been requested.  Returning NULL.\n");
    8585        return(NULL);
    8686    }
     
    128128        PS_VECTOR_CHECK_TYPE(zero, PS_TYPE_F32, NULL);
    129129        if (numInputs > zero->n) {
    130             psError(PS_ERR_UNKNOWN, true, "zero vector has incorrect size (%d)\n", zero->n);
     130            psError(PS_ERR_UNKNOWN, true, "zero vector has incorrect size (%d).  Returning NULL.\n", zero->n);
    131131            return(NULL);
    132132        } else if (numInputs < zero->n) {
     
    140140        PS_VECTOR_CHECK_TYPE(scale, PS_TYPE_F32, NULL);
    141141        if (numInputs > scale->n) {
    142             psError(PS_ERR_UNKNOWN, true, "scale vector has incorrect size (%d)\n", scale->n);
     142            psError(PS_ERR_UNKNOWN, true, "scale vector has incorrect size (%d).  Returning NULL.\n", scale->n);
    143143            return(NULL);
    144144        } else if (numInputs < scale->n) {
     
    163163                ((output->row0 + output->numRows) < maxInputRows)) {
    164164            psError(PS_ERR_UNKNOWN, true,
    165                     "Output image (%d, %d) is too small to hold combined images.\n",
     165                    "Output image (%d, %d) is too small to hold combined images.  Returning NULL.\n",
    166166                    output->row0 + output->numRows,
    167167                    output->col0 + output->numCols);
     
    171171        if ((output->col0 > minInputCols) || (output->row0 > minInputRows)) {
    172172            psError(PS_ERR_UNKNOWN, true,
    173                     "Output image offset is larger then input image offset.\n");
     173                    "Output image offset is larger then input image offset.  Returning NULL.\n");
    174174            return(NULL);
    175175        }
     
    313313                }
    314314                // Calculate the specified statistic on the stack of pixels.
    315                 stats = psVectorStats(stats,
    316                                       tmpPixels,
    317                                       tmpPixelErrors,
    318                                       tmpPixelMaskNKeep,
    319                                       1);
     315                psStats *rc = psVectorStats(stats,
     316                                            tmpPixels,
     317                                            tmpPixelErrors,
     318                                            tmpPixelMaskNKeep,
     319                                            1);
     320                if (rc == NULL) {
     321                    psError(PS_ERR_UNKNOWN, false, "psVectorStats(): could not perform requested statistical operation.  Returning NULL.\n");
     322                    return(NULL);
     323                }
    320324            } else {
    321325                if (scale != NULL) {
     
    333337
    334338                // Calculate the specified statistic on the stack of pixels.
    335                 stats = psVectorStats(stats,
    336                                       tmpPixels,
    337                                       NULL,
    338                                       tmpPixelMaskNKeep,
    339                                       1);
     339                psStats *rc = psVectorStats(stats,
     340                                            tmpPixels,
     341                                            NULL,
     342                                            tmpPixelMaskNKeep,
     343                                            1);
     344                if (rc == NULL) {
     345                    psError(PS_ERR_UNKNOWN, false, "psVectorStats(): could not perform requested statistical operation.  Returning NULL.\n");
     346                    return(NULL);
     347                }
    340348            }
    341349
     
    344352            double statValue;
    345353            if (!p_psGetStatValue(stats, &statValue)) {
    346                 psError(PS_ERR_UNKNOWN, true, "Could not determine stats value.\n");
     354                psError(PS_ERR_UNKNOWN, true, "Could not determine stats value.  Returning NULL.\n");
    347355                return(NULL);
    348356            } else {
Note: See TracChangeset for help on using the changeset viewer.