IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 13, 2009, 12:47:32 PM (17 years ago)
Author:
giebink
Message:

Account for weight(s) to variance(s) change

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/test/camera/tap_pmFPACopy.c

    r21220 r21474  
    5151    readout->image = psImageAlloc(SOURCE_NUM_COLS, SOURCE_NUM_ROWS, PS_TYPE_F32);
    5252    readout->mask = psImageAlloc(SOURCE_NUM_COLS, SOURCE_NUM_ROWS, PS_TYPE_U8);
    53     readout->weight = psImageAlloc(SOURCE_NUM_COLS, SOURCE_NUM_ROWS, PS_TYPE_F32);
     53    readout->variance = psImageAlloc(SOURCE_NUM_COLS, SOURCE_NUM_ROWS, PS_TYPE_F32);
    5454    for (int i = 0 ; i < SOURCE_NUM_ROWS ; i++) {
    5555        for (int j = 0 ; j < SOURCE_NUM_COLS ; j++) {
    5656            readout->image->data.F32[i][j] = (float) (i + j + SOURCE_BASE);
    5757            readout->mask->data.U8[i][j] = (psU8) (i + j + SOURCE_BASE);
    58             readout->weight->data.F32[i][j] = (float) (i + j + SOURCE_BASE);
     58            readout->variance->data.F32[i][j] = (float) (i + j + SOURCE_BASE);
    5959        }
    6060    }
     
    144144    readout->image = psImageAlloc(TARGET_NUM_COLS, TARGET_NUM_ROWS, PS_TYPE_F32);
    145145    readout->mask = psImageAlloc(TARGET_NUM_COLS, TARGET_NUM_ROWS, PS_TYPE_U8);
    146     readout->weight = psImageAlloc(TARGET_NUM_COLS, TARGET_NUM_ROWS, PS_TYPE_F32);
     146    readout->variance = psImageAlloc(TARGET_NUM_COLS, TARGET_NUM_ROWS, PS_TYPE_F32);
    147147    for (int i = 0 ; i < TARGET_NUM_ROWS ; i++) {
    148148        for (int j = 0 ; j < TARGET_NUM_COLS ; j++) {
    149149            readout->image->data.F32[i][j] = (float) (i + j + TARGET_BASE);
    150150            readout->mask->data.U8[i][j] = (psU8) (i + j + TARGET_BASE);
    151             readout->weight->data.F32[i][j] = (float) (i + j + TARGET_BASE);
     151            readout->variance->data.F32[i][j] = (float) (i + j + TARGET_BASE);
    152152        }
    153153    }
     
    260260        }
    261261
    262         psImage *weightTarget = readoutTarget->weight;
    263         psImage *weightSource = readoutSource->weight;
     262        psImage *varianceTarget = readoutTarget->variance;
     263        psImage *varianceSource = readoutSource->variance;
    264264        for (int i = 0 ; i < SOURCE_NUM_ROWS ; i++) {
    265265            for (int j = 0 ; j < SOURCE_NUM_COLS ; j++) {
    266                 if (weightTarget->data.F32[i][j] != weightSource->data.F32[i][j]) {
    267                     diag("ERROR: target readout[%d] weight[%d][%d] is %.2f, should be %.2f",
    268                           readoutID, i, j, weightTarget->data.F32[i][j], weightSource->data.F32[i][j]);
     266                if (varianceTarget->data.F32[i][j] != varianceSource->data.F32[i][j]) {
     267                    diag("ERROR: target readout[%d] variance[%d][%d] is %.2f, should be %.2f",
     268                          readoutID, i, j, varianceTarget->data.F32[i][j], varianceSource->data.F32[i][j]);
    269269                    errorFlag = true;
    270270                }
     
    272272        }
    273273        if (errorFlag) {
    274             diag("ERROR: pmCellCopy() did not set the data for readout %d, weight correctly", readoutID);
     274            diag("ERROR: pmCellCopy() did not set the data for readout %d, variance correctly", readoutID);
    275275        }
    276276    }
     
    317317            errorFlag = true;
    318318        }
    319         if (readoutTarget->weight->numRows != SOURCE_NUM_ROWS ||
    320             readoutTarget->weight->numCols != SOURCE_NUM_COLS) {
    321             diag("ERROR: readoutTarget->weight size is (%d by %d)\n", readoutTarget->weight->numRows,
    322                   readoutTarget->weight    ->numCols);
     319        if (readoutTarget->variance->numRows != SOURCE_NUM_ROWS ||
     320            readoutTarget->variance->numCols != SOURCE_NUM_COLS) {
     321            diag("ERROR: readoutTarget->variance size is (%d by %d)\n", readoutTarget->variance->numRows,
     322                  readoutTarget->variance->numCols);
    323323            errorFlag = true;
    324324        }
Note: See TracChangeset for help on using the changeset viewer.