Changeset 36079 for trunk/ppSim/src/ppSimMakeGalaxies.c
- Timestamp:
- Aug 31, 2013, 5:20:18 AM (13 years ago)
- File:
-
- 1 edited
-
trunk/ppSim/src/ppSimMakeGalaxies.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppSim/src/ppSimMakeGalaxies.c
r34261 r36079 219 219 } 220 220 221 // exponential 222 // f = I0 exp (sqrt(z)) (index = 1.0) 223 224 // f = I0 exp (-0.5*z) 225 221 226 if (isSersicType) { 222 227 // 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); 225 230 226 231 // 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; 230 235 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 231 240 // 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; 233 242 return true; 234 243 }
Note:
See TracChangeset
for help on using the changeset viewer.
