Changeset 14655 for trunk/psphot/src/psphotPSFResiduals.c
- Timestamp:
- Aug 23, 2007, 2:40:16 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/psphotPSFResiduals.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphotPSFResiduals.c
r12792 r14655 12 12 if (!(source->mode & PM_SOURCE_MODE_PSFSTAR)) continue; 13 13 14 // XXX if a source is faint, it will not have moments measured. 15 // it must be modelled as a PSF. In this case, we need to use 16 // the peak centroid to get the coordinates and get the peak flux 17 // from the image? 18 19 // use the source moments, etc to guess basic model parameters 20 pmModel *modelEXT = pmSourceModelGuess (source, psf->type); 21 22 // XXX put this in a function of its own.. 23 if (modelEXT == NULL) { 24 psErrorClear (); // XXX need to clear the error from failing the model 25 modelEXT = pmModelAlloc(psf->type); 26 psF32 *PAR = modelEXT->params->data.F32; 27 PAR[PM_PAR_SKY] = 0; 28 // XXX get this from the image pixels 29 PAR[PM_PAR_I0] = source->peak->flux; 30 PAR[PM_PAR_XPOS] = source->peak->xf; 31 PAR[PM_PAR_YPOS] = source->peak->yf; 14 if (source->mode & PM_SOURCE_MODE_SATSTAR) { 15 Xo = source->moments->x; 16 Yo = source->moments->y; 17 Io = source->peak->flux; 32 18 } else { 33 // these valuse are set in pmSourceModelGuess, should this rule be in there as well? 34 if (source->mode & PM_SOURCE_MODE_SATSTAR) { 35 modelEXT->params->data.F32[PM_PAR_XPOS] = source->moments->x; 36 modelEXT->params->data.F32[PM_PAR_YPOS] = source->moments->y; 37 } else { 38 modelEXT->params->data.F32[PM_PAR_XPOS] = source->peak->xf; 39 modelEXT->params->data.F32[PM_PAR_YPOS] = source->peak->yf; 40 } 19 Xo = source->peak->xf; 20 Yo = source->peak->yf; 21 Io = source->peak->flux; 41 22 } 42 23 43 24 // set PSF parameters for this model (apply 2D shape model) 44 pmModel *modelPSF = pmModelFromPSF (modelEXT, psf); 45 psFree (modelEXT); 25 pmModel *modelPSF = pmModelFromPSFforXY (psf, Xo, Yo, Io); 46 26 47 27 // XXX need to define the guess flux?
Note:
See TracChangeset
for help on using the changeset viewer.
