IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 25, 2010, 12:33:42 PM (16 years ago)
Author:
Paul Price
Message:

Fixing error codes for PSF-matching.

File:
1 edited

Legend:

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

    r26893 r27086  
    77#include <pslib.h>
    88
     9#include "pmErrorCodes.h"
    910#include "pmSubtraction.h"
    1011#include "pmSubtractionKernels.h"
     
    718719    // Generate convolutions: these are generated once and saved
    719720    if (!pmSubtractionConvolveStamp(stamp, kernels, footprint)) {
    720         psError(PS_ERR_UNKNOWN, false, "Unable to convolve stamp %d.", index);
     721        psError(psErrorCodeLast(), false, "Unable to convolve stamp %d.", index);
    721722        return NULL;
    722723    }
     
    869870
    870871    if (!psThreadPoolWait(true)) {
    871         psError(PS_ERR_UNKNOWN, false, "Error waiting for threads.");
     872        psError(psErrorCodeLast(), false, "Error waiting for threads.");
    872873        return false;
    873874    }
     
    989990            psStats *stats = psStatsAlloc(PS_STAT_ROBUST_MEDIAN); // Statistics for norm
    990991            if (!psVectorStats(stats, norms, NULL, NULL, 0)) {
    991                 psError(PS_ERR_UNKNOWN, false, "Unable to determine median normalisation");
     992                psError(PM_ERR_DATA, false, "Unable to determine median normalisation");
    992993                psFree(stats);
    993994                psFree(sumMatrix);
     
    11341135            psStats *stats = psStatsAlloc(PS_STAT_ROBUST_MEDIAN); // Statistics for norm
    11351136            if (!psVectorStats(stats, norms, NULL, NULL, 0)) {
    1136                 psError(PS_ERR_UNKNOWN, false, "Unable to determine median normalisation");
     1137                psError(PM_ERR_DATA, false, "Unable to determine median normalisation");
    11371138                psFree(stats);
    11381139                psFree(sumMatrix);
     
    13711372                                                          false); // Kernel image
    13721373                if (!image) {
    1373                     psError(PS_ERR_UNKNOWN, false, "Unable to generate image of kernel.");
     1374                    psError(psErrorCodeLast(), false, "Unable to generate image of kernel.");
    13741375                    return false;
    13751376                }
     
    19471948            psVector *w = NULL;
    19481949            if (!psMatrixSVD (&U, &w, &V, kernelMatrix)) {
    1949                 psError(PS_ERR_UNKNOWN, false, "failed to perform SVD on sumMatrix\n");
     1950                psError(psErrorCodeLast(), false, "failed to perform SVD on sumMatrix\n");
    19501951                return NULL;
    19511952            }
     
    20872088            psImage *luMatrix = psMatrixLUDecomposition(NULL, &permutation, sumMatrix);
    20882089            if (!luMatrix) {
    2089                 psError(PS_ERR_UNKNOWN, true, "LU Decomposition of least-squares matrix failed.\n");
     2090                psError(PM_ERR_DATA, true, "LU Decomposition of least-squares matrix failed.\n");
    20902091                psFree(solution);
    20912092                psFree(sumVector);
     
    21002101            psFree(permutation);
    21012102            if (!solution) {
    2102                 psError(PS_ERR_UNKNOWN, true, "Failed to solve the least-squares system.\n");
     2103                psError(PM_ERR_DATA, true, "Failed to solve the least-squares system.\n");
    21032104                psFree(solution);
    21042105                psFree(sumVector);
Note: See TracChangeset for help on using the changeset viewer.