- Timestamp:
- Jul 11, 2010, 3:24:33 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20100621/ppSim/src/ppSimInsertStars.c
r28127 r28659 105 105 float flux = star->flux * expCorr->data.F32[(int)yCell][(int)xCell]; 106 106 107 // if psfConvolve is TRUE, we will (elsewhere) convolve the image we a PSF108 // in this case, simply place delta functions in the image109 if (psfConvolve) {110 readout->image->data.F32[(int)(yCell)][(int)(xCell)] += flux;111 continue;112 }113 114 107 // instantiate a model for the PSF at this location, set desired flux 115 108 pmModel *model = pmModelFromPSFforXY (psf, xChip, yChip, 1.0); … … 125 118 // XXX i should be applying the gain and the correct effective area 126 119 psEllipseAxes axes = pmPSF_ModelToAxes (model->params->data.F32, 20.0); 127 psF64Area = 2.0 * M_PI * axes.major * axes.minor;120 float Area = 2.0 * M_PI * axes.major * axes.minor; 128 121 129 // this value is the pure (input) flux, and is saved in the output source cmf files130 122 source->psfMag = -2.5*log10(star->flux); 131 123 source->errMag = sqrt(Area*PS_SQR(roughNoise) + flux) / flux; 132 124 133 fprintf (outfile, "%8.3f %8.3f %10.2f %7.3f %5.3f\n", star->x, star->y, star->flux, source->psfMag, source->errMag); 125 float par8 = (model->params->n == 8) ? model->params->data.F32[7] : 0.0; 126 fprintf (outfile, "%8.3f %8.3f %10.2f %2d %7.3f %5.3f %5.3f %5.3f %5.3f %5.3f\n", star->x, star->y, star->flux, 0, source->psfMag, source->errMag, axes.major, axes.minor, axes.theta, par8); 134 127 135 // insert the source flux in the image 136 pmSourceAddWithOffset (source, PM_MODEL_OP_FULL, 0xff, dX, dY); 137 138 // insert the source flux in the noise image 139 pmSourceAddWithOffset (source, PM_MODEL_OP_FULL | PM_MODEL_OP_NOISE, 0xff, dX, dY); 140 141 // Blow away the image parts of the source, which makes the memory explode 142 RESET(source->pixels); 143 RESET(source->variance); 144 RESET(source->maskObj); 145 RESET(source->maskView); 146 RESET(source->modelFlux); 147 RESET(source->psfImage); 148 RESET(source->blends); 128 // if psfConvolve is TRUE, we will (elsewhere) convolve the image we a PSF 129 // in this case, simply place delta functions in the image 130 if (psfConvolve) { 131 readout->image->data.F32[(int)(yCell)][(int)(xCell)] += flux; 132 } else { 133 // insert the source flux in the image 134 pmSourceAddWithOffset (source, PM_MODEL_OP_FULL, 0xff, dX, dY); 135 136 // insert the source flux in the noise image 137 pmSourceAddWithOffset (source, PM_MODEL_OP_FULL | PM_MODEL_OP_NOISE, 0xff, dX, dY); 138 139 // Blow away the image parts of the source, which makes the memory explode 140 RESET(source->pixels); 141 RESET(source->variance); 142 RESET(source->maskObj); 143 RESET(source->maskView); 144 RESET(source->modelFlux); 145 RESET(source->psfImage); 146 RESET(source->blends); 147 } 149 148 150 149 // add the sources to the source array
Note:
See TracChangeset
for help on using the changeset viewer.
