- Timestamp:
- Apr 23, 2007, 8:04:18 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_02_branch/psModules/src/objects/pmSourcePhotometry.c
r12956 r12958 3 3 * @author EAM, IfA; GLG, MHPCC 4 4 * 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 $ 7 7 * 8 8 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 109 109 // XXX use pmSourceAdd instead? 110 110 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); 112 112 } 113 113 … … 182 182 // set aperture mask circle to model radius 183 183 // 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); 185 187 186 188 // measure the weight of included pixels 187 189 // XXX is this supposed to use the weight or the flux? 188 190 if (mode & PM_SOURCE_PHOT_WEIGHT) { 189 pmSourcePixelWeight (&source->pixWeight, model, source->pixels, source->mask );191 pmSourcePixelWeight (&source->pixWeight, model, source->pixels, source->maskObj); 190 192 } 191 193 192 194 // measure object aperture photometry 193 status = pmSourcePhotometryAper (&source->apMag, model, flux, source->mask );195 status = pmSourcePhotometryAper (&source->apMag, model, flux, source->maskObj); 194 196 195 197 // for PSFs, correct both apMag and psfMag to same system, consistent with infinite flux star in aperture RADIUS … … 208 210 209 211 // 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)); 211 214 212 215 // if source was originally subtracted, re-subtract object, leave local sky 216 // XXX replace with pmSourceSub... 213 217 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); 215 219 } 216 220 … … 381 385 const psImage *Wi = Mi->weight; 382 386 383 const psImage *Ti = Mi->mask ;384 const psImage *Tj = Mj->mask ;387 const psImage *Ti = Mi->maskObj; 388 const psImage *Tj = Mj->maskObj; 385 389 386 390 Xs = PS_MAX (Pi->col0, Pj->col0); … … 437 441 const psImage *Wi = Mi->weight; 438 442 439 const psImage *Ti = Mi->mask ;440 const psImage *Tj = Mj->mask ;443 const psImage *Ti = Mi->maskObj; 444 const psImage *Tj = Mj->maskObj; 441 445 442 446 Xs = PS_MAX (Pi->col0, Pj->col0); … … 485 489 const psImage *Pi = Mi->pixels; 486 490 const psImage *Wi = Mi->weight; 487 const psImage *Ti = Mi->mask ;491 const psImage *Ti = Mi->maskObj; 488 492 489 493 // note that this is addressing the same image pixels, … … 545 549 } 546 550 547 // given a source, which model is currently appropriate?548 // choose PSF or EXT based on source->type, but fall back on PSF549 // if the EXT model is NULL550 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.
