Changeset 26894 for trunk/psphot/src/psphotSignificanceImage.c
- Timestamp:
- Feb 10, 2010, 7:36:29 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/psphotSignificanceImage.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphotSignificanceImage.c
r25383 r26894 22 22 } 23 23 24 // if we have already determined the PSF model, then we have a better idea how to smooth this image 24 25 bool statusMajor, statusMinor; 25 float fwhmMajor = psMetadataLookupF32(&statusMajor, re cipe, "FWHM_MAJ");26 float fwhmMinor = psMetadataLookupF32(&statusMinor, re cipe, "FWHM_MIN");26 float fwhmMajor = psMetadataLookupF32(&statusMajor, readout->analysis, "FWHM_MAJ"); 27 float fwhmMinor = psMetadataLookupF32(&statusMinor, readout->analysis, "FWHM_MIN"); 27 28 if (statusMajor && statusMinor) { 28 29 // if we know the FHWM, use that to set the smoothing kernel (XXX allow an optional override?) … … 43 44 } 44 45 // record the actual smoothing sigma 45 psMetadataAddF32(recipe, PS_LIST_TAIL, "SIGMA_SMOOTH", PS_META_REPLACE, "Smoothing sigma for detections", 46 SIGMA_SMTH); 46 psMetadataAddF32(readout->analysis, PS_LIST_TAIL, "SIGMA_SMOOTH", PS_META_REPLACE, "Smoothing sigma for detections", SIGMA_SMTH); 47 47 48 48 // smooth the image, applying the mask as we go … … 59 59 // effective per-pixel variance is maintained. 60 60 psImage *smooth_wt = psImageCopy(NULL, readout->variance, PS_TYPE_F32); 61 psImageSmoothMask_Threaded(smooth_wt, smooth_wt, readout->mask, maskVal, SIGMA_SMTH * M_SQRT1_2, 62 NSIGMA_SMTH, minGauss); 61 psImageSmoothMask_Threaded(smooth_wt, smooth_wt, readout->mask, maskVal, SIGMA_SMTH * M_SQRT1_2, NSIGMA_SMTH, minGauss); 63 62 psLogMsg("psphot", PS_LOG_MINUTIA, "smooth variance: %f sec\n", psTimerMark("psphot.smooth")); 64 63 … … 77 76 // Calculate correction factor for the covariance produced by the (potentially multiple) smoothing 78 77 psKernel *kernel = psImageSmoothKernel(SIGMA_SMTH, NSIGMA_SMTH); // Kernel used for smoothing 79 psKernel *covar = psImageCovarianceCalculate(kernel, readout->covariance); // Covariance matrix78 float factor = 1.0 / psImageCovarianceCalculateFactor(kernel, readout->covariance); 80 79 psFree(kernel); 81 float factor = 1.0 / psImageCovarianceFactor(covar);82 psFree(covar);83 80 84 81 // record the effective area and significance scaling factor 85 82 float effArea = 8.0 * M_PI * PS_SQR(SIGMA_SMTH); 86 psMetadataAddF32(recipe, PS_LIST_TAIL, "EFFECTIVE_AREA", PS_META_REPLACE, "Effective Area", effArea); 87 psMetadataAddF32(recipe, PS_LIST_TAIL, "SIGNIFICANCE_SCALE_FACTOR", PS_META_REPLACE, 88 "Signicance scale factor", factor); 83 psMetadataAddF32(readout->analysis, PS_LIST_TAIL, "EFFECTIVE_AREA", PS_META_REPLACE, "Effective Area", effArea); 84 psMetadataAddF32(readout->analysis, PS_LIST_TAIL, "SIGNIFICANCE_SCALE_FACTOR", PS_META_REPLACE, "Signicance scale factor", factor); 89 85 90 86 // XXX multithread this if needed
Note:
See TracChangeset
for help on using the changeset viewer.
