Changeset 14655 for trunk/psphot/src/psphotChoosePSF.c
- Timestamp:
- Aug 23, 2007, 2:40:16 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/psphotChoosePSF.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphotChoosePSF.c
r13900 r14655 127 127 // print/dump psf parameters 128 128 if (psTraceGetLevel("psphot") >= 5) { 129 for (int i = PM_PAR_SXX; i < try->psf->params _NEW->n; i++) {130 psPolynomial2D *poly = try->psf->params _NEW->data[i];129 for (int i = PM_PAR_SXX; i < try->psf->params->n; i++) { 130 psPolynomial2D *poly = try->psf->params->data[i]; 131 131 for (int nx = 0; nx <= poly->nX; nx++) { 132 132 for (int ny = 0; ny <= poly->nY; ny++) { … … 295 295 } 296 296 297 char *modelName = pmModel GetType (psf->type);297 char *modelName = pmModelClassGetName (psf->type); 298 298 psLogMsg ("psphot.pspsf", PS_LOG_INFO, "select psf model: %f sec\n", psTimerMark ("psphot")); 299 299 psLogMsg ("psphot.pspsf", PS_LOG_INFO, "psf model %s, ApResid: %f +/- %f\n", modelName, psf->ApResid, psf->dApResid); … … 315 315 PS_ASSERT_PTR_NON_NULL(image, false); 316 316 317 pmModel *modelEXT = pmModelAlloc (psf->type); 318 PS_ASSERT_PTR_NON_NULL(modelEXT, false); 319 320 // make a model with unit central intensity at the image center 321 modelEXT->params->data.F32[PM_PAR_SKY] = 0; 322 modelEXT->params->data.F32[PM_PAR_I0] = 1; 323 modelEXT->params->data.F32[PM_PAR_XPOS] = 0.5*image->numCols; 324 modelEXT->params->data.F32[PM_PAR_YPOS] = 0.5*image->numRows; 325 326 // construct a PSF model at this coordinate 327 pmModel *modelPSF = pmModelFromPSF (modelEXT, psf); 317 // construct a normalized PSF model at this coordinate (Io = 1.0) 318 pmModel *modelPSF = pmModelFromPSFforXY (psf, 0.5*image->numCols, 0.5*image->numRows, 1.0); 328 319 if (modelPSF == NULL) { 329 320 psError(PSPHOT_ERR_PSF, false, "Failed to estimate PSF model at image centre"); 330 psFree(modelEXT);331 321 return false; 332 322 } 333 323 334 // get the correct model-radius function335 pmModelRadius modelRadiusFunc = pmModelRadius_GetFunction (psf->type);336 337 324 // get the model full-width at half-max 338 psF64 FWHM_X = 2*model RadiusFunc(modelPSF->params, 0.5);325 psF64 FWHM_X = 2*modelPSF->modelRadius (modelPSF->params, 0.5); 339 326 340 327 // XXX make sure this is consistent with the re-definition of PM_PAR_SXX … … 351 338 psMetadataAddS32 (recipe, PS_LIST_TAIL, "NPSFSTAR", PS_META_REPLACE, "Number of stars used to make PSF", psf->nPSFstars); 352 339 psMetadataAddBool(recipe, PS_LIST_TAIL, "PSFMODEL", PS_META_REPLACE, "Valid PSF Model?", true); 353 354 psFree (modelEXT);355 340 psFree (modelPSF); 356 341
Note:
See TracChangeset
for help on using the changeset viewer.
