Changeset 17616
- Timestamp:
- May 9, 2008, 11:37:58 AM (18 years ago)
- File:
-
- 1 edited
-
trunk/ppSim/src/ppSimMakeStars.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppSim/src/ppSimMakeStars.c
r17557 r17616 24 24 float seeing = psMetadataLookupF32(&status, recipe, "SEEING"); // Seeing SIGMA (pixels) 25 25 float scale = psMetadataLookupF32(&status, recipe, "SCALE") * M_PI / 3600.0 / 180.0; // Plate scale (radians/pixel) 26 27 bool flatLum = psMetadataLookupBool(&status,recipe, "STARS.FLAT.LUM"); // were real stars generated? 28 float flatNum = psMetadataLookupS32(&status, recipe, "STARS.FLAT.NUM"); // were real stars generated? 26 29 27 30 float skyRate = psMetadataLookupF32(&status, recipe, "SKY.RATE"); // Sky rate … … 93 96 94 97 // Total number of stars down to the faint flux end 95 long nTotal = normScale * powf (10.0, (starsAlpha * faintMag)); 98 long nTotal = 0; 99 if (flatLum) { 100 nTotal = flatNum; 101 } else { 102 nTotal = normScale * powf (10.0, (starsAlpha * faintMag)); 103 } 96 104 97 psLogMsg("ppSim", PS_LOG_INFO, "Adding %ld stars down to %f mag\n", nTotal, faintMag);105 psLogMsg("ppSim", PS_LOG_INFO, "Adding %ld stars between %f and %f mag\n", nTotal, brightMag, faintMag); 98 106 99 107 long oldSize = stars->n; … … 107 115 star->y = psRandomUniform(rng) * ySize; // y position 108 116 109 // XXX this needs to respect the bright limit 110 float starMag = log10((i + 1.0) / normScale) / starsAlpha; 117 float starMag = 0; 118 if (flatLum) { 119 starMag = psRandomUniform(rng) * (faintMag - brightMag) + brightMag; 120 } else { 121 starMag = PS_MIN (faintMag, PS_MAX (brightMag, (log10((i + 1.0) / normScale) / starsAlpha))); 122 } 111 123 112 124 star->flux = ppSimMagToFlux (starMag, zp) * expTime;
Note:
See TracChangeset
for help on using the changeset viewer.
