Changeset 14816 for trunk/ppSim/src/ppSimMakeSky.c
- Timestamp:
- Sep 11, 2007, 1:01:03 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/ppSim/src/ppSimMakeSky.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppSim/src/ppSimMakeSky.c
r14657 r14816 8 8 9 9 pmCell *cell = readout->parent; 10 pmChip *chip = cell->parent; 10 pmChip *chip = cell->parent; 11 11 pmFPA *fpa = chip->parent; 12 12 … … 38 38 for (int y = 0; y < signal->numRows; y++) { 39 39 40 float yFPA = PPSIM_CELL_TO_FPA(y, y0Cell, yParityCell, binning, y0Chip, yParityChip) * 2.0 /41 (bounds->y1 - bounds->y0); // Relative y position in FPA40 float yFPA = PPSIM_CELL_TO_FPA(y, y0Cell, yParityCell, binning, y0Chip, yParityChip) * 2.0 / 41 (bounds->y1 - bounds->y0); // Relative y position in FPA 42 42 43 for (int x = 0; x < signal->numCols; x++) {44 float xFPA = PPSIM_CELL_TO_FPA(x, x0Cell, xParityCell, binning, x0Chip, xParityChip) * 2.0 /45 (bounds->x1 - bounds->x0); // Relative x position in FPA43 for (int x = 0; x < signal->numCols; x++) { 44 float xFPA = PPSIM_CELL_TO_FPA(x, x0Cell, xParityCell, binning, x0Chip, xParityChip) * 2.0 / 45 (bounds->x1 - bounds->x0); // Relative x position in FPA 46 46 47 // Shutter: adjust exposure time48 float realExpTime = expTime + shutterTime * (xFPA + yFPA + 2.0) / 4.0;47 // Shutter: adjust exposure time 48 float realExpTime = expTime + shutterTime * (xFPA + yFPA + 2.0) / 4.0; 49 49 50 // Gaussian flat-field over the FPA51 float flatValue = exp(-0.5 / PS_SQR(flatSigma) * 52 (PS_SQR(yFPA) + PS_SQR(xFPA))) / flatSigma / sqrt(M_PI);50 // Gaussian flat-field over the FPA 51 float flatValue = expf(-0.5 / PS_SQR(flatSigma) * (PS_SQR(yFPA) + PS_SQR(xFPA))) / 52 flatSigma / sqrtf(2.0 * M_PI); 53 53 54 if (type == PPSIM_TYPE_FLAT) {55 float flatFlux = flatRate * flatValue * realExpTime; // Flux from flat-field56 signal->data.F32[y][x] += flatFlux;57 variance->data.F32[y][x] += flatFlux;58 continue;59 }54 if (type == PPSIM_TYPE_FLAT) { 55 float flatFlux = flatRate * flatValue * realExpTime; // Flux from flat-field 56 signal->data.F32[y][x] += flatFlux; 57 variance->data.F32[y][x] += flatFlux; 58 continue; 59 } 60 60 61 expCorr->data.F32[y][x] = flatValue *realExpTime / expTime;61 expCorr->data.F32[y][x] = realExpTime / expTime; 62 62 63 // Sky background64 float skyFlux = skyRate * flatValue * realExpTime; // Flux from sky65 signal->data.F32[y][x] += skyFlux;66 variance->data.F32[y][x] += skyFlux;63 // Sky background 64 float skyFlux = skyRate * flatValue * realExpTime; // Flux from sky 65 signal->data.F32[y][x] += skyFlux; 66 variance->data.F32[y][x] += skyFlux; 67 67 68 // TO DO: Add fringes68 // TO DO: Add fringes 69 69 70 }70 } 71 71 } 72 72 psFree(bounds);
Note:
See TracChangeset
for help on using the changeset viewer.
