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/pmPSFtry.c

    r18040 r18554  
    55 *  @author EAM, IfA
    66 *
    7  *  @version $Revision: 1.56 $ $Name: not supported by cvs2svn $
    8  *  @date $Date: 2008-06-10 01:32:15 $
     7 *  @version $Revision: 1.57 $ $Name: not supported by cvs2svn $
     8 *  @date $Date: 2008-07-15 20:25:00 $
    99 *
    1010 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    9898
    9999// generate a pmPSFtry with a copy of the test PSF sources
    100 pmPSFtry *pmPSFtryModel (const psArray *sources, const char *modelName, pmPSFOptions *options, psMaskType maskVal, psMaskType mark)
     100pmPSFtry *pmPSFtryModel (const psArray *sources, const char *modelName, pmPSFOptions *options, psMaskType maskVal, psMaskType markVal)
    101101{
    102102    bool status;
     
    116116        return NULL;
    117117    }
     118
     119    // maskVal is used to test for rejected pixels, and must include markVal
     120    maskVal |= markVal;
    118121
    119122    // stage 1:  fit an EXT model to all candidates PSF sources
     
    129132        }
    130133
    131         // set object mask to define valid pixels -- XXX not unset?
    132         psImageKeepCircle (source->maskObj, source->peak->x, source->peak->y, options->radius, "OR", mark);
     134        // set object mask to define valid pixels
     135        psImageKeepCircle (source->maskObj, source->peak->x, source->peak->y, options->radius, "OR", markVal);
    133136
    134137        // fit model as EXT, not PSF
    135138        status = pmSourceFitModel (source, source->modelEXT, PM_SOURCE_FIT_EXT, maskVal);
     139
     140        // clear object mask to define valid pixels
     141        psImageKeepCircle (source->maskObj, source->peak->x, source->peak->y, options->radius, "AND", PS_NOT_U8(markVal));
    136142
    137143        // exclude the poor fits
     
    170176        source->modelPSF->radiusFit = options->radius;
    171177
    172         // set object mask to define valid pixels -- XXX not unset?
    173         psImageKeepCircle (source->maskObj, source->peak->x, source->peak->y, options->radius, "OR", mark);
     178        // set object mask to define valid pixels
     179        psImageKeepCircle (source->maskObj, source->peak->x, source->peak->y, options->radius, "OR", markVal);
    174180
    175181        // fit the PSF model to the source
     
    178184        // skip poor fits
    179185        if (!status) {
     186            psImageKeepCircle (source->maskObj, source->peak->x, source->peak->y, options->radius, "AND", PS_NOT_U8(markVal));
    180187            psfTry->mask->data.U8[i] = PSFTRY_MASK_PSF_FAIL;
    181188            psTrace ("psModules.objects", 4, "dropping %d (%d,%d) : failed PSF fit\n", i, source->peak->x, source->peak->y);
     
    183190        }
    184191
    185         // XXX : use a different aperture radius from the fit radius?
    186         status = pmSourceMagnitudes (source, psfTry->psf, PM_SOURCE_PHOT_INTERP, maskVal, mark);
     192        status = pmSourceMagnitudes (source, psfTry->psf, PM_SOURCE_PHOT_INTERP, maskVal);
    187193        if (!status || isnan(source->apMag)) {
     194            psImageKeepCircle (source->maskObj, source->peak->x, source->peak->y, options->radius, "AND", PS_NOT_U8(markVal));
    188195            psfTry->mask->data.U8[i] = PSFTRY_MASK_BAD_PHOT;
    189196            psTrace ("psModules.objects", 4, "dropping %d (%d,%d) : poor photometry\n", i, source->peak->x, source->peak->y);
    190197            continue;
    191198        }
     199
     200        // clear object mask to define valid pixels
     201        psImageKeepCircle (source->maskObj, source->peak->x, source->peak->y, options->radius, "AND", PS_NOT_U8(markVal));
    192202
    193203        psfTry->fitMag->data.F32[i] = source->psfMag;
Note: See TracChangeset for help on using the changeset viewer.