IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 1, 2007, 3:50:32 PM (19 years ago)
Author:
Paul Price
Message:

Ignore errors in psVectorStats.

File:
1 edited

Legend:

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

    r14355 r15433  
    315315            // Combination
    316316            if (!psVectorStats(stats, pixels, errors, mask, 1)) {
    317                 psError(PS_ERR_UNKNOWN, false, "Error in statistics.");
    318                 psFree(index);
    319                 psFree(pixels);
    320                 psFree(mask);
    321                 psFree(weights);
    322                 psFree(errors);
    323                 psFree(stats);
    324                 psFree(invScale);
    325                 return false;
    326             }
    327 
    328             outputImage[yOut][xOut] = psStatsGetValue(stats, params->combine);
    329             if (!isfinite(outputImage[yOut][xOut])) {
     317                // Can't do much about it, but it's not worth worrying about
     318                psErrorClear();
     319                outputImage[yOut][xOut] = NAN;
    330320                outputMask[yOut][xOut] = params->blank;
    331             }
    332             if (params->weights) {
    333                 float stdev = psStatsGetValue(stats, combineStdev);
    334                 outputWeight[yOut][xOut] = PS_SQR(stdev); // Variance
    335                 // XXXX this is not the correct formal error.
    336                 // also, the weighted mean is not obviously the correct thing here
     321                if (params->weights) {
     322                    outputWeight[yOut][xOut] = NAN;
     323                }
     324            } else {
     325                outputImage[yOut][xOut] = psStatsGetValue(stats, params->combine);
     326                if (!isfinite(outputImage[yOut][xOut])) {
     327                    outputMask[yOut][xOut] = params->blank;
     328                }
     329                if (params->weights) {
     330                    float stdev = psStatsGetValue(stats, combineStdev);
     331                    outputWeight[yOut][xOut] = PS_SQR(stdev); // Variance
     332                    // XXXX this is not the correct formal error.
     333                    // also, the weighted mean is not obviously the correct thing here
     334                }
    337335            }
    338336        }
Note: See TracChangeset for help on using the changeset viewer.