Changeset 30116
- Timestamp:
- Dec 20, 2010, 8:37:13 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20101205/ppSim/src/ppSimMakeGalaxies.c
r29011 r30116 28 28 float galaxyThetaMax = psMetadataLookupF32(&mdok, recipe, "GALAXY.THETA.MAX"); // Density of fakes 29 29 float galaxyThetaMin = psMetadataLookupF32(&mdok, recipe, "GALAXY.THETA.MIN"); // Density of fakes 30 galaxyThetaMax *= PS_RAD_DEG; 31 galaxyThetaMin *= PS_RAD_DEG; 30 32 31 33 float galaxyIndexMin = psMetadataLookupF32(&mdok, recipe, "GALAXY.INDEX.MIN"); // Density of fakes … … 95 97 96 98 int i = 0; 99 float refNorm = 1.0; 100 float ourNorm = 1.0; 97 101 98 102 for (long iy = 0.5*galaxyGridDY; iy < ySize; iy += galaxyGridDY) { … … 104 108 galaxy->y = iy; 105 109 106 galaxy->peak = 1000; 110 // galaxy->peak = 1000; 111 galaxy->peak = bright / 100.0; 112 // fprintf (stderr, "Io: %f\n", bright); 107 113 108 114 // galaxyIndex from user should be for function of this form: exp(-r^(1/n)) … … 111 117 float rndValue; 112 118 113 rndValue = galaxyGridRandom ? drand48() : i / num;119 rndValue = galaxyGridRandom ? drand48() : i / (float) num; 114 120 float index = (galaxyIndexMin + rndValue * galaxyIndexSlope); 115 121 galaxy->index = 0.5/index; // factor of 0.5 because the Sersic model creates exp(-z^n), not exp(-r^n) 116 122 117 rndValue = galaxyGridRandom ? drand48() : i / num;123 rndValue = galaxyGridRandom ? drand48() : i / (float) num; 118 124 float scale = (galaxyRmajorMin + rndValue * galaxyRmajorSlope); 119 125 … … 125 131 galaxy->Rmaj = scale; 126 132 127 rndValue = galaxyGridRandom ? drand48() : i / num;133 rndValue = galaxyGridRandom ? drand48() : i / (float) num; 128 134 galaxy->Rmin = (galaxyARatioMin + rndValue * galaxyARatioSlope) * galaxy->Rmaj; 129 135 130 rndValue = galaxyGridRandom ? drand48() : i / num;136 rndValue = galaxyGridRandom ? drand48() : i / (float) num; 131 137 galaxy->theta = (galaxyThetaMin + rndValue * galaxyThetaSlope); 132 133 // galaxy->peak *= Io; 138 139 if (i == 0) { 140 refNorm = Io*scale*scale; 141 } 142 ourNorm = refNorm / (Io*scale*scale); 143 galaxy->peak *= ourNorm; 134 144 135 145 if (0) { 136 fprintf (stderr, "Rmaj: %f, scale: %f, index: %f, bn: %f, Ro: %f, Io: %f \n", galaxy->Rmaj, scale, index, bn, fR, Io);146 fprintf (stderr, "Rmaj: %f, scale: %f, index: %f, bn: %f, Ro: %f, Io: %f, theta: %f\n", galaxy->Rmaj, scale, index, bn, fR, Io, galaxy->theta); 137 147 } 138 148
Note:
See TracChangeset
for help on using the changeset viewer.
