IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

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

File:
1 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++) {
Note: See TracChangeset for help on using the changeset viewer.