IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 7436


Ignore:
Timestamp:
Jun 8, 2006, 10:55:52 AM (20 years ago)
Author:
eugene
Message:

account for masked pixels when generating smoothed image

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psphot/src/psphotFindPeaks.c

    r6950 r7436  
    88    float SIGMA;
    99    float threshold;
     10    float value;
    1011
    1112    // smooth the image and weight map
     
    1516    NSIGMA = psMetadataLookupF32 (&status, recipe, "PEAKS_SMOOTH_NSIGMA");
    1617
     18    // XXX we are somewhat doing the wrong thing here with the mask.
     19    // it would be better to smooth the image using the mask information
    1720    psImage *smooth_im = psImageCopy (NULL, readout->image, PS_TYPE_F32);
    1821    psImageSmooth (smooth_im, SIGMA, NSIGMA);
     
    2326    psLogMsg ("psphot", 4, "smooth weight: %f sec\n", psTimerMark ("psphot"));
    2427
     28    psImage *mask = readout->mask;
     29
    2530    // psphotSaveImage (NULL, smooth_im, "imsmooth.fits");
    2631    // psphotSaveImage (NULL, smooth_wt, "wtsmooth.fits");
     
    2934    for (int j = 0; j < smooth_im->numRows; j++) {
    3035        for (int i = 0; i < smooth_im->numCols; i++) {
     36            value = smooth_im->data.F32[j][i];
     37            smooth_im->data.F32[j][i] = 0.0;
     38            if (mask->data.U8[j][i]) continue;
    3139            if (smooth_wt->data.F32[j][i] <= 0) continue;
    32             smooth_im->data.F32[j][i] = PS_SQR(smooth_im->data.F32[j][i]) / smooth_wt->data.F32[j][i];
     40            smooth_im->data.F32[j][i] = PS_SQR(value) / smooth_wt->data.F32[j][i];
    3341        }
    3442    }
Note: See TracChangeset for help on using the changeset viewer.