From 67a5159fd9f5a4b933ce16a02d7a4ec498668332 Mon Sep 17 00:00:00 2001 From: William Joye Date: Wed, 20 Dec 2017 14:08:38 -0500 Subject: fixed a problem with regions statistics --- ds9/doc/release/r7.6.html | 1 + tksao/frame/base.h | 2 +- tksao/frame/frblt.C | 23 ++++++++++++++--------- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/ds9/doc/release/r7.6.html b/ds9/doc/release/r7.6.html index 2884cd0..ece9fa0 100644 --- a/ds9/doc/release/r7.6.html +++ b/ds9/doc/release/r7.6.html @@ -158,6 +158,7 @@
  • 11.27.2017 MMT: updated Binospec template.
  • 11.27.2017 REGION: fixed an issue where region templates are rendered incorrectly in the case where the WCS RA and DEC axes have been flipped in the definition.
  • 12.08.2017 AST: updated to version 8.4.0.
  • +
  • 12.20.2017 REGION: fixed a problem with regions statistics. VAR (and STDDEV) were overflowing with large counts.
  • xx.xx.2017 RELEASE version 7.6rc1
  • diff --git a/tksao/frame/base.h b/tksao/frame/base.h index 1a93c38..79184b8 100644 --- a/tksao/frame/base.h +++ b/tksao/frame/base.h @@ -403,7 +403,7 @@ public: void markerAnalysisStats2(FitsImage*, ostream&, Coord::CoordSystem, int, int, double, int); void markerAnalysisStats3(ostream&); - void markerAnalysisStats4(ostream&, int, int, double, double, + void markerAnalysisStats4(ostream&, int, double, double, double, double, double, double); void markerAnalysisStats(Marker*, ostream&, const BBox&, Coord::CoordSystem, Coord::SkyFrame); diff --git a/tksao/frame/frblt.C b/tksao/frame/frblt.C index 233177f..7cf0844 100644 --- a/tksao/frame/frblt.C +++ b/tksao/frame/frblt.C @@ -823,11 +823,11 @@ int Base::markerAnalysisStats1(Marker* pp,FitsImage* ptr, ostream& str, case Coord::DETECTOR: case Coord::AMPLIFIER: str << endl; - str << "reg\t" << "sum\t" << "error\t\t" + str << "reg\t" << "sum\t\t" << "error\t" << "area\t\t" << "surf_bri\t\t" << "surf_err" << endl << "\t" << "\t" << "\t\t" << "(pix**2)\t\t" << "(sum/pix**2)\t\t" << "(sum/pix**2)" << endl - << "---\t" << "---\t" << "-----\t\t" + << "---\t" << "---\t\t" << "-----\t" << "--------\t\t" << "------------\t\t" << "------------" << endl; return 0; default: @@ -841,22 +841,22 @@ int Base::markerAnalysisStats1(Marker* pp,FitsImage* ptr, ostream& str, if (ptr->hasWCSCel(sys)) { str << "1 pixel = "<< ll*60*60 << " arcsec"; str << endl << endl; - str << "reg\t" << "sum\t" << "error\t\t" + str << "reg\t" << "sum\t\t" << "error\t" << "area\t\t" << "surf_bri\t\t" << "surf_err" << endl << "\t" << "\t" << "\t\t" << "(arcsec**2)\t\t" << "(sum/arcsec**2)\t" << "(sum/arcsec**2)" << endl - << "---\t" << "---\t" << "-----\t\t" + << "---\t" << "---\t\t" << "-----\t" << "-----------\t\t" << "---------------\t" << "---------------" << endl; return 1; } else { str << "1 pixel = "<< ll; str << endl << endl; - str << "reg\t" << "sum\t" << "error\t\t" + str << "reg\t" << "sum\t\t" << "error\t" << "area\t\t" << "surf_bri\t\t" << "surf_err" << endl << "\t" << "\t" << "\t\t" << "(pix**2)\t\t" << "(sum/pix**2)\t\t" << "(sum/pix**2)" << endl - << "---\t" << "---\t" << "-----\t\t" + << "---\t" << "---\t\t" << "-----\t" << "--------\t\t" << "------------\t\t" << "------------" << endl; return 2; } @@ -905,8 +905,10 @@ void Base::markerAnalysisStats2(FitsImage* ptr, ostream& str, double brierr = err/area; str << kk+1 << '\t' - << sum << '\t' - << err << "\t\t" + << setprecision(8) + << sum << "\t\t" + << setprecision(6) + << err << "\t" << area << "\t\t" << bri << "\t\t" << brierr << endl; @@ -922,9 +924,10 @@ void Base::markerAnalysisStats3(ostream& str) } void Base::markerAnalysisStats4(ostream& str, int kk, - int cnt, double sum, double sum2, + double cnt, double sum, double sum2, double median, double min, double max) { + // up cast int cnt to double to avoid int overflow double mean =0; double std =0; double var =0; @@ -937,8 +940,10 @@ void Base::markerAnalysisStats4(ostream& str, int kk, } str << kk+1 << '\t' + << setprecision(8) << sum << '\t' << cnt << '\t' + << setprecision(6) << mean << '\t' << median << '\t' << min << '\t' -- cgit v0.12