IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 13, 2007, 11:32:44 AM (18 years ago)
Author:
Paul Price
Message:

Updates trying to get dual-convolution to work. It doesn't yet.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/imcombine/pmSubtractionMatch.c

    r15756 r15809  
    1818#include "pmSubtractionMatch.h"
    1919
    20 #define TOL 1.0e-3                      // Tolerance for subtraction solution
    2120#define KERNEL_MOSAIC 2                 // Half-number of kernel instances in the mosaic image
    2221
     
    2423
    2524
    26 //#define TESTING
     25#define TESTING
     26//#define TESTING_MEMORY
    2727
    2828// Output memory usage information
    2929static void memCheck(const char *where)
    3030{
    31 #ifdef TESTING
     31#ifdef TESTING_MEMORY
    3232    psMemBlock **leaks = NULL;
    3333    int numLeaks = psMemCheckLeaks(0, &leaks, NULL, true);
     
    216216    psString regionString = NULL;       // String for region
    217217    pmSubtractionStampList *stamps = NULL; // Stamps for matching PSF
    218     psVector *solution = NULL;          // Solution to match PSF
    219218    pmSubtractionKernels *kernels = NULL; // Kernel basis functions
    220219    int numCols = ro1->image->numCols, numRows = ro1->image->numRows; // Image dimensions
     
    261260                                                           stampSpacing, mode);
    262261            } else if (stampsName && strlen(stampsName) > 0) {
    263                 stamps = pmSubtractionStampsSetFromFile(stampsName, subMask, region, footprint,
     262                stamps = pmSubtractionStampsSetFromFile(stampsName, ro1->image, subMask, region, footprint,
    264263                                                        stampSpacing, mode);
    265264            }
     
    331330                psTrace("psModules.imcombine", 3, "Solving equation...\n");
    332331
    333                 if (!pmSubtractionSolveEquation(kernels, stamps, TOL)) {
     332                if (!pmSubtractionSolveEquation(kernels, stamps)) {
    334333                    psError(PS_ERR_UNKNOWN, false, "Unable to calculate least-squares equation.");
    335334                    goto MATCH_ERROR;
     
    360359            if (numRejected > 0) {
    361360                psTrace("psModules.imcombine", 3, "Solving equation...\n");
    362                 if (!pmSubtractionSolveEquation(kernels, stamps, TOL)) {
     361                if (!pmSubtractionSolveEquation(kernels, stamps)) {
    363362                    psError(PS_ERR_UNKNOWN, false, "Unable to calculate least-squares equation.");
    364363                    goto MATCH_ERROR;
     
    413412            }
    414413
    415 #ifdef TESTING
     414#if 0
    416415            {
    417416                // Generate images of the kernel components
     
    442441            kernels = NULL;
    443442
     443#if 0
    444444            // Put the solution on the metadata
    445445            {
     
    460460                }
    461461            }
    462 
    463             psFree(solution);
    464             solution = NULL;
     462#endif
    465463
    466464            // There is data in the readout now
     
    496494
    497495
     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
    498510    return true;
    499511
     
    504516    psFree(kernels);
    505517    psFree(stamps);
    506     psFree(solution);
    507518    psFree(weight);
    508519    return false;
Note: See TracChangeset for help on using the changeset viewer.