Changeset 21366 for trunk/psphot/src/psphotSignificanceImage.c
- Timestamp:
- Feb 5, 2009, 5:03:33 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/psphotSignificanceImage.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphotSignificanceImage.c
r21183 r21366 1 1 # include "psphotInternal.h" 2 2 3 // In this function, we smooth the image and weight, then generate the significance image :3 // In this function, we smooth the image and variance, then generate the significance image : 4 4 // (S/N)^2. If FWMH_X,Y have been recorded, use them, otherwise use PEAKS_SMOOTH_SIGMA for the 5 5 // smoothing kernel. … … 10 10 bool guess = false; 11 11 12 // smooth the image and weightmap12 // smooth the image and variance map 13 13 psTimerStart ("psphot.smooth"); 14 14 bool oldThreads = psImageConvolveSetThreads(true); // Old value of threading in psImageConvolve … … 48 48 psLogMsg("psphot", PS_LOG_MINUTIA, "smooth image: %f sec\n", psTimerMark("psphot.smooth")); 49 49 50 // Smooth the weight, applying the mask as we go. The variance is smoothed by the PSF^2,50 // Smooth the variance, applying the mask as we go. The variance is smoothed by the PSF^2, 51 51 // renomalized to maintain the input level of the variance. We achieve this by smoothing 52 52 // with a Gaussian with sigma = SIGMA_SMTH/sqrt(2) with unity normalization. Note that … … 55 55 // measurements based on apertures comparable to or larger than the smoothing kernel, the 56 56 // effective per-pixel variance is maintained. 57 psImage *smooth_wt = psImageCopy(NULL, readout-> weight, PS_TYPE_F32);57 psImage *smooth_wt = psImageCopy(NULL, readout->variance, PS_TYPE_F32); 58 58 psImageSmoothMask_Threaded(smooth_wt, smooth_wt, readout->mask, maskVal, SIGMA_SMTH * M_SQRT1_2, 59 59 NSIGMA_SMTH, minGauss); 60 psLogMsg("psphot", PS_LOG_MINUTIA, "smooth weight: %f sec\n", psTimerMark("psphot.smooth"));60 psLogMsg("psphot", PS_LOG_MINUTIA, "smooth variance: %f sec\n", psTimerMark("psphot.smooth")); 61 61 62 62 psImage *mask = readout->mask; … … 100 100 101 101 float factor = guess ? 4.0 * M_PI * PS_SQR(SIGMA_SMTH) : 4.0 * M_PI * PS_SQR(SIGMA_SMTH); 102 103 // Correct the correction factor for the covariance produced by the (potentially multiple) smoothing 104 psKernel *kernel = psImageSmoothKernel(SIGMA_SMTH, NSIGMA_SMTH); // Kernel used for smoothing 105 psKernel *covar = psImageCovarianceCalculate(kernel, readout->covariance); // Covariance matrix 106 psFree(kernel); 107 factor /= psImageCovarianceFactor(covar); 108 psFree(covar); 109 102 110 // record the effective area and significance scaling factor 103 111 float effArea = 8.0 * M_PI * PS_SQR(SIGMA_SMTH);
Note:
See TracChangeset
for help on using the changeset viewer.
