IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 28, 2006, 3:26:24 PM (19 years ago)
Author:
Paul Price
Message:

Generate poisson weights only if requested.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/camera/pmFPAMaskWeight.c

    r10245 r10247  
    188188}
    189189
    190 bool pmReadoutSetWeight(pmReadout *readout)
     190bool pmReadoutSetWeight(pmReadout *readout, bool poisson)
    191191{
    192192    PS_ASSERT_PTR_NON_NULL(readout, false);
     
    207207    }
    208208
    209     if (gain > 0.0) {
     209    if (poisson) {
    210210        // Set weight image to the variance in ADU = f/g + rn^2
    211211        psImage *image = readout->image;    // The image pixels
     
    217217                                               psScalarAlloc(1, PS_TYPE_F32));
    218218    } else {
    219         // Gain is negative or zero --- just use the read noise
     219        // Just use the read noise
    220220        if (!readout->weight) {
    221221            readout->weight = psImageAlloc(readout->image->numCols, readout->image->numRows, PS_TYPE_F32);
     
    230230}
    231231
    232 bool pmReadoutGenerateWeight(pmReadout *readout)
     232bool pmReadoutGenerateWeight(pmReadout *readout, bool poisson)
    233233{
    234234    PS_ASSERT_PTR_NON_NULL(readout, false);
     
    273273    }
    274274
    275     return pmReadoutSetWeight(readout);
    276 }
    277 
    278 bool pmReadoutGenerateMaskWeight(pmReadout *readout)
     275    return pmReadoutSetWeight(readout, poisson);
     276}
     277
     278bool pmReadoutGenerateMaskWeight(pmReadout *readout, bool poisson)
    279279{
    280280    PS_ASSERT_PTR_NON_NULL(readout, false);
     
    283283
    284284    success |= pmReadoutGenerateMask(readout);
    285     success |= pmReadoutGenerateWeight(readout);
     285    success |= pmReadoutGenerateWeight(readout, poisson);
    286286
    287287    return success;
    288288}
    289289
    290 bool pmCellGenerateMaskWeight(pmCell *cell)
     290bool pmCellGenerateMaskWeight(pmCell *cell, bool poisson)
    291291{
    292292    PS_ASSERT_PTR_NON_NULL(cell, false);
     
    296296    for (int i = 0; i < readouts->n; i++) {
    297297        pmReadout *readout = readouts->data[i]; // The readout
    298         pmReadoutGenerateMaskWeight(readout);
     298        pmReadoutGenerateMaskWeight(readout, poisson);
    299299    }
    300300
Note: See TracChangeset for help on using the changeset viewer.