Changeset 4375 for trunk/psphot/src/choose_psf_model.c
- Timestamp:
- Jun 24, 2005, 5:38:37 AM (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
r4251 r4375 3 3 // test PSF models and select best option 4 4 5 pmPSF *choose_psf_model (psMetadata *config, psArray *sources )5 pmPSF *choose_psf_model (psMetadata *config, psArray *sources, psStats *skystats) 6 6 { 7 7 bool status; … … 34 34 modelName = psMetadataLookupPtr (&status, config, key); 35 35 tests->data[i] = pmPSF_TestModel (stars, modelName, RADIUS); 36 37 // dump psf test data to file: 38 { 39 sprintf (key, "metric.%d.dat", i); 40 FILE *f = fopen (key, "w"); 41 test = tests->data[i]; 42 43 44 for (int j = 0; j < test->sources->n; j++) { 45 psSource *source = test->sources->data[j]; 46 psModel *model = test->modelPSF->data[j]; 47 float sky = 0; 48 49 if (model != NULL) sky = model->params->data.F32[0]; 50 51 fprintf (f, "%3d %6.1f %6.1f %7.4f %7.4f %8.4f\n", 52 j, source->moments->x, source->moments->y, 53 test->metric->data.F64[j], test->fitMag->data.F64[j], sky); 54 } 55 fclose (f); 56 } 36 57 } 37 58 … … 40 61 test = tests->data[0]; 41 62 int bestN = 0; 42 float bestM = test-> metricStats->clippedStdev;63 float bestM = test->dApResid; 43 64 for (int i = 1; i < Ntest; i++) { 44 65 test = tests->data[i]; 45 int M = test-> metricStats->clippedStdev;66 int M = test->dApResid; 46 67 if (M < bestM) { 47 68 bestM = M; … … 51 72 test = tests->data[bestN]; 52 73 modelName = psModelGetType (test->modelType); 53 psLogMsg ("psphot.pspsf", 3, "selected psf model %s, metric: %f +/- %f\n", modelName, test->metricStats->clippedMean, test->metricStats->clippedStdev);74 psLogMsg ("psphot.pspsf", 3, "selected psf model %s, ApResid: %f +/- %f\n", modelName, test->ApResid, test->dApResid); 54 75 55 76 // set source->model based on best psf model fit
Note:
See TracChangeset
for help on using the changeset viewer.
