IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 10240


Ignore:
Timestamp:
Nov 28, 2006, 12:33:43 PM (20 years ago)
Author:
Paul Price
Message:

For non-positive gain, use read noise only.

File:
1 edited

Legend:

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

    r10075 r10240  
    207207    }
    208208
    209     // Set weight image to the variance in ADU = f/g + rn^2
    210     psImage *image = readout->image;    // The image pixels
    211     readout->weight = (psImage*)psBinaryOp(readout->weight, image, "/", psScalarAlloc(gain, PS_TYPE_F32));
    212 
    213     // a negative weight is non-sensical. if the image value drops below 1, the weight must be 1.
    214     readout->weight = (psImage*)psUnaryOp(readout->weight, readout->weight, "abs");
    215     readout->weight = (psImage*)psBinaryOp(readout->weight, readout->weight, "max", psScalarAlloc(1, PS_TYPE_F32));
     209    if (gain > 0.0) {
     210        // Set weight image to the variance in ADU = f/g + rn^2
     211        psImage *image = readout->image;    // The image pixels
     212        readout->weight = (psImage*)psBinaryOp(readout->weight, image, "/", psScalarAlloc(gain, PS_TYPE_F32));
     213
     214        // a negative weight is non-sensical. if the image value drops below 1, the weight must be 1.
     215        readout->weight = (psImage*)psUnaryOp(readout->weight, readout->weight, "abs");
     216        readout->weight = (psImage*)psBinaryOp(readout->weight, readout->weight, "max",
     217                                               psScalarAlloc(1, PS_TYPE_F32));
     218    } else {
     219        // Gain is negative or zero --- just use the read noise
     220        psImageInit(readout->weight, 0.0);
     221    }
    216222
    217223    readout->weight = (psImage*)psBinaryOp(readout->weight, readout->weight, "+",
Note: See TracChangeset for help on using the changeset viewer.