Changeset 14547 for branches/eam_branch_20070817/ppSim/src/ppSimLoop.c
- Timestamp:
- Aug 19, 2007, 4:21:10 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branch_20070817/ppSim/src/ppSimLoop.c
r14531 r14547 31 31 // load any needed files (eg, input image, PSF) 32 32 if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) { 33 psError(PS PHOT_ERR_DATA, false, "failed IO for fpa in ppSim\n");33 psError(PS_ERR_UNKNOWN, false, "failed IO for fpa in ppSim\n"); 34 34 psFree(view); 35 35 return false; … … 43 43 // load any needed files (eg, input image, PSF) 44 44 if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) { 45 psError(PS PHOT_ERR_DATA, false, "failed IO for chip %d in ppSim\n", view->chip);45 psError(PS_ERR_UNKNOWN, false, "failed IO for chip %d in ppSim\n", view->chip); 46 46 psFree (view); 47 47 return false; 48 48 } 49 49 50 pmPSF *psf = NULL;50 // XXX check for a supplied PSF, otherwise generate a basic one 51 51 if (type == PPSIM_TYPE_OBJECT) { 52 psf = ppSimSetPSF (config);52 // XXX TBD : ppSimSetPSF (chip, config); 53 53 } 54 54 … … 74 74 75 75 // TO DO: Decide if cell is to be windowed, reduce numCols, numRows appropriately 76 psImage *signal= psImageAlloc(numCols, numRows, PS_TYPE_F32); // Signal in pixels77 psImage *variance= psImageAlloc(numCols, numRows, PS_TYPE_F32); // Noise in pixels76 readout->image = psImageAlloc(numCols, numRows, PS_TYPE_F32); // Signal in pixels 77 readout->weight = psImageAlloc(numCols, numRows, PS_TYPE_F32); // Noise in pixels 78 78 79 79 psImage *expCorr = NULL; // Exposure correction per pixel, for adding objects … … 82 82 } 83 83 84 psVector *biasRows = ppSimMakeBias ( signal, variance, cell, config, rng);84 psVector *biasRows = ppSimMakeBias (readout, config, rng); 85 85 if (type == PPSIM_TYPE_BIAS) goto done; 86 86 87 ppSimMakeDark ( signal, variance, config);87 ppSimMakeDark (readout, config); 88 88 if (type == PPSIM_TYPE_DARK) goto done; 89 89 90 ppSimMakeSky ( signal, variance, expCorr, type, config, fpa, chip, cell);90 ppSimMakeSky (readout, expCorr, type, config); 91 91 if (type == PPSIM_TYPE_FLAT) goto done; 92 92 93 // if (type == PPSIM_TYPE_OBJECT) { 94 // ppSimInsertStars (readout, expCorr, stars, config, chip, cell); 95 // } 96 93 97 if (type == PPSIM_TYPE_OBJECT) { 94 ppSimInsertS tars (signal, variance, expCorr, stars, config, chip, cell);98 ppSimInsertSources (readout, expCorr, stars, config); 95 99 } 96 100 97 101 done: 98 ppSimAddNoise(signal, variance, config, cell, rng); 99 ppSimSaturate(signal, config, cell); 100 101 readout->image = signal; 102 psFree(variance); 103 psFree(expCorr); 102 ppSimAddNoise(readout->image, readout->weight, cell, config, rng); 103 ppSimSaturate(readout, config); 104 104 105 105 ppSimAddOverscan (readout, config, biasCols, biasRows, rng);
Note:
See TracChangeset
for help on using the changeset viewer.
