IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 10247


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

Generate poisson weights only if requested.

Location:
trunk/psModules/src/camera
Files:
2 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
  • trunk/psModules/src/camera/pmFPAMaskWeight.h

    r9594 r10247  
    88/// @author Eugene Magnier, IfA
    99///
    10 /// @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
    11 /// @date $Date: 2006-10-17 02:21:03 $
     10/// @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
     11/// @date $Date: 2006-11-29 01:26:14 $
    1212///
    1313/// Copyright 2005-2006 Institute for Astronomy, University of Hawaii
     
    4747/// temporary --- it is not added to the HDU.  This is intended for when the user is iterating using
    4848/// pmReadoutReadNext, in which case the HDU can't be generated.
    49 bool pmReadoutSetWeight(pmReadout *readout ///< Readout for which to set weight
     49bool pmReadoutSetWeight(pmReadout *readout, ///< Readout for which to set weight
     50                        bool poisson    ///< Use poisson weights (in addition to read noise)?
    5051                       );
    5152
     
    6263/// (CELL.GAIN) and read noise (CELL.READNOISE).  The weight map that is produced within the readout is
    6364/// suitable for output (complete with HDU entry).  This is intended for most operations.
    64 bool pmReadoutGenerateWeight(pmReadout *readout ///< Readout for which to generate weight
     65bool pmReadoutGenerateWeight(pmReadout *readout, ///< Readout for which to generate weight
     66                             bool poisson    ///< Use poisson weights (in addition to read noise)?
    6567                            );
    6668
     
    6870///
    6971/// Calls pmReadoutGenerateMask and pmReadoutGenerateWeight for the readout
    70 bool pmReadoutGenerateMaskWeight(pmReadout *readout ///< Readout for which to generate mask and weights
     72bool pmReadoutGenerateMaskWeight(pmReadout *readout, ///< Readout for which to generate mask and weights
     73                                 bool poisson    ///< Use poisson weights (in addition to read noise)?
    7174                                );
    7275
     
    7477///
    7578/// Calls pmReadoutGenerateMaskWeight for each readout within the cell.
    76 bool pmCellGenerateMaskWeight(pmCell *cell ///< Cell for which to generate mask and weights
     79bool pmCellGenerateMaskWeight(pmCell *cell, ///< Cell for which to generate mask and weights
     80                              bool poisson    ///< Use poisson weights (in addition to read noise)?
    7781                             );
    7882
Note: See TracChangeset for help on using the changeset viewer.