IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 17, 2009, 9:31:52 AM (16 years ago)
Author:
eugene
Message:

adding limits to message repeats for clarity

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/imageops/psImageBackground.c

    r24481 r26451  
    1515#include "psRandom.h"
    1616#include "psError.h"
     17
     18static int nFailures = 0;
     19
     20void psImageBackgroundInit() {
     21    nFailures = 0;
     22    return;
     23}
    1724
    1825// XXX allow the user to choose the stats method?
     
    9198    }
    9299    if (n < 0.01*Nsubset) {
    93         psLogMsg("psLib.psImageBackground", PS_LOG_DETAIL,
    94                  "Unable to measure image background: too few data points (%ld)", n);
     100        if ((nFailures < 3) || (nFailures % 100 == 0)) {
     101            psLogMsg("psLib.psImageBackground", PS_LOG_DETAIL, "Unable to measure image background: too few data points (%ld) (%d failures)", n, nFailures);
     102        }
     103        nFailures ++;
    95104        psFree(values);
    96105        return false;
     
    108117
    109118        if (!psVectorSort(values, values)) {
    110             psError(PS_ERR_UNKNOWN, false, "Unable to sort values.\n");
     119            if ((nFailures < 3) || (nFailures % 100 == 0)) {
     120                psError(PS_ERR_UNKNOWN, false, "Unable to sort values.(%d failures)\n", nFailures);
     121            }
     122            nFailures ++;
    111123            psFree(values);
    112124            return false;
     
    132144                fclose (f);
    133145            }
    134             psError(PS_ERR_UNKNOWN, false, "Unable to measure statistics for image background "
    135                     "(%dx%d, (row0,col0) = (%d,%d)",
    136                     image->numRows, image->numCols, image->row0, image->col0);
     146            if ((nFailures < 3) || (nFailures % 100 == 0)) {
     147                psError(PS_ERR_UNKNOWN, false, "Unable to measure statistics for image background "
     148                        "(%dx%d, (row0,col0) = (%d,%d) (%d failures)\n",
     149                        image->numRows, image->numCols, image->row0, image->col0, nFailures);
     150            }           
     151            nFailures ++;
    137152            psFree(values);
    138153            return false;
Note: See TracChangeset for help on using the changeset viewer.