IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 13379


Ignore:
Timestamp:
May 14, 2007, 3:23:19 PM (19 years ago)
Author:
Paul Price
Message:

Adding diagnostic output: FITS files with stamp matrices or kernels

Location:
trunk/psModules/src/imcombine
Files:
2 edited

Legend:

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

    r13366 r13379  
    44 *  @author GLG, MHPCC
    55 *
    6  *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
    7  *  @date $Date: 2007-05-12 02:00:39 $
     6 *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
     7 *  @date $Date: 2007-05-15 01:23:19 $
    88 *
    99 *  Copyright 2004-2007 Institute for Astronomy, University of Hawaii
     
    7979          for (int v = -size; v <= size; v++) {
    8080              for (int u = -size; u <= size; u++) {
    81                   sum += weightFunc(kernel->kernel[v][u]) * image->data.F64[y + v][x + u];
     81                  sum += weightFunc(kernel->kernel[v][u]) * image->data.F32[y + v][x + u];
    8282              }
    8383          }
     
    163163    for (int i = 0; i < stamps->n; i++) {
    164164        pmSubtractionStamp *stamp = stamps->data[i]; // Stamp of interest
    165         psTrace("psModules.imcombine", 6, "Inspecting stamp %d\n", i);
    166 
    167165        if (stamp->status == PM_SUBTRACTION_STAMP_CALCULATE) {
    168             psTrace("psModules.imcombine", 6, "Calculating for stamp %d\n", i);
    169166            psImage *stampMatrix = stamp->matrix; // Least-squares matrix for this stamp
    170167            psVector *stampVector = stamp->vector; // Least-squares vector for this stamp
     
    240237
    241238            stamp->status = PM_SUBTRACTION_STAMP_USED;
     239
     240            if (psTraceGetLevel("psModules.imcombine.equation") >= 10) {
     241                psString matrixName = NULL;
     242                psStringAppend(&matrixName, "matrix%d.fits", i);
     243                psFits *matrixFile = psFitsOpen(matrixName, "w");
     244                psFree(matrixName);
     245                psFitsWriteImage(matrixFile, NULL, stampMatrix, 0, NULL);
     246                psFitsClose(matrixFile);
     247            }
     248
    242249        }
    243250    }
     
    311318        psError(PS_ERR_UNKNOWN, true, "Failed to solve the least-squares system.\n");
    312319        return NULL;
     320    }
     321
     322    if (psTraceGetLevel("psModules.imcombine") >= 7) {
     323        for (int i = 0; i < solution->n; i++) {
     324            printf("       Solution %d: %f\n", i, solution->data.F64[i]);
     325        }
    313326    }
    314327
     
    413426        if (stamp->status == PM_SUBTRACTION_STAMP_USED && deviations->data.F32[i] > limit) {
    414427            // Mask out the stamp in the image so you it's not found again
     428            psTrace("psModules.imcombine", 3, "Rejecting stamp %d\n", i);
    415429            numRejected++;
    416430            for (int y = stamp->y - footprint; y <= stamp->y + footprint; y++) {
  • trunk/psModules/src/imcombine/pmSubtractionKernels.c

    r13370 r13379  
    2929    }
    3030    float result = value;               // Result to return
    31     for (int i = 2; i < exp; i++) {
     31    for (int i = 2; i <= exp; i++) {
    3232        result *= value;
    3333    }
     
    144144                        kernels->yOrder->data.S32[index] = yOrder;
    145145                        kernels->preCalc->data[index] = psMemIncrRefCounter(preCalc);
     146
     147                        psTrace("psModules.imcombine", 7, "Kernel %d: %f %d %d %d %d\n", index,
     148                                sigmas->data.F32[i], uOrder, vOrder, xOrder, yOrder);
    146149                    }
    147150                }
     151
     152
     153                if (psTraceGetLevel("psModules.imcombine.kernel") >= 10) {
     154                    psString kernelName = NULL;
     155                    psStringAppend(&kernelName, "kernel%d.fits", index);
     156                    psFits *kernelFile = psFitsOpen(kernelName, "w");
     157                    psFree(kernelName);
     158                    psFitsWriteImage(kernelFile, NULL, preCalc->image, 0, NULL);
     159                    psFitsClose(kernelFile);
     160                }
     161
    148162                psFree(preCalc);        // Drop reference
    149163            }
     
    156170           kernels->xOrder->data.S32[kernels->subIndex] == 0 &&
    157171           kernels->yOrder->data.S32[kernels->subIndex] == 0);
     172
    158173
    159174    return kernels;
Note: See TracChangeset for help on using the changeset viewer.