IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 36026


Ignore:
Timestamp:
Aug 25, 2013, 12:12:23 PM (13 years ago)
Author:
eugene
Message:

mv pmSersicNorm to psModules

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20130711/ppSim/src/ppSimMakeGalaxies.c

    r35970 r36026  
    202202    }
    203203    return true;
    204 }
    205 
    206 float pmSersicNorm (float index) {
    207 
    208     float C0 = NAN;
    209     float C1 = NAN;
    210     float C2 = NAN;
    211 
    212     // y = 0.201545 x^0 -0.950965 x^1 -0.315248 x^2
    213     // y = 0.402084 x^0 -1.357775 x^1 -0.105102 x^2
    214     // y = 0.619093 x^0 -1.591674 x^1 -0.041576 x^2
    215     // y = 0.770263 x^0 -1.696421 x^1 -0.023363 x^2
    216     // y = 0.885891 x^0 -1.755684 x^1 -0.015753 x^2
    217 
    218     if ((index >= 0.0) && (index < 1.0)) {
    219         C0 = 0.201545; C1 = -0.950965; C2 = -0.315248;
    220         // y = 0.201545 x^0 -0.950965 x^1 -0.315248 x^2
    221     }
    222     if ((index >= 1.0) && (index < 2.0)) {
    223         C0 = 0.402084; C1 = -1.357775; C2 = -0.105102;
    224         // y = 0.402084 x^0 -1.357775 x^1 -0.105102 x^2
    225     }
    226     if ((index >= 2.0) && (index < 3.0)) {
    227         C0 = 0.619093; C1 = -1.591674; C2 = -0.041576;
    228         // y = 0.619093 x^0 -1.591674 x^1 -0.041576 x^2
    229     }
    230     if ((index >= 3.0) && (index < 4.0)) {
    231         C0 = 0.770263; C1 = -1.696421; C2 = -0.023363;
    232         // y = 0.770263 x^0 -1.696421 x^1 -0.023363 x^2
    233     }
    234     if ((index >= 4.0) && (index < 5.5)) {
    235         C0 = 0.885891; C1 = -1.755684; C2 = -0.015753;
    236         // y = 0.885891 x^0 -1.755684 x^1 -0.015753 x^2
    237     }
    238 
    239     if (isnan(C0)) return NAN;
    240 
    241     float lnorm = C0 + C1*index + C2*index*index;
    242     float norm = exp(lnorm);
    243     return norm;
    244204}
    245205
Note: See TracChangeset for help on using the changeset viewer.