IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 23, 2007, 8:04:18 AM (19 years ago)
Author:
magnier
Message:

converting to source->maskObj and source->maskView

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_02_branch/psModules/src/objects/pmSourcePhotometry.c

    r12956 r12958  
    33 *  @author EAM, IfA; GLG, MHPCC
    44 *
    5  *  @version $Revision: 1.22.4.4 $ $Name: not supported by cvs2svn $
    6  *  @date $Date: 2007-04-23 03:26:23 $
     5 *  @version $Revision: 1.22.4.5 $ $Name: not supported by cvs2svn $
     6 *  @date $Date: 2007-04-23 18:04:18 $
    77 *
    88 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    109109    // XXX use pmSourceAdd instead?
    110110    if (source->mode & PM_SOURCE_MODE_SUBTRACTED) {
    111         pmModelAdd (source->pixels, source->mask, model, PM_MODEL_OP_FULL);
     111        pmModelAdd (source->pixels, source->maskObj, model, PM_MODEL_OP_FULL);
    112112    }
    113113
     
    182182    // set aperture mask circle to model radius
    183183    // XXX use a different radius for apertures and fits...
    184     psImageKeepCircle (source->mask, x, y, model->radiusFit, "OR", PM_MASK_MARK);
     184    // XXX can I remove this?  the source should have the mask defined when it is constructed or
     185    // when the fit / aperture radius is changed...
     186    psImageKeepCircle (source->maskObj, x, y, model->radiusFit, "OR", PM_MASK_MARK);
    185187
    186188    // measure the weight of included pixels
    187189    // XXX is this supposed to use the weight or the flux?
    188190    if (mode & PM_SOURCE_PHOT_WEIGHT) {
    189         pmSourcePixelWeight (&source->pixWeight, model, source->pixels, source->mask);
     191        pmSourcePixelWeight (&source->pixWeight, model, source->pixels, source->maskObj);
    190192    }
    191193
    192194    // measure object aperture photometry
    193     status = pmSourcePhotometryAper  (&source->apMag, model, flux, source->mask);
     195    status = pmSourcePhotometryAper  (&source->apMag, model, flux, source->maskObj);
    194196
    195197    // for PSFs, correct both apMag and psfMag to same system, consistent with infinite flux star in aperture RADIUS
     
    208210
    209211    // unmask aperture
    210     psImageKeepCircle (source->mask, x, y, model->radiusFit, "AND", PS_NOT_U8(PM_MASK_MARK));
     212    // XXX can I remove this?  this will probably break things downstream...
     213    psImageKeepCircle (source->maskObj, x, y, model->radiusFit, "AND", PS_NOT_U8(PM_MASK_MARK));
    211214
    212215    // if source was originally subtracted, re-subtract object, leave local sky
     216    // XXX replace with pmSourceSub...
    213217    if (source->mode & PM_SOURCE_MODE_SUBTRACTED) {
    214         pmModelSub (source->pixels, source->mask, model, PM_MODEL_OP_FULL);
     218        pmModelSub (source->pixels, source->maskObj, model, PM_MODEL_OP_FULL);
    215219    }
    216220
     
    381385    const psImage *Wi = Mi->weight;
    382386
    383     const psImage *Ti = Mi->mask;
    384     const psImage *Tj = Mj->mask;
     387    const psImage *Ti = Mi->maskObj;
     388    const psImage *Tj = Mj->maskObj;
    385389
    386390    Xs = PS_MAX (Pi->col0, Pj->col0);
     
    437441    const psImage *Wi = Mi->weight;
    438442
    439     const psImage *Ti = Mi->mask;
    440     const psImage *Tj = Mj->mask;
     443    const psImage *Ti = Mi->maskObj;
     444    const psImage *Tj = Mj->maskObj;
    441445
    442446    Xs = PS_MAX (Pi->col0, Pj->col0);
     
    485489    const psImage *Pi = Mi->pixels;
    486490    const psImage *Wi = Mi->weight;
    487     const psImage *Ti = Mi->mask;
     491    const psImage *Ti = Mi->maskObj;
    488492
    489493    // note that this is addressing the same image pixels,
     
    545549}
    546550
    547 // given a source, which model is currently appropriate?
    548 // choose PSF or EXT based on source->type, but fall back on PSF
    549 // if the EXT model is NULL
    550 pmModel *pmSourceGetModel (bool *isPSF, const pmSource *source)
    551 {
    552 
    553     pmModel *model;
    554 
    555     switch (source->type) {
    556     case PM_SOURCE_TYPE_STAR:
    557         model = source->modelPSF;
    558         if (model == NULL)
    559             return NULL;
    560         if (isPSF)
    561             *isPSF = true;
    562         return model;
    563 
    564     case PM_SOURCE_TYPE_EXTENDED:
    565         model = source->modelEXT;
    566         if (isPSF)
    567             *isPSF = false;
    568         if (model == NULL) {
    569             model = source->modelPSF;
    570             if (isPSF)
    571                 *isPSF = true;
    572         }
    573         if (model == NULL) {
    574             if (isPSF)
    575                 *isPSF = FALSE;
    576             return NULL;
    577         }
    578         return (model);
    579         break;
    580 
    581     default:
    582         if (isPSF)
    583             *isPSF = false;
    584         return NULL;
    585     }
    586     return NULL;
    587 }
Note: See TracChangeset for help on using the changeset viewer.