Changeset 21407
- Timestamp:
- Feb 6, 2009, 3:58:50 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/psphotSignificanceImage.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphotSignificanceImage.c
r21366 r21407 72 72 } 73 73 74 // We have an input image with PSF size sigma_r. We have smoothed it with a kernel of size 75 // sigma_s. The result is an image with PSF size sigma_o: sigma_o^2 = sigma_r^2 + 76 // sigma_s^2. Ideally, we are choosing sigma_s = sigma_r, in which case sigma_o^2 = 2 77 // sigma_s^2. If we do not know the input image PSF size (initial detection stage), then 78 // we are assuming that sigma_r = sigma_s. 79 80 // Build the significance image on top of smooth_im. We need to correct the ratio im/wt by 81 // 2 factors: 1) the relationship the peak value and the integrated flux, and 2) the 82 // relationship between the per-pixel variance (var_i) and the total variance included in 83 // the flux measurement (effective area). These latter correction comes from: flux = Io * 84 // 2\pi\sigma_o^2 and total variance = var_i * 4\pi\sigma_o^2, thus (S/N)^2 = flux^2 / var 85 // = (Io/var_i) \pi sigma_o^2 86 87 // in fact, because of the smoothing and the resulting correlated errors, the per-pixel 88 // variance is a bit smaller than the value predicted here. The total variance should be 89 // \alpha 4\pi(\sigma_r_^2 + \sigma_s^2) where \alpha approaches 1 for \sigma_s / \sigma_r 90 // << 1, and \alpha approaches 0.5 for \sigma_s / \sigma_r >> 1, with a value of 0.7 91 // (actually 1/1.5) for \sigma_s = \sigma_r 92 93 // if the smoothing kernel size is known to be the psf size (\sigma_s = \sigma_r), then we 94 // can use the scaling factor of 1/1.5; otherwise, we want to be conservative and use \alpha 95 // = 0.5. Thus, for the guess smoothing kernel, (S/N)^2 = 3.0 (Io/var_i) \pi sigma_s^2 for 96 // the guess case and (S/N)^2 = 2.0 (Io/var_i) \pi sigma_s^2 for the known case 97 98 // XXX hmm, somehow the simulations are coming up with 4pi, not 3pi (as if \alpha is 1/2.0, 99 // not 1/1.5 for sigma_s = sigma_r... 100 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 74 // Calculate correction factor for the covariance produced by the (potentially multiple) smoothing 104 75 psKernel *kernel = psImageSmoothKernel(SIGMA_SMTH, NSIGMA_SMTH); // Kernel used for smoothing 105 76 psKernel *covar = psImageCovarianceCalculate(kernel, readout->covariance); // Covariance matrix 106 77 psFree(kernel); 107 f actor /=psImageCovarianceFactor(covar);78 float factor = 1.0 / psImageCovarianceFactor(covar); 108 79 psFree(covar); 109 80
Note:
See TracChangeset
for help on using the changeset viewer.
