Changeset 5058 for trunk/psphot/src/psphotChoosePSF.c
- Timestamp:
- Sep 15, 2005, 12:12:26 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/psphotChoosePSF.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphotChoosePSF.c
r5048 r5058 12 12 13 13 // array to store candidate PSF stars 14 int NSTARS = psMetadataLookupS32 (&status, config, "PSF_MAX_NSTARS"); 15 if (!status) NSTARS = sources->n; 14 16 stars = psArrayAlloc (sources->n); 15 17 stars->n = 0; 16 18 17 19 // select the candidate PSF stars (pointers to original sources) 18 for (int i = 0; i < sources->n; i++) {20 for (int i = 0; (i < sources->n) && (stars->n < NSTARS); i++) { 19 21 pmSource *source = sources->data[i]; 20 22 if (source->type != PM_SOURCE_PSFSTAR) continue; … … 55 57 try = models->data[0]; 56 58 int bestN = 0; 57 float bestM = try-> dApResid;59 float bestM = try->psf->dApResid; 58 60 for (int i = 1; i < models->n; i++) { 59 61 try = models->data[i]; 60 float M = try-> dApResid;62 float M = try->psf->dApResid; 61 63 if (M < bestM) { 62 64 bestM = M; … … 67 69 // keep only the selected model: 68 70 try = models->data[bestN]; 69 modelName = pmModelGetType (try->modelType);70 ps LogMsg ("psphot.pspsf", 3, "selected psf model %s, ApResid: %f +/- %f\n", modelName, try->ApResid, try->dApResid);71 pmPSF *psf = psMemCopy(try->psf); 72 psFree (models); // keep only the pmPSF resulting from this analysis 71 73 72 // keep only the pmPSF resulting from this analysis73 p mPSF *psf = psMemCopy(try->psf);74 psFree (models); 74 modelName = pmModelGetType (psf->type); 75 psLogMsg ("psphot.pspsf", 3, "selected psf model %s, ApResid: %f +/- %f\n", modelName, psf->ApResid, psf->dApResid); 76 75 77 return (psf); 76 78 }
Note:
See TracChangeset
for help on using the changeset viewer.
