Changeset 4901 for trunk/psphot/src/choose_psf_model.c
- Timestamp:
- Aug 29, 2005, 5:44:55 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/choose_psf_model.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/choose_psf_model.c
r4642 r4901 7 7 bool status; 8 8 char *modelName; 9 char key[64] , filename[64];9 char key[64]; 10 10 pmPSF_Test *test = NULL; 11 11 psArray *stars = NULL; … … 31 31 psArray *tests = psArrayAlloc (Ntest); 32 32 for (int i = 0; i < tests->n; i++) { 33 s printf (key, "PSF_MODEL_%d", i);33 snprintf (key, 64, "PSF_MODEL_%d", i); 34 34 modelName = psMetadataLookupPtr (&status, config, key); 35 35 36 tests->data[i] = pmPSF_TestModel (stars, modelName, RADIUS); 36 37 psFree (modelName); … … 55 56 } 56 57 } 58 // keep only the selected test: 57 59 test = tests->data[bestN]; 58 60 modelName = psModelGetType (test->modelType); 59 61 psLogMsg ("psphot.pspsf", 3, "selected psf model %s, ApResid: %f +/- %f\n", modelName, test->ApResid, test->dApResid); 60 psFree (modelName);61 62 63 // XXX I am having trouble tracking down the double frees vs leaks 64 # if (0) 62 65 // we are keeping the modelPSF fits from the PSF test, 63 66 // but we replace these later on (apply_psf_model) … … 70 73 source->modelPSF = NULL; 71 74 } else { 75 // source->modelPSF = psMemCopy(test->modelPSF->data[i]); 72 76 source->modelPSF = test->modelPSF->data[i]; 73 77 } 74 78 } 75 pmPSF *psf = test->psf;79 # endif 76 80 77 // free unused test models: 78 psFree (test); 79 psFree (stars); 80 81 pmPSF *psf = psMemCopy(test->psf); 82 psFree (tests); 81 83 return (psf); 82 84 }
Note:
See TracChangeset
for help on using the changeset viewer.
