IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 9, 2010, 10:56:32 AM (16 years ago)
Author:
eugene
Message:

changed pmSourceFitModel and related APIs to pass a structure of fit options; this lets us change the options between soruces within the multithreaded context; also re-organized the include orders to avoid conflicts

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20100621/psphot/src/psphotSourceSize.c

    r28013 r28643  
    11# include "psphotInternal.h"
    22# include <gsl/gsl_sf_gamma.h>
     3
     4# define KRON 1
    35
    46typedef struct {
     
    197199        pmSourceSub (source, PM_MODEL_OP_FULL, options->maskVal);
    198200
     201        // XXX test: switch to kron flux
     202# if (KRON)
     203        float apMag = -2.5*log10(source->moments->KronFlux);
     204# else
    199205        float apMag = -2.5*log10(source->moments->Sum);
     206# endif
    200207        float dMag = source->psfMag - apMag;
    201208
     
    343350        pmSourceSub (source, PM_MODEL_OP_FULL, options->maskVal);
    344351
     352# if (KRON)
     353        float apMag = -2.5*log10(source->moments->KronFlux);
     354# else
    345355        float apMag = -2.5*log10(source->moments->Sum);
     356# endif
    346357        float dMag = source->psfMag - apMag;
    347358
    348359        // set nSigma to include both systematic and poisson error terms
    349360        // XXX the 'poisson error' contribution for size is probably wrong...
    350         float nSigmaMAG = (dMag - options->ApResid) / hypot(source->errMag, options->ApSysErr);
     361        // XXX add in a hard floor on the Ap Sys Err (to be a bit generous)
     362        float nSigmaMAG = (dMag - options->ApResid) / hypot(source->errMag, hypot(options->ApSysErr, 0.025));
    351363        float nSigmaMXX = (Mxx - psfClump->X) / hypot(psfClump->dX, psfClump->X*psfClump->X*source->errMag);
    352364        float nSigmaMYY = (Myy - psfClump->Y) / hypot(psfClump->dY, psfClump->Y*psfClump->Y*source->errMag);
     365
     366        fprintf (stderr, "Mxx: %f, Myy: %f, dx: %f, dy: %f, psfMag: %f, apMag: %f, dMag: %f, errMag: %f, nSigmaMag: %f\n",
     367                 Mxx, Myy, source->peak->xf - source->moments->Mx, source->peak->yf - source->moments->My,
     368                 source->psfMag, apMag, dMag, source->errMag, nSigmaMAG);
    353369
    354370        // partially-masked sources are more likely to be mis-measured PSFs
Note: See TracChangeset for help on using the changeset viewer.