Changeset 13804 for trunk/psphot/src/psphotChoosePSF.c
- Timestamp:
- Jun 13, 2007, 2:00:08 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/psphotChoosePSF.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphotChoosePSF.c
r13516 r13804 5 5 6 6 bool status; 7 char *modelName;8 pmPSF *psf = NULL;9 pmPSFtry *try = NULL;10 psArray *stars = NULL;11 7 12 8 psTimerStart ("psphot"); … … 51 47 } 52 48 53 stars = psArrayAllocEmpty (sources->n);49 psArray *stars = psArrayAllocEmpty (sources->n); 54 50 55 51 // select the candidate PSF stars (pointers to original sources) … … 92 88 for (int i = 0; i < models->n; i++) { 93 89 psMetadataItem *item = psListGetAndIncrement (iter); 94 modelName = item->data.V;90 char *modelName = item->data.V; 95 91 models->data[i] = pmPSFtryModel (stars, modelName, RADIUS, POISSON_ERRORS, psfTrendMask, PSF_PARAM_WEIGHTS); 96 92 } … … 106 102 float bestM = 0.0; 107 103 for (int i = 0; i < models->n; i++) { 108 try = models->data[i];104 pmPSFtry *try = models->data[i]; 109 105 if (try == NULL) { 110 106 psError(PSPHOT_ERR_PSF, false, "PSF model %d is NULL", i); … … 125 121 } 126 122 127 try = models->data[bestN]; 123 pmPSFtry *try = models->data[bestN]; 124 125 // print/dump psf parameters 126 if (psTraceGetLevel("psphot") >= 5) { 127 for (int i = PM_PAR_SXX; i < try->psf->params_NEW->n; i++) { 128 psPolynomial2D *poly = try->psf->params_NEW->data[i]; 129 for (int nx = 0; nx <= poly->nX; nx++) { 130 for (int ny = 0; ny <= poly->nY; ny++) { 131 if (poly->mask[nx][ny]) continue; 132 fprintf (stderr, "%g x^%d y^%d\n", poly->coeff[nx][ny], nx, ny); 133 } 134 } 135 } 136 } 128 137 129 138 // measure and save the median value of dparams[PM_PAR_SXX],dparams[PM_PAR_SYY] … … 275 284 // XXX we are not saving the fitted sources 276 285 // XXX do we want to keep them so we may optionally write them out? 277 p sf = psMemIncrRefCounter(try->psf);286 pmPSF *psf = psMemIncrRefCounter(try->psf); 278 287 psFree (models); 279 288 … … 284 293 } 285 294 286 modelName = pmModelGetType (psf->type);295 char *modelName = pmModelGetType (psf->type); 287 296 psLogMsg ("psphot.pspsf", PS_LOG_INFO, "select psf model: %f sec\n", psTimerMark ("psphot")); 288 297 psLogMsg ("psphot.pspsf", PS_LOG_INFO, "psf model %s, ApResid: %f +/- %f\n", modelName, psf->ApResid, psf->dApResid);
Note:
See TracChangeset
for help on using the changeset viewer.
