IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 5, 2009, 4:47:00 PM (17 years ago)
Author:
Paul Price
Message:

Merging pap_branch_20090128. Resolved a small number of conflicts. Compiles, but not tested in detail.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppSim/src/ppSimMakeBias.c

    r18011 r21365  
    2020    float readnoise = psMetadataLookupF32(NULL, cell->concepts, "CELL.READNOISE");// CCD read noise, e
    2121    if (isnan(readnoise)) {
    22         psWarning("CELL.READNOISE is not set; reverting to recipe value READNOISE.");
    23         readnoise = psMetadataLookupF32(&mdok, recipe, "READNOISE");
    24         if (!mdok) {
    25             psError(PS_ERR_BAD_PARAMETER_VALUE, false, "Unable to find READNOISE in recipe.");
    26             *status = false;
    27             return NULL;
    28         }
     22        psWarning("CELL.READNOISE is not set; reverting to recipe value READNOISE.");
     23        readnoise = psMetadataLookupF32(&mdok, recipe, "READNOISE");
     24        if (!mdok) {
     25            psError(PS_ERR_BAD_PARAMETER_VALUE, false, "Unable to find READNOISE in recipe.");
     26            *status = false;
     27            return NULL;
     28        }
    2929    }
    3030
    3131    psImage *signal = readout->image;
    32     psImage *variance = readout->weight;
     32    psImage *variance = readout->variance;
    3333
    3434    int numRows = signal->numRows;
     
    3838    psPolynomial1D *biasPoly = psPolynomial1DAlloc(PS_POLYNOMIAL_CHEB, biasOrder);
    3939    for (int j = 0; j < biasOrder + 1; j++) {
    40         biasPoly->coeff[j] = biasRange * psRandomGaussian(rng);
     40        biasPoly->coeff[j] = biasRange * psRandomGaussian(rng);
    4141    }
    4242
     
    4545
    4646    for (int y = 0; y < numRows; y++) {
    47         // Adjust bias level for this row
    48         biasRows->data.F32[y] = psPolynomial1DEval(biasPoly, (float)(y + biasOffset) /
    49                                                   (float)numRows - 0.5) + biasLevel;
     47        // Adjust bias level for this row
     48        biasRows->data.F32[y] = psPolynomial1DEval(biasPoly, (float)(y + biasOffset) /
     49                                                  (float)numRows - 0.5) + biasLevel;
    5050
    51         for (int x = 0; x < numCols; x++) {
     51        for (int x = 0; x < numCols; x++) {
    5252
    53             // Bias level
    54             signal->data.F32[y][x] += biasRows->data.F32[y];
    55             variance->data.F32[y][x] += PS_SQR(readnoise);
     53            // Bias level
     54            signal->data.F32[y][x] += biasRows->data.F32[y];
     55            variance->data.F32[y][x] += PS_SQR(readnoise);
    5656
    57         }
     57        }
    5858    }
    5959    psFree(biasPoly);
Note: See TracChangeset for help on using the changeset viewer.