- Timestamp:
- Aug 26, 2010, 9:18:39 AM (16 years ago)
- Location:
- branches/sc_branches/trunkTest
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/sc_branches/trunkTest
- Property svn:mergeinfo changed
-
branches/sc_branches/trunkTest/psphot
- Property svn:mergeinfo deleted
-
branches/sc_branches/trunkTest/psphot/src/psphotSourceSize.c
r28013 r29060 1 1 # include "psphotInternal.h" 2 2 # include <gsl/gsl_sf_gamma.h> 3 4 # define KRON 1 3 5 4 6 typedef struct { … … 168 170 psVector *ApErr = psVectorAllocEmpty (100, PS_TYPE_F32); 169 171 172 psImageMaskType markVal = options->markVal; 170 173 psImageMaskType maskVal = options->maskVal | options->markVal; 171 174 … … 189 192 190 193 // XXX can we test if psfMag is set and calculate only if needed? 191 pmSourceMagnitudes (source, psf, photMode, maskVal ); // maskVal includes markVal194 pmSourceMagnitudes (source, psf, photMode, maskVal, markVal); 192 195 193 196 // clear the mask bit … … 197 200 pmSourceSub (source, PM_MODEL_OP_FULL, options->maskVal); 198 201 202 // XXX test: switch to kron flux 203 # if (KRON) 204 float apMag = -2.5*log10(source->moments->KronFlux); 205 # else 199 206 float apMag = -2.5*log10(source->moments->Sum); 207 # endif 200 208 float dMag = source->psfMag - apMag; 201 209 … … 288 296 pmSourcePhotometryMode photMode = PM_SOURCE_PHOT_WEIGHT; 289 297 298 psImageMaskType markVal = options->markVal; 290 299 psImageMaskType maskVal = options->maskVal | options->markVal; 291 300 … … 335 344 336 345 // XXX can we test if psfMag is set and calculate only if needed? 337 pmSourceMagnitudes (source, psf, photMode, maskVal ); // maskVal includes markVal346 pmSourceMagnitudes (source, psf, photMode, maskVal, markVal); 338 347 339 348 // clear the mask bit … … 343 352 pmSourceSub (source, PM_MODEL_OP_FULL, options->maskVal); 344 353 354 # if (KRON) 355 float apMag = -2.5*log10(source->moments->KronFlux); 356 # else 345 357 float apMag = -2.5*log10(source->moments->Sum); 358 # endif 346 359 float dMag = source->psfMag - apMag; 347 360 348 361 // set nSigma to include both systematic and poisson error terms 349 362 // XXX the 'poisson error' contribution for size is probably wrong... 350 float nSigmaMAG = (dMag - options->ApResid) / hypot(source->errMag, options->ApSysErr); 363 // XXX add in a hard floor on the Ap Sys Err (to be a bit generous) 364 float nSigmaMAG = (dMag - options->ApResid) / hypot(source->errMag, hypot(options->ApSysErr, 0.025)); 351 365 float nSigmaMXX = (Mxx - psfClump->X) / hypot(psfClump->dX, psfClump->X*psfClump->X*source->errMag); 352 366 float nSigmaMYY = (Myy - psfClump->Y) / hypot(psfClump->dY, psfClump->Y*psfClump->Y*source->errMag); 353 367 354 // partially-masked sources are more likely to be mis-measured PSFs 368 // fprintf (stderr, "%f %f : Mxx: %f, Myy: %f, dx: %f, dy: %f, psfMag: %f, apMag: %f, dMag: %f, errMag: %f, nSigmaMag: %f, nSigmaMxx: %f, nSigmaMyy: %f\n", 369 // source->peak->xf, source->peak->yf, Mxx, Myy, source->peak->xf - source->moments->Mx, source->peak->yf - source->moments->My, 370 // source->psfMag, apMag, dMag, source->errMag, nSigmaMAG, nSigmaMXX, nSigmaMYY); 371 372 // XXX double check on ths stuff!! partially-masked sources are more likely to be mis-measured PSFs 355 373 float sizeBias = 1.0; 356 if (source->pixWeight < 0.9) { 374 if (source->pixWeightNotBad < 0.9) { 375 sizeBias = 3.0; 376 } 377 if (source->pixWeightNotPoor < 0.9) { 357 378 sizeBias = 3.0; 358 379 } … … 389 410 if (isCR) { 390 411 psTrace("psphotSourceClassRegion.CR",4,"CLASS: %g %g %f\t%g %g %g %g %g %g\t%g %g\t%g CR\t%g %g\n", 391 source->peak->xf,source->peak->yf,source->pixWeight ,Mxx,Myy,psfClump->X,psfClump->Y,psfClump->dX,psfClump->dY,apMag,dMag,nSigmaMAG,412 source->peak->xf,source->peak->yf,source->pixWeightNotBad,Mxx,Myy,psfClump->X,psfClump->Y,psfClump->dX,psfClump->dY,apMag,dMag,nSigmaMAG, 392 413 options->nSigmaApResid,sizeBias*options->nSigmaMoments); 393 414 source->mode |= PM_SOURCE_MODE_DEFECT;
Note:
See TracChangeset
for help on using the changeset viewer.
