| | 1 | Return to [wiki:Software_Development Software Development Page] |
| | 2 | |
| | 3 | psVectorStats 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 | |
| | 5 | I'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 | |
| | 7 | I'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 | |
| | 9 | There 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 | {{{ |
| | 12 | psModules/src/objects/pmGrowthCurveGenerate.c -- XXX does a poor job of handling NANs |
| | 13 | psModules/src/objects/pmPSFtry.c -- XXX does a poor job of handling NANs |
| | 14 | ppMerge/src/ppMergeMask.c -- XXX results are not handled well |
| | 15 | ppStats/src/ppStatsReadout.c -- XXX results are not handled well |
| | 16 | psLib/src/imageops/psImageBackground.c -- XXX results are not handled well |
| | 17 | psLib/src/imageops/psImageGeomManip.c -- XXX results are not handled well |
| | 18 | psLib/src/imageops/psImageMap.c -- XXX results are not handled well |
| | 19 | psLib/src/imageops/psImageMapFit.c -- XXX results are not handled well |
| | 20 | psLib/src/imageops/psImagePixelExtract.c -- XXX results are not handled well |
| | 21 | psLib/src/imageops/psImageStats.c -- XXX results are not handled well |
| | 22 | psLib/src/math/psClip.c -- XXX results are not handled well |
| | 23 | psLib/src/math/psMinimizePolyFit.c -- XXX results are not handled well |
| | 24 | psLib/src/math/psPolynomialUtils.c -- XXX results are not handled well |
| | 25 | psModules/src/astrom/pmAstrometryDistortion.c -- XXX results are not handled well |
| | 26 | psModules/src/camera/pmFPAMaskWeight.c -- XXX results are not handled well |
| | 27 | psModules/src/detrend/pmFringeStats.c -- XXX results are not handled well |
| | 28 | psModules/src/detrend/pmOverscan.c -- XXX results are not handled well |
| | 29 | }}} |
| | 30 | |
| | 31 | {{{ |
| | 32 | ppImage/src/ppImageMeasureCrosstalk.c -- NAN results are data |
| | 33 | ppStats/src/ppStatsFromMetadataStats.c -- NAN results are data |
| | 34 | psastro/src/psastroAstromGuess.c -- NAN results are data |
| | 35 | psastro/src/psastroFixChipsTest.c -- NAN results are data |
| | 36 | psastro/src/psastroModelAnalysis.c -- NAN results are data |
| | 37 | psastro/src/psastroModelFitBoresite.c -- NAN results are data |
| | 38 | psastro/src/psastroZeroPoint.c -- NAN results are data |
| | 39 | psModules/src/concepts/pmConceptsStandard.c -- NAN results are data |
| | 40 | psModules/src/objects/pmSource.c -- NAN results are data |
| | 41 | psphot/src/psphotApResid.c -- NAN results are data |
| | 42 | psphot/src/psphotChoosePSF.c -- NAN results are data |
| | 43 | psphot/src/psphotDiagnosticPlots.c -- NAN results are data |
| | 44 | psphot/src/psphotImageQuality.c -- NAN results are data |
| | 45 | }}} |
| | 46 | |
| | 47 | {{{ |
| | 48 | psModules/src/detrend/pmRemnance.c -- results are checked |
| | 49 | psModules/src/detrend/pmShutterCorrection.c -- results are checked |
| | 50 | psModules/src/extras/pmVisual.c -- results are checked |
| | 51 | psModules/src/imcombine/pmImageCombine.c -- results are checked |
| | 52 | psModules/src/imcombine/pmReadoutCombine.c -- results are checked |
| | 53 | psModules/src/imcombine/pmSubtraction.c -- results are checked |
| | 54 | psModules/src/imcombine/pmSubtractionMatch.c -- results are checked |
| | 55 | psphot/src/psphotMakeResiduals.c -- results checked |
| | 56 | psModules/src/objects/pmSourceMatch.c -- results checked (could handle nan better) |
| | 57 | psModules/src/detrend/pmSkySubtract.c -- unused code |
| | 58 | psModules/src/objects/models/pmModel_SGAUSS.c -- unused code |
| | 59 | }}} |