IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 21, 2011, 10:27:18 AM (15 years ago)
Author:
eugene
Message:

0.5 pixel error in pmPCM fitting; update sersic-like models to use a more-accurate central pixel flux value; update sersic-like models to have consistent Sxx / axes.major relationship (axes.major is effective radius, not sigma); fix flux integration (sersic-like models have an analytical form, other models were not correctly integrating f(r) rdr)

Location:
branches/eam_branches/ipp-20110710/psModules/src/objects
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20110710/psModules/src/objects

    • Property svn:ignore
      •  

        old new  
        55*.la
        66*.lo
         7pmSourceIO_CMF_PS1_V1.c
         8pmSourceIO_CMF_PS1_V2.c
         9pmSourceIO_CMF_PS1_V3.c
  • branches/eam_branches/ipp-20110710/psModules/src/objects/models/pmModel_QGAUSS.c

    r31670 r32153  
    240240}
    241241
     242// integrate the model to get the full flux
    242243psF64 PM_MODEL_FLUX (const psVector *params)
    243244{
     
    251252    shape.sxy = PAR[PM_PAR_SXY];
    252253
    253     // Area is equivalent to 2 pi sigma^2
    254254    psEllipseAxes axes = psEllipseShapeToAxes (shape, 20.0);
    255     psF64 Area = 2.0 * M_PI * axes.major * axes.minor;
    256 
    257     // the area needs to be multiplied by the integral of f(z)
     255    float AspectRatio = axes.minor / axes.major;
     256
     257    // flux = 2 \pi \int f(r) r dr
    258258    norm = 0.0;
    259259
    260     # define DZ 0.25
    261 
    262     float f0 = 1.0;
     260    # define DR 0.25
     261
     262    // f = f(r) * r
     263    float f0 = 0.0;
    263264    float f1, f2;
    264     for (z = DZ; z < 150; z += DZ) {
    265         f1 = 1.0 / (1 + PAR[PM_PAR_7]*z + pow(z, ALPHA));
    266         z += DZ;
    267         f2 = 1.0 / (1 + PAR[PM_PAR_7]*z + pow(z, ALPHA));
     265    for (float r = DR; r < 150; r += DR) {
     266        z = 0.5 * PS_SQR(r / axes.major);
     267        f1 = r / (1 + PAR[PM_PAR_7]*z + pow(z, ALPHA));
     268        r += DR;
     269        z = 0.5 * PS_SQR(r / axes.major);
     270        f2 = r / (1 + PAR[PM_PAR_7]*z + pow(z, ALPHA));
    268271        norm += f0 + 4*f1 + f2;
    269272        f0 = f2;
    270273    }
    271     norm *= DZ / 3.0;
    272 
    273     psF64 Flux = PAR[PM_PAR_I0] * Area * norm;
     274    norm *= DR / 3.0;
     275
     276    psF64 Flux = PAR[PM_PAR_I0] * norm * 2.0 * M_PI * AspectRatio;
    274277
    275278    return(Flux);
Note: See TracChangeset for help on using the changeset viewer.