Changeset 5773 for trunk/psphot/src/psphotMagnitudes.c
- Timestamp:
- Dec 13, 2005, 10:03:27 AM (21 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/psphotMagnitudes.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphotMagnitudes.c
r5772 r5773 1 1 # include "psphot.h" 2 2 3 // XXX EAM : this aperture correction business is invalid (& wrong) for galaxies 3 // XXX EAM : the apMag should only be calculated for the brighter sources 4 // XXX EAM : SN limit set by user? 5 // XXX EAM : masked region should be (optionally) elliptical 4 6 pmModel *pmSourceMagnitudes (pmSource *source, pmPSF *psf, float apRadius) { 5 7 6 8 int status; 7 9 float x, y; 8 float sky, rflux, apMag, fitMag; 10 float rflux, apMag, fitMag; 11 pmModel *model; 9 12 10 13 // use the correct model (PSF vs FLT) 11 pmModel *model = pmSourceSelectModel (source); 14 if (psf != NULL) { 15 model = source->modelPSF; 16 } else { 17 model = source->modelFLT; 18 } 12 19 if (model == NULL) return NULL; 13 20 … … 20 27 psImageKeepCircle (source->mask, x, y, apRadius, "OR", PSPHOT_MASK_MARKED); 21 28 22 // save local sky for later23 sky = model->params->data.F32[0];24 25 29 // replace source flux 26 30 pmSourceAddModel (source->pixels, source->mask, model, false, false); 27 31 28 32 // measure object photometry 29 status = pmSourcePhotometry (& fitMag, &apMag, model, source->pixels, source->mask);33 status = pmSourcePhotometry (&source->fitMag, &source->apMag, model, source->pixels, source->mask); 30 34 31 // correct both apMag and fitMag to same system, consistent with infinite flux star in aperture RADIUS 32 rflux = pow (10.0, 0.4*fitMag); 33 source->apMag = apMag - rflux * psf->skyBias * (M_PI * PS_SQR(apRadius)); 34 source->fitMag = fitMag + psf->ApResid; 35 // for PSFs, correct both apMag and fitMag to same system, consistent with infinite flux star in aperture RADIUS 36 if (psf != NULL) { 37 rflux = pow (10.0, 0.4*source->fitMag); 38 source->apMag -= rflux * psf->skyBias * (M_PI * PS_SQR(apRadius)); 39 source->fitMag += psf->ApResid; 40 } 35 41 36 42 // subtract object, leave local sky
Note:
See TracChangeset
for help on using the changeset viewer.
