Changeset 20000
- Timestamp:
- Oct 8, 2008, 11:53:29 AM (18 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/objects/pmPSF.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/objects/pmPSF.c
r18554 r20000 6 6 * @author EAM, IfA 7 7 * 8 * @version $Revision: 1.3 6$ $Name: not supported by cvs2svn $9 * @date $Date: 2008- 07-15 20:25:00$8 * @version $Revision: 1.37 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2008-10-08 21:53:29 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 271 271 pol.e2 = fittedPar[PM_PAR_E2]; 272 272 273 psEllipseAxes axes; 274 if (psEllipsePolToAxes (pol, minMinorAxis, &axes) != PS_ERR_NONE) { 275 psError(PM_ERR_PSF, false, "Failed to convert e[012] (%g,%g,%g) to axes", 276 pol.e0, pol.e1, pol.e2); 273 psEllipseAxes axes = psEllipsePolToAxes (pol, minMinorAxis); 274 if (!isfinite(axes.major) || !isfinite(axes.minor) || !isfinite(axes.theta)) { 275 psTrace("psModules.objects", 5, "Failed to convert e[012] (%g,%g,%g) to axes", pol.e0, pol.e1, pol.e2); 277 276 return false; 278 277 } … … 420 419 maskVal |= markVal; 421 420 422 // use the center of the center pixel of the image 423 xc = 0.5*readout->image->numCols + readout->image->col0 + 0.5; 424 yc = 0.5*readout->image->numRows + readout->image->row0 + 0.5; 425 dx = psf->growth->maxRadius + 1; 426 dy = psf->growth->maxRadius + 1; 427 428 // assign the x and y coords to the image center 429 // create an object with center intensity of 1000 430 modelRef->params->data.F32[PM_PAR_SKY] = 0; 431 modelRef->params->data.F32[PM_PAR_I0] = 1000; 432 modelRef->params->data.F32[PM_PAR_XPOS] = xc; 433 modelRef->params->data.F32[PM_PAR_YPOS] = yc; 434 435 // create modelPSF from this model 436 pmModel *model = pmModelFromPSF (modelRef, psf); 437 421 // XXXX A Serious hack: the psf might not be determined in the field center. 422 // for the moment, just try a few locations until it is defined! 423 424 pmModel *model = NULL; 425 for (int ix = -1; ix <= +1; ix ++) { 426 for (int iy = -1; iy <= +1; iy ++) { 427 428 // use the center of the center pixel of the image 429 xc = (0.5 + 0.3*ix)*readout->image->numCols + readout->image->col0 + 0.5; 430 yc = (0.5 + 0.3*ix)*readout->image->numRows + readout->image->row0 + 0.5; 431 dx = psf->growth->maxRadius + 1; 432 dy = psf->growth->maxRadius + 1; 433 434 // assign the x and y coords to the image center 435 // create an object with center intensity of 1000 436 modelRef->params->data.F32[PM_PAR_SKY] = 0; 437 modelRef->params->data.F32[PM_PAR_I0] = 1000; 438 modelRef->params->data.F32[PM_PAR_XPOS] = xc; 439 modelRef->params->data.F32[PM_PAR_YPOS] = yc; 440 441 // create modelPSF from this model 442 model = pmModelFromPSF (modelRef, psf); 443 if (model) goto got_model; 444 } 445 } 446 psAssert (model, "cannot build growth curve (psf model is invalid everywhere)"); 447 448 got_model: 438 449 // measure the fitMag for this model 439 450 pmSourcePhotometryModel (&fitMag, model);
Note:
See TracChangeset
for help on using the changeset viewer.
