Changeset 25261
- Timestamp:
- Sep 2, 2009, 5:00:06 PM (17 years ago)
- Location:
- branches/pap/psphot/src
- Files:
-
- 2 edited
-
psphotFake.c (modified) (4 diffs)
-
psphotSignificanceImage.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/pap/psphot/src/psphotFake.c
r25260 r25261 17 17 const pmReadout *ro, // Readout of interest 18 18 float thresh, // Threshold for source identification 19 float xFWHM, float yFWHM, // Size of PSF19 float fwhmMajor, float fwhmMinor, // Size of PSF 20 20 float smoothNsigma, // Smoothing limit 21 21 psImageMaskType maskVal // Value to mask … … 25 25 PM_ASSERT_READOUT_VARIANCE(ro, false); 26 26 27 float smoothSigma = 0.5*( xFWHM + yFWHM) / (2.0*sqrtf(2.0*log(2.0)));27 float smoothSigma = 0.5*(fwhmMajor + fwhmMinor) / (2.0*sqrtf(2.0*log(2.0))); 28 28 psKernel *kernel = psImageSmoothKernel(smoothSigma, smoothNsigma); // Kernel used for smoothing 29 29 psKernel *newCovar = psImageCovarianceCalculate(kernel, ro->covariance); // Covariance matrix … … 131 131 // Collect recipe information 132 132 bool mdok; // Status of MD lookup 133 float xFWHM = psMetadataLookupF32(NULL, recipe, "FWHM_X"); // PSF size in x134 float yFWHM = psMetadataLookupF32(NULL, recipe, "FWHM_Y"); // PSF size in y135 if (!isfinite( xFWHM) || !isfinite(yFWHM)) {136 psError(PSPHOT_ERR_CONFIG, false, "Unable to find FWHM_ X and FWHM_Yin recipe");133 float fwhmMajor = psMetadataLookupF32(NULL, recipe, "FWHM_MAJ"); // PSF size in x 134 float fwhmMinor = psMetadataLookupF32(NULL, recipe, "FWHM_MIN"); // PSF size in y 135 if (!isfinite(fwhmMajor) || !isfinite(fwhmMinor) || fwhmMajor == 0.0 || fwhmMinor == 0.0) { 136 psError(PSPHOT_ERR_CONFIG, false, "Unable to find FWHM_MAJ and FWHM_MIN in recipe"); 137 137 return false; 138 138 } … … 170 170 float magLim; // Guess at limiting magnitude 171 171 float minFlux; // Minimum flux for fake image 172 if (!fakeLimit(&magLim, &minFlux, readout, thresh, xFWHM, yFWHM, smoothNsigma, maskVal)) {172 if (!fakeLimit(&magLim, &minFlux, readout, thresh, fwhmMajor, fwhmMinor, smoothNsigma, maskVal)) { 173 173 psError(PS_ERR_UNKNOWN, false, "Unable to determine limits for image"); 174 174 return false; -
branches/pap/psphot/src/psphotSignificanceImage.c
r21407 r25261 22 22 } 23 23 24 bool status_x, status_y; 25 float FWHM_X = psMetadataLookupF32 (&status_x, recipe, "FWHM_X"); 26 float FWHM_Y = psMetadataLookupF32 (&status_y, recipe, "FWHM_Y"); 27 if (status_x && status_y) { 28 // if we know the FHWM, use that to set the smoothing kernel (XXX allow an optional override?) 29 SIGMA_SMTH = 0.5*(FWHM_X + FWHM_Y) / (2.0*sqrt(2.0*log(2.0))); 30 NSIGMA_SMTH = psMetadataLookupF32 (&status, recipe, "PEAKS_SMOOTH_NSIGMA"); 31 guess = false; 24 bool statusMajor, statusMinor; 25 float fwhmMajor = psMetadataLookupF32(&statusMajor, recipe, "FWHM_MAJ"); 26 float fwhmMinor = psMetadataLookupF32(&statusMinor, recipe, "FWHM_MIN"); 27 if (statusMajor && statusMinor) { 28 // if we know the FHWM, use that to set the smoothing kernel (XXX allow an optional override?) 29 if (!isfinite(fwhmMajor) || !isfinite(fwhmMinor) || fwhmMajor == 0.0 || fwhmMinor == 0.0) { 30 psWarning("fwhmMajor (%f) or fwhmMinor (%f) is bad!", fwhmMajor, fwhmMinor); 31 } 32 SIGMA_SMTH = 0.5*(fwhmMajor + fwhmMinor) / (2.0*sqrt(2.0*log(2.0))); 33 NSIGMA_SMTH = psMetadataLookupF32 (&status, recipe, "PEAKS_SMOOTH_NSIGMA"); 34 guess = false; 32 35 } else { 33 // if we do not know the FWHM, use the guess smoothing kernel supplied.34 // it is a configuration error if these are not supplied35 SIGMA_SMTH = psMetadataLookupF32 (&status, recipe, "PEAKS_SMOOTH_SIGMA");36 PS_ASSERT (status, NULL);37 NSIGMA_SMTH = psMetadataLookupF32 (&status, recipe, "PEAKS_SMOOTH_NSIGMA");38 PS_ASSERT (status, NULL);39 guess = true;36 // if we do not know the FWHM, use the guess smoothing kernel supplied. 37 // it is a configuration error if these are not supplied 38 SIGMA_SMTH = psMetadataLookupF32 (&status, recipe, "PEAKS_SMOOTH_SIGMA"); 39 PS_ASSERT (status, NULL); 40 NSIGMA_SMTH = psMetadataLookupF32 (&status, recipe, "PEAKS_SMOOTH_NSIGMA"); 41 PS_ASSERT (status, NULL); 42 guess = true; 40 43 } 41 44 // record the actual smoothing sigma
Note:
See TracChangeset
for help on using the changeset viewer.
