IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 31, 2013, 5:20:18 AM (13 years ago)
Author:
eugene
Message:

fix the normalization of a sersic-like model

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppSim/src/ppSimMakeGalaxies.c

    r34261 r36079  
    219219    }
    220220
     221    // exponential
     222    // f = I0 exp (sqrt(z)) (index = 1.0)
     223
     224    // f = I0 exp (-0.5*z)
     225
    221226    if (isSersicType) {
    222227        // for a sersic model,
    223         float bn = 1.9992*index - 0.3271;
    224         float Io = exp(bn);
     228        // float bn = 1.9992*index - 0.3271;
     229        // float Io = exp(bn);
    225230                   
    226231        // the integral of a Sersic has an analytical form as follows:
    227         float logGamma = lgamma(2.0*index);
    228         float bnFactor = pow(bn, 2.0*index);
    229         float norm = 2.0 * M_PI * PS_SQR(galaxy->Rmaj) * index * Io * exp(logGamma) / bnFactor;
     232        // float logGamma = lgamma(2.0*index);
     233        // float bnFactor = pow(bn, 2.0*index);
     234        // float norm = 2.0 * M_PI * PS_SQR(galaxy->Rmaj) * index * Io * exp(logGamma) / bnFactor;
    230235                   
     236        // find the flux of a sersic with peak = 1.0:
     237        float norm = pmSersicNorm (index);
     238        float flux = 2.0 * M_PI * galaxy->Rmaj * galaxy->Rmin * norm;
     239
    231240        // XXX probably should limit the allowed thinness of a galaxy
    232         galaxy->peak = galaxy->flux / norm / (galaxy->Rmin / galaxy->Rmaj);
     241        galaxy->peak = galaxy->flux / flux;
    233242        return true;
    234243    }
Note: See TracChangeset for help on using the changeset viewer.