Changeset 9317
- Timestamp:
- Oct 5, 2006, 1:42:11 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/psphotChoosePSF.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphotChoosePSF.c
r9270 r9317 76 76 // select the best of the models 77 77 // here we are using the clippedStdev on the metric as the indicator 78 try = models->data[0]; 79 int bestN = 0; 80 float bestM = try->psf->dApResid; 81 for (int i = 1; i < models->n; i++) { 78 int bestN = -1; 79 float bestM = 0.0; 80 for (int i = 0; i < models->n; i++) { 82 81 try = models->data[i]; 82 if (try == NULL) { 83 psError(PSPHOT_ERR_PSF, false, "PSF model %d is NULL", i); 84 continue; 85 } 83 86 float M = try->psf->dApResid; 84 if ( M < bestM) {87 if (bestN < 0 || M < bestM) { 85 88 bestM = M; 86 89 bestN = i; … … 89 92 90 93 // use the best model: 94 if (bestN < 0) { 95 psError(PSPHOT_ERR_PSF, false, "Failed to fit any models when choosing PSF"); 96 psFree (models); 97 return NULL; 98 } 99 91 100 try = models->data[bestN]; 92 101
Note:
See TracChangeset
for help on using the changeset viewer.
