IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 17730


Ignore:
Timestamp:
May 16, 2008, 4:38:46 PM (18 years ago)
Author:
Paul Price
Message:

Adding function to set image,weight pixels to NAN where they are masked.

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

Legend:

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

    r17692 r17730  
    404404    return true;
    405405}
     406
     407
     408
     409bool pmSubtractionMaskApply(pmReadout *readout, psMaskType maskVal)
     410{
     411    PM_ASSERT_READOUT_NON_NULL(readout, false);
     412    PM_ASSERT_READOUT_IMAGE(readout, false);
     413    PM_ASSERT_READOUT_MASK(readout, false);
     414
     415    int numCols = image->numCols, numRows = image->numRows; // Size of image
     416    psMaskType **maskData = mask->data.PS_TYPE_MASK_DATA; // Dereference mask
     417    psF32 **imageData = image->data.F32;// Dereference image
     418    psF32 **weightData = weight->data.F32; // Dereference weight map
     419
     420    for (int y = 0; y < numRows; y++) {
     421        for (int x = 0; x < numCols; x++) {
     422            if (maskData[y][x] & maskVal) {
     423                imageData[y][x] = NAN;
     424                if (weight) {
     425                    weightData[y][x] = NAN;
     426                }
     427            }
     428        }
     429    }
     430
     431    return true;
     432}
  • trunk/psModules/src/camera/pmFPAMaskWeight.h

    r17692 r17730  
    55 * @author Eugene Magnier, IfA
    66 *
    7  * @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
    8  * @date $Date: 2008-05-15 03:25:10 $
     7 * @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
     8 * @date $Date: 2008-05-17 02:38:46 $
    99 * Copyright 2005-2006 Institute for Astronomy, University of Hawaii
    1010 */
     
    115115    );
    116116
     117/// Apply a mask to the image and weight map
     118///
     119/// Unfortunately, image subtraction may result in a bi-modal image in masked areas, which can upset image
     120/// statistics (very important for quantising images so that a product can be written out!).  This function
     121/// sets masked areas to NAN in the image and weight.
     122bool pmSubtractionMaskApply(pmReadout *readout, ///< Readout to mask
     123                            psMaskType maskVal ///< Mask value for which to apply mask
     124    );
     125
     126
    117127/// @}
    118128#endif
Note: See TracChangeset for help on using the changeset viewer.