Changeset 25980
- Timestamp:
- Nov 1, 2009, 3:53:37 PM (17 years ago)
- Location:
- trunk/psModules/src/objects
- Files:
-
- 2 edited
-
pmSourcePhotometry.c (modified) (8 diffs)
-
pmSourcePhotometry.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/objects/pmSourcePhotometry.c
r25754 r25980 545 545 546 546 // determine chisq, etc for linear normalization-only fit 547 bool pmSourceChisq (pmModel *model, psImage *image, psImage *mask, psImage *variance, 548 psImageMaskType maskVal) 547 bool pmSourceChisq (pmModel *model, psImage *image, psImage *mask, psImage *variance, psImageMaskType maskVal, const float covarFactor) 549 548 { 550 549 PS_ASSERT_PTR_NON_NULL(model, false); … … 561 560 if (variance->data.F32[j][i] <= 0) 562 561 continue; 563 dC += PS_SQR (image->data.F32[j][i]) / variance->data.F32[j][i];562 dC += PS_SQR (image->data.F32[j][i]) / (covarFactor * variance->data.F32[j][i]); 564 563 Npix ++; 565 564 } … … 573 572 574 573 575 double pmSourceModelWeight(const pmSource *Mi, 576 int term, 577 const bool unweighted_sum) // should the cross product be weighted? 574 double pmSourceModelWeight(const pmSource *Mi, int term, const bool unweighted_sum, const float covarFactor) 578 575 { 579 576 PS_ASSERT_PTR_NON_NULL(Mi, NAN); … … 594 591 continue; 595 592 if (!unweighted_sum) { 596 wt = Wi->data.F32[yi][xi];593 wt = covarFactor * Wi->data.F32[yi][xi]; 597 594 if (wt == 0) 598 595 continue; … … 623 620 } 624 621 625 double pmSourceModelDotModel (const pmSource *Mi, 626 const pmSource *Mj, 627 const bool unweighted_sum) // should the cross product be weighted? 622 double pmSourceModelDotModel (const pmSource *Mi, const pmSource *Mj, const bool unweighted_sum, const float covarFactor) 628 623 { 629 624 PS_ASSERT_PTR_NON_NULL(Mi, NAN); … … 677 672 flux += (Pi->data.F32[yi][xi] * Pj->data.F32[yj][xj]); 678 673 } else { 679 wt = Wi->data.F32[yi][xi];674 wt = covarFactor * Wi->data.F32[yi][xi]; 680 675 if (wt > 0) { 681 676 flux += (Pi->data.F32[yi][xi] * Pj->data.F32[yj][xj]) / wt; … … 687 682 } 688 683 689 double pmSourceDataDotModel (const pmSource *Mi, 690 const pmSource *Mj, 691 const bool unweighted_sum) // should the cross product be weighted? 684 double pmSourceDataDotModel (const pmSource *Mi, const pmSource *Mj, const bool unweighted_sum, const float covarFactor) 692 685 { 693 686 PS_ASSERT_PTR_NON_NULL(Mi, NAN); … … 741 734 flux += (Pi->data.F32[yi][xi] * Pj->data.F32[yj][xj]); 742 735 } else { 743 wt = Wi->data.F32[yi][xi];736 wt = covarFactor * Wi->data.F32[yi][xi]; 744 737 if (wt > 0) { 745 738 flux += (Pi->data.F32[yi][xi] * Pj->data.F32[yj][xj]) / wt; -
trunk/psModules/src/objects/pmSourcePhotometry.h
r21511 r25980 52 52 bool pmSourceMagnitudes (pmSource *source, pmPSF *psf, pmSourcePhotometryMode mode, psImageMaskType maskVal); 53 53 bool pmSourcePixelWeight (float *pixWeight, pmModel *model, psImage *mask, psImageMaskType maskVal); 54 bool pmSourceChisq (pmModel *model, psImage *image, psImage *mask, psImage *weight, psImageMaskType maskVal );54 bool pmSourceChisq (pmModel *model, psImage *image, psImage *mask, psImage *weight, psImageMaskType maskVal, const float covarFactor); 55 55 56 56 57 double pmSourceDataDotModel (const pmSource *Mi, const pmSource *Mj, const bool unweighted_sum );58 double pmSourceModelDotModel (const pmSource *Mi, const pmSource *Mj, const bool unweighted_sum );59 double pmSourceModelWeight(const pmSource *Mi, int term, const bool unweighted_sum );57 double pmSourceDataDotModel (const pmSource *Mi, const pmSource *Mj, const bool unweighted_sum, const float covarFactor); 58 double pmSourceModelDotModel (const pmSource *Mi, const pmSource *Mj, const bool unweighted_sum, const float covarFactor); 59 double pmSourceModelWeight(const pmSource *Mi, int term, const bool unweighted_sum, const float covarFactor); 60 60 61 61 // retire these:
Note:
See TracChangeset
for help on using the changeset viewer.
