IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 15, 2008, 10:25:00 AM (18 years ago)
Author:
eugene
Message:

re-organization of the named mask bit handling: pmConfigMaskSetBits now assigns the bits to names and make the recipe consistent

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/objects/pmSourceSky.c

    r15980 r18554  
    66 *  @author EAM, IfA: significant modifications.
    77 *
    8  *  @version $Revision: 1.16 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2008-01-02 20:39:04 $
     8 *  @version $Revision: 1.17 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2008-07-15 20:25:00 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    4242
    4343The source.pixels and source.mask must already exist
     44
     45This function modifies the source mask; it should only be called before the object aperture is defined
    4446*****************************************************************************/
    4547
     
    4951    psF32 Radius,
    5052    psMaskType maskVal,
    51     psMaskType mark)
     53    psMaskType markVal)
    5254{
    5355    psTrace("psModules.objects", 3, "---- %s() begin ----\n", __func__);
     
    6971    psRegion srcRegion;
    7072
     73    // maskVal is used to test for rejected pixels, and must include markVal
     74    maskVal |= markVal;
     75
    7176    srcRegion = psRegionForSquare(peak->x, peak->y, Radius);
    7277    srcRegion = psRegionForImage(mask, srcRegion);
    7378
    74     psImageMaskRegion(mask, srcRegion, "OR", mark);
     79    psImageMaskRegion(mask, srcRegion, "OR", markVal);
    7580    psStats *myStats = psStatsAlloc(statsOptions);
    76     if (!psImageStats(myStats, image, mask, maskVal | mark)) {
     81    if (!psImageStats(myStats, image, mask, maskVal)) {
    7782        psError(PS_ERR_UNKNOWN, false, "Unable to get image statistics.\n");
    7883        psFree(myStats);
    7984        return false;
    8085    }
    81     psImageMaskRegion(mask, srcRegion, "AND", PS_NOT_U8(mark));
     86    psImageMaskRegion(mask, srcRegion, "AND", PS_NOT_U8(markVal));
    8287    double value = psStatsGetValue(myStats, statistic);
    8388    psFree(myStats);
     
    101106    psF32 Radius,
    102107    psMaskType maskVal,
    103     psMaskType mark
     108    psMaskType markVal
    104109)
    105110{
     
    110115    PS_ASSERT_PTR_NON_NULL(source->peak, false);
    111116    PS_ASSERT_INT_POSITIVE(Radius, false);
     117
     118    // maskVal is used to test for rejected pixels, and must include markVal
     119    maskVal |= markVal;
    112120
    113121    psStatsOptions statistic = psStatsSingleOption(statsOptions);
     
    125133    srcRegion = psRegionForImage(mask, srcRegion);
    126134
    127     psImageMaskRegion(mask, srcRegion, "OR", mark);
     135    psImageMaskRegion(mask, srcRegion, "OR", markVal);
    128136    psStats *myStats = psStatsAlloc(statsOptions);
    129     if (!psImageStats(myStats, image, mask, maskVal | mark)) {
     137    if (!psImageStats(myStats, image, mask, maskVal)) {
    130138        psError(PS_ERR_UNKNOWN, false, "Unable to get image statistics.\n");
    131139        psFree(myStats);
    132140        return false;
    133141    }
    134     psImageMaskRegion(mask, srcRegion, "AND", PS_NOT_U8(mark));
     142    psImageMaskRegion(mask, srcRegion, "AND", PS_NOT_U8(markVal));
    135143    double value = psStatsGetValue(myStats, statistic);
    136144    psFree(myStats);
Note: See TracChangeset for help on using the changeset viewer.