- Timestamp:
- Jun 23, 2012, 6:15:21 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20120601/ppSim/src/ppSimInsertStars.c
r32350 r34054 79 79 FILE *outfile = fopen (outname, "w"); 80 80 81 float radius = -1.0; 82 81 83 // add sources to the readout image & variance 82 84 psTrace("ppSim", 1, "Inserting %ld stars...\n", stars->n); … … 90 92 float xChip = PM_FPA_TO_CHIP(star->x, x0Chip, xParityChip); 91 93 float yChip = PM_FPA_TO_CHIP(star->y, y0Chip, yParityChip); 94 xChip = (int) xChip; 95 yChip = (int) yChip; 92 96 93 97 // Position on the cell and peak flux … … 106 110 float flux = star->flux * expCorr->data.F32[(int)yCell][(int)xCell]; 107 111 112 // XXX test: 113 flux = star->flux * expCorr->data.F32[0][0]; 114 108 115 // instantiate a model for the PSF at this location, set desired flux 109 116 pmModel *model = pmModelFromPSFforXY (psf, xChip, yChip, 1.0); 110 117 pmModelSetFlux (model, flux); 111 118 112 float radius = model->modelRadius (model->params, nSigmaLim * roughNoise); 113 radius = PS_MAX (radius, 1.0); 114 radius = 20.0; 119 // we will set the radius on the first object, and leave it there for everyone else 120 if (radius < 0) { 121 radius = model->modelRadius (model->params, nSigmaLim * roughNoise); 122 radius = PS_MIN (radius, 50.0); 123 } 115 124 116 125 // construct a source, with model flux pixels set, based on the model … … 137 146 } else { 138 147 // insert the source flux in the image 139 floatsum1 = imageSum(source->pixels);148 double sum1 = imageSum(source->pixels); 140 149 pmSourceAddWithOffset (source, PM_MODEL_OP_FULL, 0xff, dX, dY); 141 floatsum2 = imageSum(source->pixels);150 double sum2 = imageSum(source->pixels); 142 151 starFlux = sum2 - sum1; 143 152 … … 154 163 RESET(source->blends); 155 164 } 156 fprintf (outfile, "%8.3f %8.3f %10. 2f %2d %7.3f %5.3f %5.3f %5.3f %5.3f %5.3f : %f %f\n", star->x, star->y, starFlux, 0, source->psfMag, source->psfMagErr, axes.major, axes.minor, axes.theta, par8, model->params->data.F32[PM_PAR_I0], radius);165 fprintf (outfile, "%8.3f %8.3f %10.5f %2d %7.3f %5.3f %5.3f %5.3f %5.3f %5.3f : %f %f\n", star->x, star->y, starFlux, 0, source->psfMag, source->psfMagErr, axes.major, axes.minor, axes.theta, par8, model->params->data.F32[PM_PAR_I0], radius); 157 166 158 167 // add the sources to the source array
Note:
See TracChangeset
for help on using the changeset viewer.
