- Timestamp:
- Aug 22, 2007, 3:05:47 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branch_20070817/ppSim/src/ppSimInsertSources.c
r14547 r14614 3 3 bool ppSimInsertSources (pmReadout *readout, psImage *expCorr, psArray *stars, pmConfig *config) { 4 4 5 bool mdok; 5 6 6 7 assert (stars); 8 assert (readout); 7 9 8 10 pmCell *cell = readout->parent; 9 11 pmChip *chip = cell->parent; 10 12 11 // XXX we probably need this to get the size right12 # if (0) 13 bool mdok;13 // XXX this is an estimate of the sky noise based on the inputs to the image simulation. 14 // XXX update this to allow the estimate based on the measured sky background 15 // XXX this is missing the gain. 14 16 psMetadata *recipe = psMetadataLookupMetadata(NULL, config->recipes, PPSIM_RECIPE); // Recipe 15 17 … … 29 31 // Rough noise estimate, appropriate for entire cell (use for source radius?) 30 32 float roughNoise = sqrtf(PS_SQR(readnoise) + (darkRate + skyRate) * expTime); 31 # endif32 33 33 34 int x0Chip = psMetadataLookupS32(NULL, chip->concepts, "CHIP.X0"); … … 43 44 int binning = psMetadataLookupS32(NULL, config->arguments, "BINNING"); // Binning in x and y 44 45 45 pmPSF *psf = psMetadataLookupPtr (NULL, chip->analysis, "PSF"); 46 pmPSF *psf = psMetadataLookupPtr (&mdok, chip->analysis, "PSPHOT.PSF"); 47 assert (psf); 46 48 47 49 int dX = PM_CELL_TO_CHIP (0.0, x0Cell, xParityCell, binning); … … 74 76 pmModelSetFlux (model, star->flux); 75 77 78 // XXX let the flux limit be a user-defined number of sky sigmas (not just 1.0) 79 float radius = model->modelRadius (model->params, roughNoise); 80 radius = PS_MAX (radius, 1.0); 81 76 82 // construct a source, with model flux pixels set, based on the model 77 pmSource *source = pmSourceFromModel (model, readout, PM_SOURCE_TYPE_STAR);83 pmSource *source = pmSourceFromModel (model, readout, radius, PM_SOURCE_TYPE_STAR); 78 84 79 85 // XXX add the sources to a source array 80 86 87 // insert the source flux in the image 81 88 pmSourceAddWithOffset (source, PM_MODEL_OP_FULL, 0xff, dX, dY); 82 89 }
Note:
See TracChangeset
for help on using the changeset viewer.
