IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 3, 2026, 3:08:04 PM (4 weeks ago)
Author:
eugene
Message:

add -mjd-obs; add chip & cell names to output test file; more trace verbosity; fix chebyshev scales for bias variations

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-pstamp-20260421/ppSim/src/ppSimMakeBias.c

    r21365 r43068  
    1616    float biasLevel = psMetadataLookupF32(NULL, recipe, "BIAS.LEVEL"); // Bias level
    1717    float biasRange = psMetadataLookupF32(NULL, recipe, "BIAS.RANGE"); // Bias range
    18     int biasOrder  = psMetadataLookupS32(NULL, recipe, "BIAS.ORDER"); // Bias order
     18    int   biasOrder = psMetadataLookupS32(NULL, recipe, "BIAS.ORDER"); // Bias order
    1919
    2020    float readnoise = psMetadataLookupF32(NULL, cell->concepts, "CELL.READNOISE");// CCD read noise, e
     
    4040        biasPoly->coeff[j] = biasRange * psRandomGaussian(rng);
    4141    }
     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
    4246
    4347    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
    4550
    4651    for (int y = 0; y < numRows; y++) {
    4752        // 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;
    5057
    5158        for (int x = 0; x < numCols; x++) {
     
    6269}
    6370
     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.