IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 17, 2005, 12:49:18 PM (21 years ago)
Author:
gusciora
Message:

Fixed problem with the pmReadout->row0 col0 inititalization.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/test/tst_pmReadoutCombine.c

    r4770 r4811  
    55 *  @author GLG, MHPCC
    66 *
    7  *  @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
    8  *  @date $Date: 2005-08-16 01:10:36 $
     7 *  @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
     8 *  @date $Date: 2005-08-17 22:49:18 $
    99 *
    1010 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    2626static int test01(void);
    2727testDescription tests[] = {
    28                               {test00, 000, "pmSubtractBias", 0, false},
    29                               {test01, 000, "pmSubtractBias(): input parameter error conditions", 0, false},
     28                              {test00, 000, "pmSubtractBias(): Basic readout combines with no image overlap", true, false},
     29                              {test01, 000, "pmSubtractBias(): input parameter error conditions", true, false},
    3030                              {NULL}
    3131                          };
     
    6464readouts and calls pmReadoutCombine().
    6565 *****************************************************************************/
    66 
    6766int simpleCombineNoOverlap(psS32 numInputCols, psS32 numInputRows)
    6867{
     
    9998    params->nKeep = 0;
    10099
     100    //
     101    // Create a psList of psReadouts.  The pixels in readout r will all have the
     102    // value r.
     103    //
    101104    for (r=0;r<NUM_READOUTS;r++) {
    102105        baseRowsReadout[r] = r + 40;
     
    118121        *(int *) (& (tmpImage->row0)) = baseRows[r];
    119122        *(int *) (& (tmpImage->col0)) = baseCols[r];
    120         /*
    121                 pmReadout *tmpReadout = pmReadoutAlloc(baseColsReadout[r],
    122                                                        baseRowsReadout[r],
    123                                                        tmpImage);
    124         */
    125123        pmReadout *tmpReadout = pmReadoutAlloc(NULL);
     124        tmpReadout->row0 = 0;
     125        tmpReadout->col0 = 0;
    126126        tmpReadout->image = tmpImage;
    127127
     
    142142    output = pmReadoutCombine(output, list, params, zero, scale, true, 0.0, 0.0);
    143143    psF32 NR = (psF32) NUM_READOUTS;
    144     //    psF32 expectedPixel = ((((NR-1.0) * (NR/2.0)) / NR) + VEC_ZERO) * VEC_SCALE;
    145144    psF32 expectedPixel = ((NR/2.0) * (VEC_ZERO + (VEC_ZERO + VEC_SCALE * (NR - 1)))) / NR;
    146145
    147     VerifyTheOutput(output, expectedPixel);
     146    int testStatus = VerifyTheOutput(output, expectedPixel);
    148147
    149148    psFree(params->stats);
     
    162161
    163162    printFooter(stdout, "pmReadoutCombine", "simpleCombineNoOverlap", true);
    164     return(0);
     163    return(testStatus);
    165164}
    166165
     
    177176}
    178177
     178/******************************************************************************
     179test01(): we simply call pmReadoutCombine() with a variety of erroneous input
     180parameter combinations and verify that it behaves properly.
     181 *****************************************************************************/
    179182int test01()
    180183{
     184    int testStatus = true;
    181185    int i;
    182186    int r;
     
    203207    psVector *scaleBig = psVectorAlloc(NUM_READOUTS*2, PS_TYPE_F32);
    204208    psVector *scaleF64 = psVectorAlloc(NUM_READOUTS, PS_TYPE_F64);
    205     int testStatus = true;
    206209    for (i=0;i<NUM_READOUTS;i++) {
    207210        zero->data.F32[i] = 3.0;
     
    236239        *(int *) (& (tmpImage->row0)) = baseRows[r];
    237240        *(int *) (& (tmpImage->col0)) = baseCols[r];
    238         /*
    239                 pmReadout *tmpReadout = pmReadoutAlloc(baseColsReadout[r],
    240                                                        baseRowsReadout[r],
    241                                                        tmpImage);
    242         */
    243241        pmReadout *tmpReadout = pmReadoutAlloc(NULL);
     242        tmpReadout->row0 = 0;
     243        tmpReadout->col0 = 0;
    244244        tmpReadout->image = tmpImage;
    245245        minOutRow = PS_MIN(minOutRow, (baseRowsReadout[r] + baseRows[r]));
     
    449449
    450450    printFooter(stdout, "pmReadoutCombine", "Testing bad input parameter conditions", true);
    451     return(!testStatus);
     451    return(testStatus);
    452452}
Note: See TracChangeset for help on using the changeset viewer.