IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 15, 2005, 10:09:03 AM (21 years ago)
Author:
gusciora
Message:

SubtractBias was recoded. Significant mods to removeBadPixels.
Additional mods to other files.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/test/imsubtract/tst_pmSubtractSky.c

    r5169 r5516  
    77 *  @author GLG, MHPCC
    88 *
    9  *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2005-09-28 20:42:52 $
     9 *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2005-11-15 20:09:03 $
     11 *
     12 *  XXX: I added the CELL.TRIMSEC region code but there are not tests for it.
    1113 *
    1214 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
    1315 */
    14 
    15 
    16 
    1716#include "psTest.h"
    1817#include "pslib.h"
     
    6766    myReadout = pmSubtractSky(myReadout, (void *) myPoly, PM_FIT_POLYNOMIAL,
    6867                              binFactor, myStats, 10.0);
    69     for (i=0;i<numRows;i++) {
    70         for (j=0;j<numCols;j++) {
    71             if (ERROR_TOLERANCE < fabs(myReadout->image->data.F32[i][j])) {
    72                 printf("TEST ERROR: image[%d][%d] is %f, should be 0.0\n", i, j, myReadout->image->data.F32[i][j]);
    73                 testStatus = 1;
     68    if (myReadout == NULL) {
     69        printf("TEST ERROR: pmSubtractSky() returned NULL.\n");
     70        testStatus = 1;
     71    } else {
     72        for (i=0;i<numRows;i++) {
     73            for (j=0;j<numCols;j++) {
     74                if (ERROR_TOLERANCE < fabs(myReadout->image->data.F32[i][j])) {
     75                    printf("TEST ERROR: image[%d][%d] is %f, should be 0.0\n", i, j, myReadout->image->data.F32[i][j]);
     76                    testStatus = 1;
     77                }
    7478            }
    7579        }
     
    117121    myReadout = pmSubtractSky(myReadout, (void *) myPoly, PM_FIT_POLYNOMIAL,
    118122                              binFactor, myStats, 2.0);
    119     for (i=0;i<numRows;i++) {
    120         for (j=0;j<numCols;j++) {
    121             if (errorTolerance < fabs(myReadout->image->data.F32[i][j] - trueImage->data.F32[i][j])) {
    122                 printf("TEST ERROR: image[%d][%d] is %f, should be %f\n", i, j,
    123                        myReadout->image->data.F32[i][j], trueImage->data.F32[i][j]);
    124                 testStatus = 1;
     123    if (myReadout == NULL) {
     124        printf("TEST ERROR: pmSubtractSky() returned NULL.\n");
     125        testStatus = 1;
     126    } else {
     127        for (i=0;i<numRows;i++) {
     128            for (j=0;j<numCols;j++) {
     129                if (errorTolerance < fabs(myReadout->image->data.F32[i][j] - trueImage->data.F32[i][j])) {
     130                    printf("TEST ERROR: image[%d][%d] is %f, should be %f\n", i, j,
     131                           myReadout->image->data.F32[i][j], trueImage->data.F32[i][j]);
     132                    testStatus = 1;
     133                }
    125134            }
    126135        }
Note: See TracChangeset for help on using the changeset viewer.