IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 15, 2010, 11:22:56 AM (16 years ago)
Author:
watersc1
Message:

association and jpegs look fine. random simtest errors are a bit worrying, though.

Location:
branches/czw_branch/20100519
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/czw_branch/20100519

  • branches/czw_branch/20100519/ppStack/src/ppStackTarget.c

    r28304 r28334  
    164164
    165165        psStats *bg = psStatsAlloc(PS_STAT_ROBUST_MEDIAN); // Statistics for background
     166        float mean = NAN;                                  // Measured mean variance
    166167        if (!psImageBackground(bg, NULL, variance, mask, maskVal, rng)) {
    167             psError(PPSTACK_ERR_DATA, false, "Can't measure background for image.");
    168             psFree(rng);
    169             return NULL;
     168            psErrorClear();
     169            // Retry using all the available pixels
     170            bg->nSubsample = variance->numCols * variance->numRows + 1;
     171            if (!psImageStats(bg, variance, mask, maskVal)) {
     172                psLogMsg("ppStack", PS_LOG_DETAIL,
     173                         "Couldn't measure mean variance for image %d; retrying.", i);
     174                psErrorClear();
     175                // Retry with desperate statistic
     176                bg->options = PS_STAT_SAMPLE_MEAN;
     177                if (!psImageStats(bg, variance, mask, maskVal)) {
     178                    psWarning("Unable to measure mean variance for image %d --- rejecting.", i);
     179                    psErrorStackPrint(stderr, "Unable to measure mean variance for image %d", i);
     180                    options->inputMask->data.PS_TYPE_VECTOR_MASK_DATA[i] |= PPSTACK_MASK_PSF;
     181                    goto DONE;
     182                } else {
     183                    // Desperate retry
     184                    mean = bg->sampleMean;
     185                }
     186            } else {
     187                // Retry with all available pixels
     188                mean = bg->robustMedian;
     189            }
     190        } else {
     191            // First attempt
     192            mean = bg->robustMedian;
    170193        }
    171194
     
    177200        }
    178201
     202    DONE:
     203        psFree(bg);
    179204        if (!ppStackFilesIterateUp(config)) {
    180205            psFree(rng);
Note: See TracChangeset for help on using the changeset viewer.