- Timestamp:
- Oct 29, 2007, 2:59:23 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branch_20071023/psModules/src/objects/pmSourcePhotometry.c
r15107 r15418 3 3 * @author EAM, IfA; GLG, MHPCC 4 4 * 5 * @version $Revision: 1.36 $ $Name: not supported by cvs2svn $6 * @date $Date: 2007- 09-29 03:14:55$5 * @version $Revision: 1.36.2.1 $ $Name: not supported by cvs2svn $ 6 * @date $Date: 2007-10-30 00:59:23 $ 7 7 * 8 8 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 39 39 bool pmSourceMagnitudesInit (psMetadata *config) 40 40 { 41 41 PS_ASSERT_PTR_NON_NULL(config, false); 42 42 bool status; 43 43 … … 64 64 65 65 // XXX masked region should be (optionally) elliptical 66 bool pmSourceMagnitudes (pmSource *source, pmPSF *psf, pmSourcePhotometryMode mode, psMaskType maskVal, psMaskType mark) 67 { 66 bool pmSourceMagnitudes (pmSource *source, pmPSF *psf, pmSourcePhotometryMode mode, 67 psMaskType maskVal, psMaskType mark) 68 { 69 PS_ASSERT_PTR_NON_NULL(source, false); 70 PS_ASSERT_PTR_NON_NULL(psf, false); 68 71 69 72 int status = false; … … 269 272 bool pmSourcePhotometryModel (float *fitMag, pmModel *model) 270 273 { 274 PS_ASSERT_PTR_NON_NULL(fitMag, false); 275 if (model == NULL) { 276 return false; 277 } 271 278 272 279 float fitSum = 0; 273 280 *fitMag = NAN; 274 275 if (model == NULL) {276 return false;277 }278 281 279 282 // measure fitMag … … 289 292 290 293 // return source aperture magnitude 291 bool pmSourcePhotometryAper (float *apMag, pmModel *model, psImage *image, psImage *mask, psMaskType maskVal) 292 { 294 bool pmSourcePhotometryAper (float *apMag, pmModel *model, psImage *image, psImage *mask, 295 psMaskType maskVal) 296 { 297 PS_ASSERT_PTR_NON_NULL(apMag, false); 298 PS_ASSERT_PTR_NON_NULL(image, false); 299 PS_ASSERT_PTR_NON_NULL(mask, false); 300 PS_ASSERT_PTR_NON_NULL(model, false); 301 293 302 float apSum = 0; 294 303 float sky = 0; 295 304 *apMag = NAN; 296 297 if (model == NULL) {298 psError(PM_ERR_OBJECTS, true, "Model is NULL");299 return false;300 }301 305 302 306 if (DO_SKY) { … … 327 331 328 332 // return source aperture magnitude 329 bool pmSourcePixelWeight (float *pixWeight, pmModel *model, psImage *image, psImage *mask, psMaskType maskVal) 330 { 333 bool pmSourcePixelWeight (float *pixWeight, pmModel *model, psImage *image, psImage *mask, 334 psMaskType maskVal) 335 { 336 PS_ASSERT_PTR_NON_NULL(pixWeight, false); 337 PS_ASSERT_PTR_NON_NULL(image, false); 338 PS_ASSERT_PTR_NON_NULL(mask, false); 339 PS_ASSERT_PTR_NON_NULL(model, false); 340 331 341 float modelSum = 0; 332 342 float validSum = 0; … … 339 349 340 350 *pixWeight = 0.0; 341 342 if (model == NULL)343 return false;344 351 345 352 // we only care about the value of the object model, not the local sky … … 412 419 const bool unweighted_sum) // should the cross product be weighted? 413 420 { 421 PS_ASSERT_PTR_NON_NULL(Mi, NAN); 422 PS_ASSERT_PTR_NON_NULL(Mj, NAN); 414 423 415 424 int Xs, Xe, Ys, Ye; … … 475 484 const bool unweighted_sum) // should the cross product be weighted? 476 485 { 486 PS_ASSERT_PTR_NON_NULL(Mi, NAN); 487 PS_ASSERT_PTR_NON_NULL(Mj, NAN); 477 488 478 489 int Xs, Xe, Ys, Ye; … … 538 549 const bool unweighted_sum) // should the cross product be weighted? 539 550 { 551 PS_ASSERT_PTR_NON_NULL(Mi, NAN); 540 552 double flux = 0, wt = 0, factor = 0; 541 553 … … 587 599 # endif 588 600 589 bool pmSourceChisq (pmModel *model, psImage *image, psImage *mask, psImage *weight, psMaskType maskVal) 590 { 601 bool pmSourceChisq (pmModel *model, psImage *image, psImage *mask, psImage *weight, 602 psMaskType maskVal) 603 { 604 PS_ASSERT_PTR_NON_NULL(model, false); 605 PS_ASSERT_PTR_NON_NULL(image, false); 606 PS_ASSERT_PTR_NON_NULL(mask, false); 607 PS_ASSERT_PTR_NON_NULL(weight, false); 591 608 592 609 double dC = 0.0; … … 613 630 const bool unweighted_sum) // should the cross product be weighted? 614 631 { 632 PS_ASSERT_PTR_NON_NULL(Mi, NAN); 615 633 double flux = 0, wt = 0, factor = 0; 616 634 … … 662 680 const bool unweighted_sum) // should the cross product be weighted? 663 681 { 682 PS_ASSERT_PTR_NON_NULL(Mi, NAN); 683 PS_ASSERT_PTR_NON_NULL(Mj, NAN); 664 684 int Xs, Xe, Ys, Ye; 665 685 int xi, xj, yi, yj; … … 724 744 const bool unweighted_sum) // should the cross product be weighted? 725 745 { 726 746 PS_ASSERT_PTR_NON_NULL(Mi, NAN); 747 PS_ASSERT_PTR_NON_NULL(Mj, NAN); 727 748 int Xs, Xe, Ys, Ye; 728 749 int xi, xj, yi, yj;
Note:
See TracChangeset
for help on using the changeset viewer.
