IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 17692


Ignore:
Timestamp:
May 14, 2008, 5:25:10 PM (18 years ago)
Author:
Paul Price
Message:

Adding new function: pmReadoutMaskNonfinite

Location:
trunk/psModules/src/camera
Files:
2 edited

Legend:

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

    r17296 r17692  
    378378    return true;
    379379}
     380
     381
     382bool pmReadoutMaskNonfinite(pmReadout *readout, psMaskType maskVal)
     383{
     384    PM_ASSERT_READOUT_NON_NULL(readout, false);
     385    PM_ASSERT_READOUT_IMAGE(readout, false);
     386
     387    psImage *image = readout->image;    // Readout's image
     388    psImage *weight = readout->weight;  // Readout's weight
     389    int numCols = image->numCols, numRows = image->numRows; // Size of image
     390
     391    if (!readout->mask) {
     392        readout->mask = psImageAlloc(numCols, numRows, PS_TYPE_MASK);
     393    }
     394    psImage *mask = readout->mask;      // Readout's mask
     395
     396    for (int y = 0; y < numRows; y++) {
     397        for (int x = 0; x < numCols; x++) {
     398            if (!isfinite(image->data.F32[y][x]) || (weight && !isfinite(weight->data.F32[y][x]))) {
     399                mask->data.PS_TYPE_MASK_DATA[y][x] |= maskVal;
     400            }
     401        }
     402    }
     403
     404    return true;
     405}
  • trunk/psModules/src/camera/pmFPAMaskWeight.h

    r17249 r17692  
    55 * @author Eugene Magnier, IfA
    66 *
    7  * @version $Revision: 1.10 $ $Name: not supported by cvs2svn $
    8  * @date $Date: 2008-03-31 22:39:06 $
     7 * @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
     8 * @date $Date: 2008-05-15 03:25:10 $
    99 * Copyright 2005-2006 Institute for Astronomy, University of Hawaii
    1010 */
     
    106106    );
    107107
    108 
     108/// Explicitly mask non-finite pixels
     109///
     110/// Since unmasked non-finite pixels can occur (e.g., by out-of-range in quantisation), it is sometimes
     111/// necessary to mask them explicitly.  Non-finite pixels in the image or weight have their mask OR-ed with
     112/// the provided value.
     113bool pmReadoutMaskNonfinite(pmReadout *readout, ///< Readout to mask
     114                            psMaskType maskVal ///< Mask value to give non-finite pixels
     115    );
    109116
    110117/// @}
Note: See TracChangeset for help on using the changeset viewer.