Changeset 41173 for trunk/ppSim/src/ppSimMakeStars.c
- Timestamp:
- Nov 27, 2019, 12:05:20 PM (6 years ago)
- File:
-
- 1 edited
-
trunk/ppSim/src/ppSimMakeStars.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppSim/src/ppSimMakeStars.c
r25760 r41173 27 27 float zp = psMetadataLookupF32(&status, recipe, "ZEROPOINT"); // Photometric zero point 28 28 float seeing = psMetadataLookupF32(&status, recipe, "SEEING"); // Seeing SIGMA (pixels) 29 float scale = psMetadataLookupF32(&status, recipe, "PIXEL.SCALE") * M_PI / 3600.0 / 180.0; // Plate scale (radians/pixel) 29 float scale = psMetadataLookupF32(&status, recipe, "PIXEL.SCALE"); // Plate scale (arcsec/pixel) 30 // there has been some confusion over pixel scale: PIXEL.SCALE is supplied in arcsec / pixel. 31 // In some other places (ppSimLoadStars.c, ppSimUtils.c) it is needed in radius for WCS conversion. 32 // in the past, it was converted to radians on load (but applied inconsisently elsewhere) 33 // Now the radian version is carried as scaleRad to be more explicit 30 34 31 35 if (isnan(darkRate)) darkRate = 0.0; … … 42 46 float skyMags = psMetadataLookupF32(&status, recipe, "SKY.MAGS"); assert (status); 43 47 skyRate = scale * scale * ppSimMagToFlux (skyMags, zp); 48 // skyMags is in mags / square arcsec, so scale must be in arcsec / pixel 44 49 } 45 50 … … 61 66 if (!status) { 62 67 refMag = brightMag; 63 refSum = starsDensity * xSize * ySize * PS_SQR(scale * 180.0 / M_PI);68 refSum = starsDensity * xSize * ySize * PS_SQR(scale / 3600.0); 64 69 } 65 70 } else { 66 71 refMag = brightMag; 67 refSum = starsDensity * xSize * ySize * PS_SQR(scale * 180.0 / M_PI);72 refSum = starsDensity * xSize * ySize * PS_SQR(scale / 3600.0); 68 73 } 69 74 psTrace("ppSim", 6, "refMag: %f, refSum: %f\n", refMag, refSum); … … 120 125 psLogMsg("ppSim", PS_LOG_INFO, "Adding %ld stars between %f and %f mag\n", nTotal, brightMag, faintMag); 121 126 127 if (nTotal > 1e7) { 128 psLogMsg("ppSim", PS_LOG_INFO, "Trying to add %d stars (far more than 10M stars!), giving up\n", (int) nTotal); 129 exit (2); 130 } 131 122 132 long oldSize = stars->n; 123 133 psArrayRealloc (stars, stars->n + nTotal);
Note:
See TracChangeset
for help on using the changeset viewer.
