Changeset 15427
- Timestamp:
- Oct 31, 2007, 3:11:03 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/imcombine/pmSubtraction.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/imcombine/pmSubtraction.c
r15422 r15427 4 4 * @author GLG, MHPCC 5 5 * 6 * @version $Revision: 1.7 0$ $Name: not supported by cvs2svn $7 * @date $Date: 2007-1 0-31 21:09:33 $6 * @version $Revision: 1.71 $ $Name: not supported by cvs2svn $ 7 * @date $Date: 2007-11-01 01:11:03 $ 8 8 * 9 9 * Copyright 2004-2007 Institute for Astronomy, University of Hawaii … … 688 688 psImage *polyValues = spatialPolyValues(spatialOrder, stamp->xNorm, stamp->yNorm); // Polynomial terms 689 689 690 #ifdef TESTING 691 for (int j = 0; j < numKernels; j++) { 692 psKernel *conv = convolutions->data[j]; // Convolution of interest 693 psString filename = NULL; // Filename for output 694 psStringAppend(&filename, "conv_%03d_%03d.fits", i, j); 695 psFits *fits = psFitsOpen(filename, "w"); // FITS file pointer 696 psFree(filename); 697 psFitsWriteImage(fits, NULL, conv->image, 0, NULL); 698 psFitsClose(fits); 699 } 700 #endif 701 690 702 // Generate least-squares vector and matrix 691 bool bad = false; // Are there bad values? 692 for (int j = 0; j < numKernels; j++) { 703 bool bad = false; // Are there bad values? 704 psString badString = NULL; // Details on bad values 705 for (int j = 0; j < numKernels && !bad; j++) { 693 706 psKernel *jConv = convolutions->data[j]; // Convolution for j-th element 694 707 695 708 // Generate matrix 696 for (int k = j; k < numKernels ; k++) {709 for (int k = j; k < numKernels && !bad; k++) { 697 710 psKernel *kConv = convolutions->data[k]; // Convolution for k-th element 698 711 double sumCC = 0.0; // Sum of the convolution products … … 703 716 } 704 717 if (!isfinite(sumCC)) { 718 psStringAppend(&badString, "\nBad sumCC at %d, %d", j, k); 705 719 bad = true; 720 continue; 706 721 } 707 722 // Generate the pseudo-convolutions from the spatial polynomial terms … … 732 747 } 733 748 } 734 if (!isfinite(sumC) || !isfinite(sumIC)) { 749 if (!isfinite(sumC)) { 750 psStringAppend(&badString, "\nBad sumC at %d", j); 735 751 bad = true; 736 } 752 continue; 753 } 754 if (!isfinite(sumIC)) { 755 psStringAppend(&badString, "\nBad sumIC detected at %d", j); 756 bad = true; 757 continue; 758 } 759 737 760 for (int jyOrder = 0, jIndex = j; jyOrder <= spatialOrder; jyOrder++) { 738 761 for (int jxOrder = 0; jxOrder <= spatialOrder - jyOrder; … … 759 782 } 760 783 } 761 if (!isfinite(sum1) || !isfinite(sumI)) { 784 if (!isfinite(sum1)) { 785 psStringAppend(&badString, "\nBad sum1 detected"); 762 786 bad = true; 763 } 787 } else if (!isfinite(sumI)) { 788 psStringAppend(&badString, "\nBad sumI detected"); 789 bad = true; 790 } 791 764 792 stampMatrix->data.F64[bgIndex][bgIndex] = sum1; 765 793 stampVector->data.F64[bgIndex] = sumI; … … 767 795 if (bad) { 768 796 stamp->status = PM_SUBTRACTION_STAMP_REJECTED; 769 psTrace("psModules.imcombine", 3, "Rejecting stamp %d (%d,%d) because of bad equation\n", 770 i, (int)(stamp->x + 0.5), (int)(stamp->y + 0.5)); 797 psWarning("Rejecting stamp %d (%d,%d) because of bad equation:%s", 798 i, (int)(stamp->x + 0.5), (int)(stamp->y + 0.5), badString); 799 psFree(badString); 771 800 } else { 772 801 stamp->status = PM_SUBTRACTION_STAMP_USED; … … 854 883 if (psTraceGetLevel("psModules.imcombine") >= 7) { 855 884 for (int i = 0; i < solution->n; i++) { 856 p rintf("Solution %d: %f\n", i, solution->data.F64[i]);885 psTrace("psModules.imcombine", 7, "Solution %d: %f\n", i, solution->data.F64[i]); 857 886 } 858 887 }
Note:
See TracChangeset
for help on using the changeset viewer.
