IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 10277


Ignore:
Timestamp:
Nov 29, 2006, 8:05:18 AM (20 years ago)
Author:
rhl
Message:

Handle failures in psImageBackground. This isn't a good dix as it's silent, but it's better than nowt

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psphot/src/psphotImageMedian.c

    r10172 r10277  
    116116
    117117            // XXX the value of the upper and lower cuts probably should be studied...
    118             psStats *stats = psImageBackground(subset, submask, 0xff, 0.25, 0.75, MAX_SAMPLE_PIXELS, statsOption, rng);
     118            psStats *stats = psImageBackground(subset, submask, 0xff, 0.25, 0.75, MAX_SAMPLE_PIXELS,
     119                                               statsOption, rng);
     120            if (stats == NULL) {
     121                stats = psImageBackground(subset, submask, 0xff, 0.25, 0.75, MAX_SAMPLE_PIXELS,
     122                                          PS_STAT_ROBUST_MEDIAN, rng);
     123                if (stats == NULL) {
     124                    psAbort(PS_FILE_LINE, "Failed to estimate background using ROBUST_MEDIAN for "
     125                            "(%dx%d, (row0,col0) = (%d,%d)",
     126                            subset->numRows, subset->numCols, subset->row0, subset->col0);
     127                }
     128            }
    119129            if (stats->options & PS_STAT_ROBUST_QUARTILE) {
    120130                modelData[iy][ix] = stats->robustMedian + SKY_BIAS;
Note: See TracChangeset for help on using the changeset viewer.