Changeset 15809 for trunk/psModules/src/imcombine/pmSubtractionMatch.c
- Timestamp:
- Dec 13, 2007, 11:32:44 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/imcombine/pmSubtractionMatch.c
r15756 r15809 18 18 #include "pmSubtractionMatch.h" 19 19 20 #define TOL 1.0e-3 // Tolerance for subtraction solution21 20 #define KERNEL_MOSAIC 2 // Half-number of kernel instances in the mosaic image 22 21 … … 24 23 25 24 26 //#define TESTING 25 #define TESTING 26 //#define TESTING_MEMORY 27 27 28 28 // Output memory usage information 29 29 static void memCheck(const char *where) 30 30 { 31 #ifdef TESTING 31 #ifdef TESTING_MEMORY 32 32 psMemBlock **leaks = NULL; 33 33 int numLeaks = psMemCheckLeaks(0, &leaks, NULL, true); … … 216 216 psString regionString = NULL; // String for region 217 217 pmSubtractionStampList *stamps = NULL; // Stamps for matching PSF 218 psVector *solution = NULL; // Solution to match PSF219 218 pmSubtractionKernels *kernels = NULL; // Kernel basis functions 220 219 int numCols = ro1->image->numCols, numRows = ro1->image->numRows; // Image dimensions … … 261 260 stampSpacing, mode); 262 261 } else if (stampsName && strlen(stampsName) > 0) { 263 stamps = pmSubtractionStampsSetFromFile(stampsName, subMask, region, footprint,262 stamps = pmSubtractionStampsSetFromFile(stampsName, ro1->image, subMask, region, footprint, 264 263 stampSpacing, mode); 265 264 } … … 331 330 psTrace("psModules.imcombine", 3, "Solving equation...\n"); 332 331 333 if (!pmSubtractionSolveEquation(kernels, stamps , TOL)) {332 if (!pmSubtractionSolveEquation(kernels, stamps)) { 334 333 psError(PS_ERR_UNKNOWN, false, "Unable to calculate least-squares equation."); 335 334 goto MATCH_ERROR; … … 360 359 if (numRejected > 0) { 361 360 psTrace("psModules.imcombine", 3, "Solving equation...\n"); 362 if (!pmSubtractionSolveEquation(kernels, stamps , TOL)) {361 if (!pmSubtractionSolveEquation(kernels, stamps)) { 363 362 psError(PS_ERR_UNKNOWN, false, "Unable to calculate least-squares equation."); 364 363 goto MATCH_ERROR; … … 413 412 } 414 413 415 #if def TESTING414 #if 0 416 415 { 417 416 // Generate images of the kernel components … … 442 441 kernels = NULL; 443 442 443 #if 0 444 444 // Put the solution on the metadata 445 445 { … … 460 460 } 461 461 } 462 463 psFree(solution); 464 solution = NULL; 462 #endif 465 463 466 464 // There is data in the readout now … … 496 494 497 495 496 #ifdef TESTING 497 { 498 psFits *fits = psFitsOpen("convolved1.fits", "w"); 499 psFitsWriteImage(fits, NULL, conv1->image, 0, NULL); 500 psFitsClose(fits); 501 502 if (mode == PM_SUBTRACTION_MODE_DUAL) { 503 psFits *fits = psFitsOpen("convolved2.fits", "w"); 504 psFitsWriteImage(fits, NULL, conv2->image, 0, NULL); 505 psFitsClose(fits); 506 } 507 } 508 #endif 509 498 510 return true; 499 511 … … 504 516 psFree(kernels); 505 517 psFree(stamps); 506 psFree(solution);507 518 psFree(weight); 508 519 return false;
Note:
See TracChangeset
for help on using the changeset viewer.
