IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 24, 2007, 11:17:01 AM (19 years ago)
Author:
Paul Price
Message:

Checking matrices to ensure no NaNs/Infs creep in. If they do, reject
the stamp immediately.

File:
1 edited

Legend:

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

    r13406 r13511  
    44 *  @author GLG, MHPCC
    55 *
    6  *  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
    7  *  @date $Date: 2007-05-17 04:13:19 $
     6 *  @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
     7 *  @date $Date: 2007-05-24 21:17:01 $
    88 *
    99 *  Copyright 2004-2007 Institute for Astronomy, University of Hawaii
     
    430430            psFree(polyValues);
    431431
    432             // Fill in lower diagonal of symmetric matrix
     432            // Fill in lower diagonal of symmetric matrix, while checking for bad values
     433            bool bad = false;           // Are there bad values?
    433434            for (int i = 0; i < numKernels; i++) {
    434435                for (int j = 0; j < i; j++) {
     436                    if (!isfinite(stampMatrix->data.F64[j][i])) {
     437                        bad = true;
     438                    }
    435439                    stampMatrix->data.F64[i][j] = stampMatrix->data.F64[j][i];
    436440                }
     441                if (!isfinite(stampMatrix->data.F64[i][bgIndex]) ||
     442                    !isfinite(stampMatrix->data.F64[i][i]) ||
     443                    !isfinite(stampVector->data.F64[i])) {
     444                    bad = true;
     445                }
    437446                stampMatrix->data.F64[bgIndex][i] = stampMatrix->data.F64[i][bgIndex];
    438447            }
    439 
    440             stamp->status = PM_SUBTRACTION_STAMP_USED;
     448            if (!isfinite(stampVector->data.F64[bgIndex])) {
     449                bad = true;
     450            }
     451
     452            if (bad) {
     453                stamp->status = PM_SUBTRACTION_STAMP_REJECTED;
     454                psTrace("psModules.imcombine", 3, "Rejecting stamp %d because of bad equation\n", i);
     455            } else {
     456                stamp->status = PM_SUBTRACTION_STAMP_USED;
     457            }
    441458
    442459            if (psTraceGetLevel("psModules.imcombine.equation") >= 10) {
     
    633650        if (stamp->status == PM_SUBTRACTION_STAMP_USED && deviations->data.F32[i] > limit) {
    634651            // Mask out the stamp in the image so you it's not found again
    635             psTrace("psModules.imcombine", 3, "Rejecting stamp %d\n", i);
     652            psTrace("psModules.imcombine", 3, "Clipping stamp %d\n", i);
    636653            numRejected++;
    637654            for (int y = stamp->y - footprint; y <= stamp->y + footprint; y++) {
Note: See TracChangeset for help on using the changeset viewer.