IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 4, 2011, 1:04:41 PM (15 years ago)
Author:
eugene
Message:

updates to pmPeak to better distinguish peak flux versions; updates to visualization; add bits for substantial suspect masking; consolidate assignment of source position and flux based on peak, moments, etc; improve footprint culling process; fix PSF_QF and PSF_QF_PERFECT calculations; fix source model chisq values

Location:
trunk/psModules
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules

    • Property svn:ignore
      •  

        old new  
        2828ChangeLog
        2929psmodules-*.tar.*
         30a.out.dSYM
  • trunk/psModules/src/objects/models/pmModel_SERSIC.c

    r29028 r31153  
    222222{
    223223    pmMoments *moments = source->moments;
    224     pmPeak    *peak    = source->peak;
    225224    psF32     *PAR  = model->params->data.F32;
     225
     226    // sky is set to 0.0
     227    PAR[PM_PAR_SKY]  = 0.0;
    226228
    227229    // the other parameters depend on the guess for PAR_7
     
    236238    float Zero  = 1.16 - 0.615 * PAR[PM_PAR_7];
    237239
     240    // Sersic shape is a bit special
    238241    psEllipseMoments emoments;
    239242    emoments.x2 = moments->Mxx;
     
    273276    float Syy = PS_MAX(0.5, shape.sy);
    274277
    275     PAR[PM_PAR_SKY]  = 0.0;
    276     PAR[PM_PAR_I0]   = peak->flux / Io;
    277     PAR[PM_PAR_XPOS] = peak->xf;
    278     PAR[PM_PAR_YPOS] = peak->yf;
    279278    PAR[PM_PAR_SXX]  = Sxx;
    280279    PAR[PM_PAR_SYY]  = Syy;
    281280    PAR[PM_PAR_SXY]  = shape.sxy;
     281
     282    // set the model normalization (adjust for Sersic best guess)
     283    if (!pmModelSetNorm(&PAR[PM_PAR_I0], source)) {
     284      return false;
     285    }
     286    PAR[PM_PAR_I0] /= Io;
     287
     288    // set the model position
     289    if (!pmModelSetPosition(&PAR[PM_PAR_XPOS], &PAR[PM_PAR_YPOS], source)) {
     290      return false;
     291    }
    282292
    283293    return(true);
     
    346356    psF64 radius = axes.major * sqrt (2.0) * pow(zn, 0.5 / PAR[PM_PAR_7]);
    347357
    348     // fprintf (stderr, "sersic model %f %f, n %f, radius: %f, zn: %f, f/Io: %f, major: %f\n", PAR[PM_PAR_XPOS], PAR[PM_PAR_YPOS], PAR[PM_PAR_7], radius, zn, flux/PAR[PM_PAR_I0], axes.major);
    349 
    350     psAssert (isfinite(radius), "fix this code: z should not be nan for %f", PAR[PM_PAR_7]);
     358    psAssert (isfinite(radius), "fix this code: radius should not be nan for Io = %f, flux = %f, major = %f (%f, %f, %f), par 7 = %f",
     359              PAR[PM_PAR_I0], flux, axes.major, PAR[PM_PAR_SXX], PAR[PM_PAR_SXY], PAR[PM_PAR_SYY], PAR[PM_PAR_7]);
    351360    return (radius);
    352361}
Note: See TracChangeset for help on using the changeset viewer.