- Timestamp:
- Jul 3, 2026, 3:08:04 PM (4 weeks ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-pstamp-20260421/ppSim/src/ppSimMakeBias.c
r21365 r43068 16 16 float biasLevel = psMetadataLookupF32(NULL, recipe, "BIAS.LEVEL"); // Bias level 17 17 float biasRange = psMetadataLookupF32(NULL, recipe, "BIAS.RANGE"); // Bias range 18 int biasOrder= psMetadataLookupS32(NULL, recipe, "BIAS.ORDER"); // Bias order18 int biasOrder = psMetadataLookupS32(NULL, recipe, "BIAS.ORDER"); // Bias order 19 19 20 20 float readnoise = psMetadataLookupF32(NULL, cell->concepts, "CELL.READNOISE");// CCD read noise, e … … 40 40 biasPoly->coeff[j] = biasRange * psRandomGaussian(rng); 41 41 } 42 // polynomial is evaluated for the range 0 - numRows 43 biasPoly->scale[0] = +2.0 / numRows; 44 biasPoly->zero[0] = -1.0; 45 // 0 -> -1, numRows -> 1.0 42 46 43 47 psVector *biasRows = psVectorAlloc(numRows, PS_TYPE_F32); // Bias value, per row 44 int biasOffset = 0.5 * numRows * psRandomUniform(rng); // Offset to prevent common pattern 48 49 // ??? int biasOffset = 0.5 * numRows * psRandomUniform(rng); // Offset to prevent common pattern 45 50 46 51 for (int y = 0; y < numRows; y++) { 47 52 // Adjust bias level for this row 48 biasRows->data.F32[y] = psPolynomial1DEval(biasPoly, (float)(y + biasOffset) / 49 (float)numRows - 0.5) + biasLevel; 53 biasRows->data.F32[y] = psPolynomial1DEval(biasPoly, y) + biasLevel; 54 55 // old version: 56 // biasRows->data.F32[y] = psPolynomial1DEval(biasPoly, (float)(y + biasOffset) / (float)numRows - 0.5) + biasLevel; 50 57 51 58 for (int x = 0; x < numCols; x++) { … … 62 69 } 63 70 71 /* This function introduces a polynomial variation in the bias signal as 72 a function of the row number. 73 74 BIAS.LEVEL : pedestal value for the bias 75 BIAS.RANGE : max amplitude of the bias variation 76 BIAS.ORDER : order of the Chebyshev polynomial in the y-dir 77 78 */ 79
Note:
See TracChangeset
for help on using the changeset viewer.
