- Timestamp:
- Apr 20, 2011, 10:52:17 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20110404/psModules/src/objects/pmSourcePhotometry.c
r31312 r31327 102 102 bool isPSF; 103 103 float x, y; 104 float rflux;105 104 float SN; 106 105 pmModel *model; … … 246 245 // XXX correct the apFlux? 247 246 } 248 if (mode & PM_SOURCE_PHOT_APCORR) {249 // XXX this should be removed -- we no longer fit for the 'sky bias'250 // XXX is this happening???251 rflux = pow (10.0, 0.4*source->psfMag);252 psAssert (psf->skyBias == 0.0, "sky bias not 0");253 psAssert (psf->skySat == 0.0, "sky sat not 0");254 source->apMag -= PS_SQR(source->apRadius)*rflux * psf->skyBias + psf->skySat / rflux;255 }256 247 } 257 248 if (mode & PM_SOURCE_PHOT_INTERP) { … … 309 300 310 301 bool status; 311 status = pmSourcePhotometryAper(&source->apMagRaw, &source->apFlux, &source->apFluxErr, model, image, variance, mask, maskVal); 302 int nPix = 0; 303 status = pmSourcePhotometryAper(&nPix, &source->apMagRaw, &source->apFlux, &source->apFluxErr, model, image, variance, mask, maskVal); 312 304 if (status) { 313 305 source->mode |= PM_SOURCE_MODE_AP_MAGS; 314 306 } 315 316 307 return status; 317 308 } 318 309 319 310 // return source aperture magnitude 320 bool pmSourcePhotometryAper ( float *apMag, float *apFluxOut, float *apFluxErr, pmModel *model, psImage *image, psImage *variance, psImage *mask, psImageMaskType maskVal)311 bool pmSourcePhotometryAper (int *nPixOut, float *apMag, float *apFluxOut, float *apFluxErr, pmModel *model, psImage *image, psImage *variance, psImage *mask, psImageMaskType maskVal) 321 312 { 322 313 PS_ASSERT_PTR_NON_NULL(apMag, false); … … 331 322 float apFlux = 0; 332 323 float apFluxVar = 0; 324 int nPix = 0; 333 325 334 326 if (DO_SKY) { … … 348 340 apFlux += imData[iy][ix] - sky; 349 341 apFluxVar += varData[iy][ix]; 350 } 351 } 342 nPix ++; 343 } 344 } 345 352 346 if (apFluxOut) *apFluxOut = apFlux; 353 347 if (apFluxErr) *apFluxErr = sqrt(fabs(apFluxVar)); 348 if (nPixOut) *nPixOut = nPix; 354 349 355 350 if (apFlux <= 0) {
Note:
See TracChangeset
for help on using the changeset viewer.
