Changeset 27162
- Timestamp:
- Mar 3, 2010, 2:33:56 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
-
ppStack/src/ppStackSources.c (modified) (1 diff)
-
psModules/src/objects/pmSourceMatch.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppStack/src/ppStackSources.c
r27159 r27162 132 132 psAssert(sources, "Don't have source list %d", i); 133 133 if (sources->n == 0) { 134 psLogMsg("ppStack", PS_LOG_WARN, "Image %d has no sources for transparency measurement.", i); 134 135 options->inputMask->data.PS_TYPE_VECTOR_MASK_DATA[i] |= PPSTACK_MASK_CAL; 136 zp->data.F32[i] = NAN; 135 137 continue; 136 138 } -
trunk/psModules/src/objects/pmSourceMatch.c
r26076 r27162 8 8 9 9 #include "pmSource.h" 10 #include "pmErrorCodes.h" 10 11 11 12 #include "pmSourceMatch.h" … … 608 609 int numImages = zp->n; // Number of images 609 610 int numStars = matches->n; // Number of stars 611 psVector *badImage = psVectorAlloc(numImages, PS_TYPE_U8); // Bad image? 612 psVectorInit(badImage, 0); 613 614 // Check for data integrity 615 { 616 psVector *num = psVectorAlloc(numImages, PS_TYPE_S32); // Number of stars per image 617 for (int i = 0; i < numStars; i++) { 618 pmSourceMatch *match = matches->data[i]; // Matched stars 619 for (int j = 0; j < match->num; j++) { 620 if (match->mask->data.PS_TYPE_VECTOR_MASK_DATA[j] & PM_SOURCE_MATCH_MASK_PHOT) { 621 continue; 622 } 623 int index = match->image->data.U32[j]; // Image index 624 num->data.S32[index]++; 625 } 626 } 627 int numGood = 0; // Number of good images 628 for (int i = 0; i < numImages; i++) { 629 if (num->data.S32[i] == 0 || !isfinite(zp->data.F32[i])) { 630 badImage->data.U8[i] = 0xFF; 631 continue; 632 } 633 numGood++; 634 } 635 psFree(num); 636 if (numGood == 0) { 637 psError(PM_ERR_DATA, true, "No images with good stars."); 638 psFree(badImage); 639 return false; 640 } 641 } 642 610 643 psVector *trans = psVectorAlloc(numImages, PS_TYPE_F32); // Transparencies for each image, magnitudes 611 644 psVectorInit(trans, 0.0); 612 645 psVector *photo = psVectorAlloc(numImages, PS_TYPE_U8); // Photometric determination for each image 613 646 psVectorInit(photo, 0); 614 psVector *badImage = psVectorAlloc(numImages, PS_TYPE_U8); // Bad image?615 psVectorInit(badImage, 0);616 647 psVector *stars = psVectorAlloc(numStars, PS_TYPE_F32); // Magnitudes for each star 617 648
Note:
See TracChangeset
for help on using the changeset viewer.
