Changeset 21266
- Timestamp:
- Feb 2, 2009, 10:45:54 AM (17 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/objects/pmSourceMatch.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/objects/pmSourceMatch.c
r21183 r21266 62 62 for (long i = 0; i < numSources; i++) { 63 63 pmSource *source = sources->data[i]; // Source of interest 64 if (!source || (source->mode & SOURCE_MASK) || !isfinite(source->psfMag) || 65 !isfinite(source->errMag) || source->psfMag > SOURCE_FAINTEST) { 66 continue; 67 } 64 if (!source) continue; 65 if (source->mode & SOURCE_MASK) continue; 66 if (!isfinite(source->psfMag)) continue; 67 if (!isfinite(source->errMag)) continue; 68 if (source->psfMag > SOURCE_FAINTEST) continue; 69 68 70 float xSrc, ySrc; // Coordinates of source 69 71 coordsFromSource(&xSrc, &ySrc, source); … … 76 78 (*y)->data.F32[num] = ySrc; 77 79 (*mag)->data.F32[num] = source->psfMag; 78 (*magErr)->data.F32[num] = source->errMag ;80 (*magErr)->data.F32[num] = source->errMag ; 79 81 num++; 80 82 } … … 486 488 } 487 489 float dev = mag + cal - stars->data.F32[i]; // Deviation 488 if (PS_SQR(dev) > starClip * (PS_SQR(magErr) + sysErr2)) { 490 491 // only reject detections from photometric images (non-photometric images can 492 // have large errors. XXX Or: allow a much higher rejection threshold 493 if (photo->data.U8[index]) { 494 if (PS_SQR(dev) > starClip * (PS_SQR(magErr) + sysErr2)) { 489 495 numRejected++; 490 496 match->mask->data.PS_TYPE_VECTOR_MASK_DATA[j] = 0xFF; 491 } 497 } 498 } 492 499 } 493 500 } … … 528 535 float lastChi2 = INFINITY; // chi^2 on last iteration 529 536 float fracRej = INFINITY; // Fraction of measurements rejected 537 538 // in the first passes, the transparencies are not well deteremined: use high systematic error and the rejection thresholds 539 for (int i = 0; i < 5; i++) { 540 541 // Identify photometric nights 542 int numPhoto = sourceMatchRelphotPhotometric(photo, trans, transIter, transClip, photoLevel); // Number of photometric images 543 if (numPhoto < 0) { 544 psError(PS_ERR_UNKNOWN, false, "Unable to perform photometric determination"); 545 psFree(trans); 546 psFree(photo); 547 psFree(stars); 548 return NULL; 549 } 550 psTrace("psModules.objects", 3, "Pass 1: Determined %d/%d are photometric", numPhoto, numImages); 551 552 // XXX use 20 sigma rejection and 0.1 mag systematic error (move these to the recipe) 553 fracRej = sourceMatchRelphotReject(trans, stars, matches, zp, photo, 20.0, PS_SQR(0.1)); 554 psTrace("psModules.objects", 3, "Pass 1: %f%% of measurements rejected", fracRej * 100); 555 556 // XXX use 0.05 mag systematic error (move these to the recipe) 557 chi2 = sourceMatchRelphotIterate(trans, stars, matches, zp, photo, PS_SQR(0.1)); // chi^2 for solution 558 psTrace("psModules.objects", 1, "Pass 1: iter = %d: chi^2 = %f rejected = %f\n", i, chi2, fracRej); 559 } 560 530 561 for (int i = 0; i < maxIter && (fabsf(lastChi2 - chi2) > tol * chi2 || fracRej > rejLimit); i++) { 531 562 lastChi2 = chi2;
Note:
See TracChangeset
for help on using the changeset viewer.
