IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 29, 2008, 2:53:45 PM (18 years ago)
Author:
eugene
Message:

defer construction of blank of concepts until element is used

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/detrend/pmMaskBadPixels.c

    r17228 r18364  
    100100    if (suspect) {
    101101        PS_ASSERT_IMAGE_NON_EMPTY(suspect, false);
    102         PS_ASSERT_IMAGE_TYPE(suspect, PS_TYPE_S32, false);
     102        PS_ASSERT_IMAGE_TYPE(suspect, PS_TYPE_F32, false);
    103103        PS_ASSERT_IMAGES_SIZE_EQUAL(readout->image, suspect, false);
    104104        psMemIncrRefCounter(suspect);
    105105    } else {
    106         suspect = psImageAlloc(readout->image->numCols, readout->image->numRows, PS_TYPE_S32);
     106        suspect = psImageAlloc(readout->image->numCols, readout->image->numRows, PS_TYPE_F32);
    107107        psImageInit(suspect, 0);
    108108        psMetadataAddImage(output->analysis, PS_LIST_TAIL, PM_MASK_ANALYSIS_SUSPECT, PS_META_REPLACE,
     
    115115        // If we get down here and the statistics are missing, then we should go and mask the entire image
    116116        psWarning("Missing statistics --- flagging entire image as suspect.");
    117         return (psImage*)psBinaryOp(suspect, suspect, "+", psScalarAlloc(1.0, PS_TYPE_S32));
     117        return (psImage*)psBinaryOp(suspect, suspect, "+", psScalarAlloc(1.0, PS_TYPE_F32));
    118118    }
    119119
     
    126126        for (int x = 0; x < image->numCols; x++) {
    127127            if (fabs((image->data.F32[y][x] - median) / stdev) >= rej &&
    128                     (!mask || !(mask->data.PS_TYPE_MASK_DATA[y][x] & maskVal))) {
    129                 suspect->data.S32[y][x]++;
     128                (!mask || !(mask->data.PS_TYPE_MASK_DATA[y][x] & maskVal))) {
     129                suspect->data.F32[y][x] += 1.0;
    130130            }
    131131        }
     
    149149    }
    150150    PS_ASSERT_IMAGE_NON_EMPTY(suspects, false);
    151     PS_ASSERT_IMAGE_TYPE(suspects, PS_TYPE_S32, false);
     151    PS_ASSERT_IMAGE_TYPE(suspects, PS_TYPE_F32, false);
    152152    if (output->mask) {
    153153        PS_ASSERT_IMAGE_NON_EMPTY(output->mask, false);
     
    243243    for (int y = 0; y < suspects->numRows; y++) {
    244244        for (int x = 0; x < suspects->numCols; x++) {
    245             if (suspects->data.S32[y][x] >= limit) {
     245            if (suspects->data.F32[y][x] >= limit) {
    246246                badpix->data.PS_TYPE_MASK_DATA[y][x] = maskVal;
    247247            }
Note: See TracChangeset for help on using the changeset viewer.