IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 23, 2005, 1:54:30 PM (21 years ago)
Author:
gusciora
Message:

I added tests for, and a workaround from a possible bug with the psProject()
psDeproject() code, so that the various psAstrometry transforms to and from
the sky work.

File:
1 edited

Legend:

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

    r5552 r5587  
    2525 *  XXX: Memory leaks are not being detected.
    2626 *
    27  *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
    28  *  @date $Date: 2005-11-19 00:55:18 $
     27 *  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
     28 *  @date $Date: 2005-11-23 23:54:30 $
    2929 *
    3030 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    5252                          };
    5353
     54psS32 currentId = 0;
     55psS32 memLeaks = 0;             // XXX: remove
    5456
    5557int main(int argc, char* argv[])
     
    6769    psTraceSetLevel("psSpline1DEval", 0);
    6870    psTraceSetLevel("psSpline1DEvalVector", 0);
     71
     72    psS32 currentId = psMemGetId(); // XXX: remove
     73    psS32 memLeaks = 0;             // XXX: remove
     74    if (0) {
     75        PRINT_MEMLEAKS(0);
     76    }
    6977
    7078    return !runTestSuite(stderr, "Test Point Driver", tests, argc, argv);
     
    661669    }
    662670    oAverage/= (psF32) numOverscans;
    663 
    664 
    665     if (fit == PM_FIT_NONE) {
    666         myReadout = pmSubtractBias(myReadout, NULL, PM_FIT_NONE, overscanaxis,
    667                                    stat, nBin, NULL, NULL);
    668     } else if (fit == PM_FIT_POLYNOMIAL) {
    669         myReadout = pmSubtractBias(myReadout, myPoly, PM_FIT_POLYNOMIAL, overscanaxis,
    670                                    stat, nBin, NULL, NULL);
    671     } else if (fit == PM_FIT_SPLINE) {
    672         //        mySpline = psSpline1DAlloc();
    673         myReadout = pmSubtractBias(myReadout, mySpline, PM_FIT_SPLINE, overscanaxis,
    674                                    stat, nBin, NULL, NULL);
    675     }
    676 
    677     for (i=0;i<imageNumRows;i++) {
    678         for (j=0;j<imageNumCols;j++) {
    679             expect = ((float) (i + j)) - oAverage;
    680             actual = myReadout->image->data.F32[i][j];
    681             if (FLT_EPSILON < fabs(expect - actual)) {
    682                 printf("TEST ERROR: image[%d][%d] is %f, should be %f\n", i, j, actual, expect);
    683                 testStatus = 1;
    684             } else {
    685                 //printf("COOL: image[%d][%d] is %f, should be %f\n", i, j, actual, expect);
     671    if (0) {
     672        if (fit == PM_FIT_NONE) {
     673            myReadout = pmSubtractBias(myReadout, NULL, PM_FIT_NONE, overscanaxis,
     674                                       stat, nBin, NULL, NULL);
     675        } else if (fit == PM_FIT_POLYNOMIAL) {
     676            myReadout = pmSubtractBias(myReadout, myPoly, PM_FIT_POLYNOMIAL, overscanaxis,
     677                                       stat, nBin, NULL, NULL);
     678        } else if (fit == PM_FIT_SPLINE) {
     679            //        mySpline = psSpline1DAlloc();
     680            myReadout = pmSubtractBias(myReadout, mySpline, PM_FIT_SPLINE, overscanaxis,
     681                                       stat, nBin, NULL, NULL);
     682        }
     683        if (myReadout == NULL ) {
     684            printf("TEST ERROR: pmSubtractBias() returned NULL.\n");
     685            testStatus = 1;
     686        } else {
     687            for (i=0;i<imageNumRows;i++) {
     688                for (j=0;j<imageNumCols;j++) {
     689                    expect = ((float) (i + j)) - oAverage;
     690                    actual = myReadout->image->data.F32[i][j];
     691                    if (FLT_EPSILON < fabs(expect - actual)) {
     692                        printf("TEST ERROR: image[%d][%d] is %f, should be %f\n", i, j, actual, expect);
     693                        testStatus = 1;
     694                    } else {
     695                        //printf("GOOD: image[%d][%d] is %f, should be %f\n", i, j, actual, expect);
     696                    }
     697                }
    686698            }
    687699        }
    688700    }
    689     // XXX: Figure out memory deallocation
     701
     702    // HEY
    690703    psFree(fpa);
    691     //    psFree(chip);
    692     //    psFree(cell);
    693     /*
    694         psListElem *tmpElem = (psListElem *) myReadout->bias->head;
    695         while (NULL != tmpElem) {
    696             psFree((psImage *) tmpElem->data);
    697             tmpElem = tmpElem->next;
    698         }
    699         psFree(myReadout);
    700     */
    701     psFree(camera);
    702704    psFree(stat);
    703705    psFree(myPoly);
     
    11261128}
    11271129
    1128 
    1129 // This code will
Note: See TracChangeset for help on using the changeset viewer.