Changeset 14759
- Timestamp:
- Sep 5, 2007, 12:09:40 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/psphotRoughClass.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphotRoughClass.c
r14756 r14759 2 2 3 3 // 2006.02.02 : no leaks 4 bool psphotRoughClass (psArray *sources, psMetadata *recipe, const bool findPsfClump, psMaskType maskSat) { 5 6 // XXX rather than using a static psfClump, should we push X,Y, dX,dY into the metadata? 4 bool psphotRoughClass (psArray *sources, psMetadata *recipe, const bool havePSF, psMaskType maskSat) { 7 5 8 6 static pmPSFClump psfClump; 9 static bool havePsfClump = false;10 7 11 8 psTimerStart ("psphot"); 12 9 13 if (findPsfClump) { 10 if (!havePSF) { 11 // determine the PSF parameters from the source moment values 14 12 psfClump = pmSourcePSFClump (sources, recipe); 15 } else if (!havePsfClump) { 16 psError(PSPHOT_ERR_PROG, false, "You must find the PSF clump before reusing it"); 17 } else { 18 ; 13 } else 14 // pull FWHM_X,Y from the recipe, use to define psfClump.X,Y 15 bool status_x, status_y; 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... 19 36 } 20 37 21 havePsfClump = false; // we don't know if it's valid22 38 if (psfClump.X < 0) { 23 39 psError(PSPHOT_ERR_PROG, false, "programming error calling pmSourcePSFClump"); … … 42 58 psLogMsg ("psphot.roughclass", PS_LOG_INFO, "rough classification: %f sec\n", psTimerMark ("psphot")); 43 59 44 havePsfClump = true; // we have set psfClump45 46 60 return true; 47 61 }
Note:
See TracChangeset
for help on using the changeset viewer.
