Changeset 23212 for trunk/psModules/src/objects/pmSourceMatch.c
- Timestamp:
- Mar 6, 2009, 12:48:29 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/objects/pmSourceMatch.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/objects/pmSourceMatch.c
r23189 r23212 524 524 psVector *pmSourceMatchRelphot(const psArray *matches, // Array of matches 525 525 const psVector *zp, // Zero points for each image (including airmass term) 526 int maxIter, // Maximum number of iterations527 526 float tol, // Relative tolerance for convergence 527 int iter1, // Number of iterations for pass 1 528 float rej1, // Limit on rejection between iterations for pass 1 529 float sys1, // Systematic error in measurements for pass 1 530 int iter2, // Number of iterations for pass 2 531 float rej2, // Limit on rejection between iterations for pass 2 532 float sys2, // Systematic error in measurements for pass 2 528 533 float rejLimit, // Limit on rejection between iterations 529 534 int transIter, // Clipping iterations for transparency 530 535 float transClip, // Clipping level for transparency 531 float photoLevel, // Level at which we declare image is photometric 532 float starClip, // Clipping for stars 533 float sysErr // Systematic error in measurements 536 float photoLevel // Level at which we declare image is photometric 534 537 ) 535 538 { … … 539 542 PS_ASSERT_FLOAT_LARGER_THAN(transClip, 0.0, NULL); 540 543 541 sysErr *= sysErr; 544 sys1 *= sys1; 545 sys2 *= sys2; 542 546 543 547 int numImages = zp->n; // Number of images … … 552 556 553 557 float chi2 = sourceMatchRelphotIterate(trans, stars, badImage, matches, zp, 554 photo, sys Err); // chi^2 for solution558 photo, sys1); // chi^2 for solution 555 559 psTrace("psModules.objects", 1, "Initial: chi^2 = %f\n", chi2); 556 560 float lastChi2 = INFINITY; // chi^2 on last iteration 557 561 float fracRej = INFINITY; // Fraction of measurements rejected 558 562 559 // in the first passes, the transparencies are not well deteremined: use high systematic error and the rejection thresholds 560 for (int i = 0; i < 5; i++) { 563 // In the first passes, the transparencies are not well deteremined: use high systematic error and 564 // rejection thresholds 565 for (int i = 0; i < iter1; i++) { 561 566 562 567 // Identify photometric nights … … 572 577 psTrace("psModules.objects", 3, "Pass 1: Determined %d/%d are photometric", numPhoto, numImages); 573 578 574 // XXX use 20 sigma rejection and 0.1 mag systematic error (move these to the recipe) 575 fracRej = sourceMatchRelphotReject(trans, stars, matches, zp, photo, badImage, 20.0, PS_SQR(0.1)); 579 fracRej = sourceMatchRelphotReject(trans, stars, matches, zp, photo, badImage, rej1, sys1); 576 580 psTrace("psModules.objects", 3, "Pass 1: %f%% of measurements rejected", fracRej * 100); 577 581 578 // XXX use 0.05 mag systematic error (move these to the recipe) 579 chi2 = sourceMatchRelphotIterate(trans, stars, badImage, matches, zp, photo, PS_SQR(0.1)); 582 chi2 = sourceMatchRelphotIterate(trans, stars, badImage, matches, zp, photo, sys1); 580 583 psTrace("psModules.objects", 1, "Pass 1: iter = %d: chi^2 = %f rejected = %f\n", i, chi2, fracRej); 581 584 } 582 585 583 for (int i = 0; i < maxIter&& (fabsf(lastChi2 - chi2) > tol * chi2 || fracRej > rejLimit); i++) {586 for (int i = 0; i < iter2 && (fabsf(lastChi2 - chi2) > tol * chi2 || fracRej > rejLimit); i++) { 584 587 lastChi2 = chi2; 585 588 … … 594 597 return NULL; 595 598 } 596 psTrace("psModules.objects", 3, " Determined %d/%d are photometric", numPhoto, numImages);597 598 fracRej = sourceMatchRelphotReject(trans, stars, matches, zp, photo, badImage, starClip, sysErr);599 psTrace("psModules.objects", 3, " %f%% of measurements rejected", fracRej * 100);600 601 chi2 = sourceMatchRelphotIterate(trans, stars, badImage, matches, zp, photo, sys Err);602 psTrace("psModules.objects", 1, " iter = %d: chi^2 = %f rejected = %f\n", i, chi2, fracRej);599 psTrace("psModules.objects", 3, "Pass 2: Determined %d/%d are photometric", numPhoto, numImages); 600 601 fracRej = sourceMatchRelphotReject(trans, stars, matches, zp, photo, badImage, rej2, sys2); 602 psTrace("psModules.objects", 3, "Pass 2: %f%% of measurements rejected", fracRej * 100); 603 604 chi2 = sourceMatchRelphotIterate(trans, stars, badImage, matches, zp, photo, sys2); 605 psTrace("psModules.objects", 1, "Pass 2: iter = %d: chi^2 = %f rejected = %f\n", i, chi2, fracRej); 603 606 } 604 607
Note:
See TracChangeset
for help on using the changeset viewer.
