Changeset 14991
- Timestamp:
- Sep 23, 2007, 5:01:55 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branch_20070921/psphot/src/psphotRoughClass.c
r14760 r14991 1 1 # include "psphotInternal.h" 2 # define CHECK_STATUS(S,MSG) { \ 3 if (!status) { \ 4 psError(PSPHOT_ERR_CONFIG, false, "missing PSF Clump entry: %s\n", MSG); \ 5 return false; \ 6 } } 2 7 3 8 // 2006.02.02 : no leaks 4 9 bool psphotRoughClass (psArray *sources, psMetadata *recipe, const bool havePSF, psMaskType maskSat) { 5 10 6 static pmPSFClump psfClump; 11 bool status; 12 static pmPSFClump psfClump; 7 13 8 14 psTimerStart ("psphot"); … … 11 17 // determine the PSF parameters from the source moment values 12 18 psfClump = pmSourcePSFClump (sources, recipe); 19 psMetadataAddF32 (recipe, PS_LIST_TAIL, "PSF.CLUMP.X", 0, "psf clump center", psfClump.X); 20 psMetadataAddF32 (recipe, PS_LIST_TAIL, "PSF.CLUMP.Y", 0, "psf clump center", psfClump.Y); 21 psMetadataAddF32 (recipe, PS_LIST_TAIL, "PSF.CLUMP.DX", 0, "psf clump center", psfClump.dX); 22 psMetadataAddF32 (recipe, PS_LIST_TAIL, "PSF.CLUMP.DY", 0, "psf clump center", psfClump.dY); 13 23 } else { 14 24 // pull FWHM_X,Y from the recipe, use to define psfClump.X,Y 15 bool status_x, status_y, status_a; 16 float FWHM_X = psMetadataLookupF32 (&status_x, recipe, "FWHM_X"); 17 float FWHM_Y = psMetadataLookupF32 (&status_y, recipe, "FWHM_Y"); 18 float ANGLE = psMetadataLookupF32 (&status_a, recipe, "ANGLE"); 19 if (!status_x | !status_y | !status_a) { 20 psError(PSPHOT_ERR_CONFIG, false, "FWHM_X, FWHM_Y, or ANGLE not defined"); 21 return false; 22 } 23 24 psEllipseAxes axes; 25 axes.major = FWHM_X / (2.0*sqrt(2.0*log(2.0))); 26 axes.minor = FWHM_Y / (2.0*sqrt(2.0*log(2.0))); 27 axes.theta = ANGLE; 28 psEllipseShape shape = psEllipseAxesToShape (axes); 29 30 psfClump.X = shape.sx; 31 psfClump.Y = shape.sy; 32 psfClump.dX = 0.1*shape.sx; 33 psfClump.dY = 0.1*shape.sy; 34 // dX,dY are somewhat crudely defined, but only used to select PSF candidates. 35 // if we already have a PSF, this is not actually used... 25 psfClump.X = psMetadataLookupF32 (&status, recipe, "PSF.CLUMP.X"); CHECK_STATUS (status, "PSF.CLUMP.X"); 26 psfClump.Y = psMetadataLookupF32 (&status, recipe, "PSF.CLUMP.Y"); CHECK_STATUS (status, "PSF.CLUMP.Y"); 27 psfClump.dX = psMetadataLookupF32 (&status, recipe, "PSF.CLUMP.DX"); CHECK_STATUS (status, "PSF.CLUMP.DX"); 28 psfClump.dY = psMetadataLookupF32 (&status, recipe, "PSF.CLUMP.DY"); CHECK_STATUS (status, "PSF.CLUMP.DY"); 36 29 } 37 30
Note:
See TracChangeset
for help on using the changeset viewer.
