Changeset 20287
- Timestamp:
- Oct 21, 2008, 9:45:07 AM (18 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/psphotChoosePSF.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphotChoosePSF.c
r20261 r20287 9 9 pmSource *source = sources->data[i]; 10 10 if (source->mode & PM_SOURCE_MODE_PSFSTAR) { 11 nPSF ++;12 }11 nPSF ++; 12 } 13 13 } 14 14 … … 289 289 // XXX test dump of psf star data and psf-subtracted image 290 290 if (psTraceGetLevel("psphot.psfstars") > 5) { 291 psphotDumpPSFStars (readout, try, options->radius, maskVal, markVal);291 psphotDumpPSFStars (readout, try, options->radius, maskVal, markVal); 292 292 } 293 293 … … 333 333 334 334 for (float ix = -0.4; ix <= +0.4; ix += 0.1) { 335 for (float iy = -0.4; iy <= +0.4; iy += 0.1) {336 337 // use the center of the center pixel of the image338 float xc = ix*image->numCols + 0.5*image->numCols + image->col0 + 0.5;339 float yc = iy*image->numRows + 0.5*image->numRows + image->row0 + 0.5;340 341 // create modelPSF from this model342 pmModel *modelPSF = pmModelFromPSFforXY (psf, xc, yc, 1.0);343 if (!modelPSF) continue;344 345 // get the model full-width at half-max346 float FWHM_MAJOR = 2*modelPSF->modelRadius (modelPSF->params, 0.5);347 348 // XXX make sure this is consistent with the re-definition of PM_PAR_SXX349 shape.sx = modelPSF->params->data.F32[PM_PAR_SXX];350 shape.sy = modelPSF->params->data.F32[PM_PAR_SYY];351 shape.sxy = modelPSF->params->data.F32[PM_PAR_SXY];352 axes = psEllipseShapeToAxes (shape, 20.0);353 psFree (modelPSF);354 355 float FWHM_MINOR = FWHM_MAJOR * (axes.minor / axes.major);356 if (!isfinite(FWHM_MAJOR) || !isfinite(FWHM_MINOR)) continue;357 psVectorAppend (fwhmMajor, FWHM_MAJOR);358 psVectorAppend (fwhmMinor, FWHM_MINOR);359 }335 for (float iy = -0.4; iy <= +0.4; iy += 0.1) { 336 337 // use the center of the center pixel of the image 338 float xc = ix*image->numCols + 0.5*image->numCols + image->col0 + 0.5; 339 float yc = iy*image->numRows + 0.5*image->numRows + image->row0 + 0.5; 340 341 // create modelPSF from this model 342 pmModel *modelPSF = pmModelFromPSFforXY (psf, xc, yc, 1.0); 343 if (!modelPSF) continue; 344 345 // get the model full-width at half-max 346 float FWHM_MAJOR = 2*modelPSF->modelRadius (modelPSF->params, 0.5); 347 348 // XXX make sure this is consistent with the re-definition of PM_PAR_SXX 349 shape.sx = modelPSF->params->data.F32[PM_PAR_SXX]; 350 shape.sy = modelPSF->params->data.F32[PM_PAR_SYY]; 351 shape.sxy = modelPSF->params->data.F32[PM_PAR_SXY]; 352 axes = psEllipseShapeToAxes (shape, 20.0); 353 psFree (modelPSF); 354 355 float FWHM_MINOR = FWHM_MAJOR * (axes.minor / axes.major); 356 if (!isfinite(FWHM_MAJOR) || !isfinite(FWHM_MINOR)) continue; 357 psVectorAppend (fwhmMajor, FWHM_MAJOR); 358 psVectorAppend (fwhmMinor, FWHM_MINOR); 359 } 360 360 } 361 361 … … 405 405 if (!source) continue; 406 406 if (!(source->mode & PM_SOURCE_MODE_PSFSTAR)) continue; 407 if (!source->moments) { 408 continue; 409 } 407 410 408 411 moments.x2 = source->moments->Mxx;
Note:
See TracChangeset
for help on using the changeset viewer.
