Changeset 28675
- Timestamp:
- Jul 15, 2010, 6:29:09 AM (16 years ago)
- Location:
- branches/eam_branches/ipp-20100621/ppSim/src
- Files:
-
- 4 edited
-
ppSimMakeGalaxies.c (modified) (5 diffs)
-
ppSimPhotomReadout.c (modified) (1 diff)
-
ppSimPhotomReadoutFake.c (modified) (2 diffs)
-
ppSimPhotomReadoutForce.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20100621/ppSim/src/ppSimMakeGalaxies.c
r28659 r28675 18 18 int galaxyGridDX = psMetadataLookupS32(&mdok, recipe, "GALAXY.GRID.DX"); // Density of fakes 19 19 int galaxyGridDY = psMetadataLookupS32(&mdok, recipe, "GALAXY.GRID.DY"); // Density of fakes 20 bool galaxyGridRandom = psMetadataLookupBool(&mdok, recipe, "GALAXY.GRID.RANDOM"); // Density of fakes 20 21 21 22 float galaxyRmajorMax = psMetadataLookupF32(&mdok, recipe, "GALAXY.RMAJOR.MAX"); // Density of fakes … … 43 44 44 45 if (galaxyDensity <= 0) return true; 46 47 if (galaxyGridRandom) { 48 long A, B; 49 A = time(NULL); 50 for (B = 0; A == time(NULL); B++); 51 srand48(B); 52 } 45 53 46 54 // Size of FPA … … 81 89 psLogMsg("ppSim", PS_LOG_INFO, "Adding grid of %ld galaxies\n", num); 82 90 83 float galaxyIndexSlope = (galaxyIndexMax - galaxyIndexMin) / num;84 float galaxyThetaSlope = (galaxyThetaMax - galaxyThetaMin) / num;85 float galaxyARatioSlope = (galaxyARatioMax - galaxyARatioMin) / num;86 float galaxyRmajorSlope = (galaxyRmajorMax - galaxyRmajorMin) / num;91 float galaxyIndexSlope = (galaxyIndexMax - galaxyIndexMin); 92 float galaxyThetaSlope = (galaxyThetaMax - galaxyThetaMin); 93 float galaxyARatioSlope = (galaxyARatioMax - galaxyARatioMin); 94 float galaxyRmajorSlope = (galaxyRmajorMax - galaxyRmajorMin); 87 95 88 96 int i = 0; … … 101 109 // galaxy->index = (1/2n) 102 110 103 float index = (galaxyIndexMin + i * galaxyIndexSlope); // factor of 0.5 because the Sersic model creates exp(-z^n), not exp(-r^n) 111 float factor = galaxyGridRandom ? drand48() : i / num; 112 float index = (galaxyIndexMin + factor * galaxyIndexSlope); // factor of 0.5 because the Sersic model creates exp(-z^n), not exp(-r^n) 104 113 galaxy->index = 0.5/index; 105 114 106 float scale = (galaxyRmajorMin + i * galaxyRmajorSlope); 115 factor = galaxyGridRandom ? drand48() : i / num; 116 float scale = (galaxyRmajorMin + factor * galaxyRmajorSlope); 107 117 108 118 // for a sersic model, … … 114 124 115 125 galaxy->Rmaj = scale; 116 galaxy->Rmin = (galaxyARatioMin + i * galaxyARatioSlope) * galaxy->Rmaj; 117 galaxy->theta = (galaxyThetaMin + i * galaxyThetaSlope); 126 127 factor = galaxyGridRandom ? drand48() : i / num; 128 galaxy->Rmin = (galaxyARatioMin + factor * galaxyARatioSlope) * galaxy->Rmaj; 129 130 factor = galaxyGridRandom ? drand48() : i / num; 131 galaxy->theta = (galaxyThetaMin + factor * galaxyThetaSlope); 118 132 119 133 // galaxy->peak *= Io; 120 134 121 fprintf (stderr, "Rmaj: %f, scale: %f, index: %f, bn: %f, Ro: %f, Io: %f\n", 122 galaxy->Rmaj, scale, index, bn, fR, Io); 135 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); 137 } 123 138 124 139 psArrayAdd (galaxies, 100, galaxy); -
branches/eam_branches/ipp-20100621/ppSim/src/ppSimPhotomReadout.c
r27657 r28675 69 69 psArray *fakeSources = psArrayAlloc (injectedSources->n); 70 70 for (int i = 0; i < injectedSources->n; i++) { 71 fakeSources->data[i] = pmSourceCopy (injectedSources->data[i]);71 fakeSources->data[i] = pmSourceCopyData (injectedSources->data[i]); 72 72 } 73 73 -
branches/eam_branches/ipp-20100621/ppSim/src/ppSimPhotomReadoutFake.c
r27657 r28675 40 40 psArray *fakeSources = psArrayAlloc (injectedSources->n); 41 41 for (int i = 0; i < injectedSources->n; i++) { 42 fakeSources->data[i] = pmSourceCopy (injectedSources->data[i]);42 fakeSources->data[i] = pmSourceCopyData (injectedSources->data[i]); 43 43 } 44 44 … … 47 47 psArray *realSources = psArrayAlloc (realMeasuredSources->n); 48 48 for (int i = 0; i < realMeasuredSources->n; i++) { 49 realSources->data[i] = pmSourceCopy (realMeasuredSources->data[i]);49 realSources->data[i] = pmSourceCopyData (realMeasuredSources->data[i]); 50 50 } 51 51 -
branches/eam_branches/ipp-20100621/ppSim/src/ppSimPhotomReadoutForce.c
r27657 r28675 46 46 psArray *realSources = psArrayAlloc (realMeasuredSources->n); 47 47 for (int i = 0; i < realMeasuredSources->n; i++) { 48 realSources->data[i] = pmSourceCopy (realMeasuredSources->data[i]);48 realSources->data[i] = pmSourceCopyData (realMeasuredSources->data[i]); 49 49 } 50 50
Note:
See TracChangeset
for help on using the changeset viewer.
