Changeset 18439
- Timestamp:
- Jul 9, 2008, 10:08:59 AM (18 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/psphotPSFResiduals.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphotPSFResiduals.c
r14655 r18439 4 4 bool psphotResidPSF (pmReadout *readout, psArray *sources, psMetadata *recipe, pmPSF *psf) { 5 5 6 psTimerStart ("psphot");6 psTimerStart ("psphot"); 7 7 8 for (int i = 0; i < sources->n; i++) { 9 pmSource *source = sources->data[i]; 8 // bit-mask to mark pixels not used in analysis 9 psMaskType markVal = psMetadataLookupU8(&status, recipe, "MARK.PSPHOT"); 10 assert (markVal); 10 11 11 // only use the psf stars to build the residual model12 if (!(source->mode & PM_SOURCE_MODE_PSFSTAR)) continue;12 for (int i = 0; i < sources->n; i++) { 13 pmSource *source = sources->data[i]; 13 14 14 if (source->mode & PM_SOURCE_MODE_SATSTAR) { 15 Xo = source->moments->x; 16 Yo = source->moments->y; 17 Io = source->peak->flux; 18 } else { 19 Xo = source->peak->xf; 20 Yo = source->peak->yf; 21 Io = source->peak->flux; 15 // only use the psf stars to build the residual model 16 if (!(source->mode & PM_SOURCE_MODE_PSFSTAR)) continue; 17 18 if (source->mode & PM_SOURCE_MODE_SATSTAR) { 19 Xo = source->moments->x; 20 Yo = source->moments->y; 21 Io = source->peak->flux; 22 } else { 23 Xo = source->peak->xf; 24 Yo = source->peak->yf; 25 Io = source->peak->flux; 26 } 27 28 // set PSF parameters for this model (apply 2D shape model) 29 pmModel *modelPSF = pmModelFromPSFforXY (psf, Xo, Yo, Io); 30 31 // XXX need to define the guess flux? 32 // set the fit radius based on the object flux limit and the model 33 psphotCheckRadiusPSF (readout, source, modelPSF, markVal); 34 35 // set the source PSF model 36 source->modelPSF = modelPSF; 22 37 } 23 24 // set PSF parameters for this model (apply 2D shape model) 25 pmModel *modelPSF = pmModelFromPSFforXY (psf, Xo, Yo, Io); 26 27 // XXX need to define the guess flux? 28 // set the fit radius based on the object flux limit and the model 29 psphotCheckRadiusPSF (readout, source, modelPSF); 30 31 // set the source PSF model 32 source->modelPSF = modelPSF; 33 } 34 psLogMsg ("psphot.models", 4, "built models for %ld objects: %f sec\n", sources->n, psTimerMark ("psphot")); 35 return true; 38 psLogMsg ("psphot.models", 4, "built models for %ld objects: %f sec\n", sources->n, psTimerMark ("psphot")); 39 return true; 36 40 } 37 41
Note:
See TracChangeset
for help on using the changeset viewer.
