IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changes between Initial Version and Version 1 of psVectorStats_ErrorHandling


Ignore:
Timestamp:
Apr 28, 2009, 10:47:33 AM (17 years ago)
Author:
eugene
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • psVectorStats_ErrorHandling

    v1 v1  
     1Return to [wiki:Software_Development Software Development Page]
     2
     3psVectorStats traditionally raised a psError for cases where the input data simply resulted in an invalid statistic.  For example, if all input data points were masked or if the vector length was 0 (or in some cases 1).  Since IPP programs bail out if any errors were not handled, this ended up in lots of places where psErrorClear was used gratuitously to hide problems.
     4
     5I've changed the handling of psVectorStats to raise an error only in cases of serious programming or resource problems: unexpected NULL vectors, unallowed vector types, and so forth.  In cases where valid vectors are supplied (even if zero length),  a result of NAN is perfectly acceptable, and now does not raise an error. 
     6
     7I've also gone through all of the instances where psVectorStats is called and have added code to handle 'false' return status, and where possible to handle a NAN result as well.  Not all of these were immediately obvious, so at the bottom of this page I have a list of the files for which more work to handle the NANs could be added.
     8
     9There are a couple of unclear choices in the programming remaining: currently, any stats function which successfully calculates a non-NAN result raises its bit(s) in the psStats->result field.  These could be raised even if a NAN is calculated.  Also, it might be useful to have a bit somewhere that implies that the stats calculation failed: ie, it did not produce finite results for all of the desired output fields.
     10
     11{{{
     12psModules/src/objects/pmGrowthCurveGenerate.c -- XXX does a poor job of handling NANs
     13psModules/src/objects/pmPSFtry.c -- XXX does a poor job of handling NANs
     14ppMerge/src/ppMergeMask.c -- XXX results are not handled well
     15ppStats/src/ppStatsReadout.c -- XXX results are not handled well
     16psLib/src/imageops/psImageBackground.c -- XXX results are not handled well
     17psLib/src/imageops/psImageGeomManip.c -- XXX results are not handled well
     18psLib/src/imageops/psImageMap.c -- XXX results are not handled well
     19psLib/src/imageops/psImageMapFit.c -- XXX results are not handled well
     20psLib/src/imageops/psImagePixelExtract.c -- XXX results are not handled well
     21psLib/src/imageops/psImageStats.c -- XXX results are not handled well
     22psLib/src/math/psClip.c -- XXX results are not handled well
     23psLib/src/math/psMinimizePolyFit.c -- XXX results are not handled well
     24psLib/src/math/psPolynomialUtils.c -- XXX results are not handled well
     25psModules/src/astrom/pmAstrometryDistortion.c -- XXX results are not handled well
     26psModules/src/camera/pmFPAMaskWeight.c -- XXX results are not handled well
     27psModules/src/detrend/pmFringeStats.c -- XXX results are not handled well
     28psModules/src/detrend/pmOverscan.c -- XXX results are not handled well
     29}}}
     30
     31{{{
     32ppImage/src/ppImageMeasureCrosstalk.c -- NAN results are data
     33ppStats/src/ppStatsFromMetadataStats.c -- NAN results are data
     34psastro/src/psastroAstromGuess.c -- NAN results are data
     35psastro/src/psastroFixChipsTest.c -- NAN results are data
     36psastro/src/psastroModelAnalysis.c -- NAN results are data
     37psastro/src/psastroModelFitBoresite.c -- NAN results are data
     38psastro/src/psastroZeroPoint.c -- NAN results are data
     39psModules/src/concepts/pmConceptsStandard.c -- NAN results are data
     40psModules/src/objects/pmSource.c -- NAN results are data
     41psphot/src/psphotApResid.c -- NAN results are data
     42psphot/src/psphotChoosePSF.c -- NAN results are data
     43psphot/src/psphotDiagnosticPlots.c -- NAN results are data
     44psphot/src/psphotImageQuality.c -- NAN results are data
     45}}}
     46
     47{{{
     48psModules/src/detrend/pmRemnance.c -- results are checked
     49psModules/src/detrend/pmShutterCorrection.c -- results are checked
     50psModules/src/extras/pmVisual.c -- results are checked
     51psModules/src/imcombine/pmImageCombine.c -- results are checked
     52psModules/src/imcombine/pmReadoutCombine.c -- results are checked
     53psModules/src/imcombine/pmSubtraction.c -- results are checked
     54psModules/src/imcombine/pmSubtractionMatch.c -- results are checked
     55psphot/src/psphotMakeResiduals.c -- results checked
     56psModules/src/objects/pmSourceMatch.c -- results checked (could handle nan better)
     57psModules/src/detrend/pmSkySubtract.c -- unused code
     58psModules/src/objects/models/pmModel_SGAUSS.c -- unused code
     59}}}