diff options
author | William Joye <wjoye@cfa.harvard.edu> | 2017-12-20 19:08:38 (GMT) |
---|---|---|
committer | William Joye <wjoye@cfa.harvard.edu> | 2017-12-20 19:08:38 (GMT) |
commit | 67a5159fd9f5a4b933ce16a02d7a4ec498668332 (patch) | |
tree | f71bb582b80e5b5e8cad3e49427caecf8a91144b /tksao | |
parent | 37ef25027bd92afe32d22d324d65e428d8543eaf (diff) | |
download | blt-67a5159fd9f5a4b933ce16a02d7a4ec498668332.zip blt-67a5159fd9f5a4b933ce16a02d7a4ec498668332.tar.gz blt-67a5159fd9f5a4b933ce16a02d7a4ec498668332.tar.bz2 |
fixed a problem with regions statistics
Diffstat (limited to 'tksao')
-rw-r--r-- | tksao/frame/base.h | 2 | ||||
-rw-r--r-- | tksao/frame/frblt.C | 23 |
2 files changed, 15 insertions, 10 deletions
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' |