Changeset 17166 for trunk/FACT++
- Timestamp:
- 09/15/13 22:08:28 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/fitsdump.cc
r17147 r17166 764 764 765 765 avg /= num; 766 rms = sqrt(rms/num - avg*avg); 766 rms /= num; 767 rms += avg*avg; 768 rms = rms<0 ? 0 : sqrt(rms); 767 769 768 770 fout << "Min: " << statsIt->min << '\n'; … … 805 807 806 808 avg /= numElems; 807 rms = sqrt(rms/numElems - avg*avg); 809 rms /= numElems; 810 rms -= avg*avg; 811 rms = rms<0 ? 0 : sqrt(rms); 812 808 813 809 814 out << "Avg: " << avg << '\n'; 810 815 out << "Rms: " << rms << endl; 811 812 816 } 813 817 … … 823 827 vector<vector<char>> statData; 824 828 825 const size_t num= limit==0 || GetNumRows()<limit ? GetNumRows() : limit;829 const size_t rows = limit==0 || GetNumRows()<limit ? GetNumRows() : limit; 826 830 827 831 for (auto it=cols.begin(); it!=cols.end(); it++) 828 statData.emplace_back(vector<char>(it->col.size*num*(it->last-it->first+1))); 829 830 #ifdef HAVE_ROOT 832 statData.emplace_back(vector<char>(it->col.size*rows*(it->last-it->first+1))); 833 834 #ifdef HAVE_ROOT 835 size_t num = 0; 836 for (auto it=cols.begin(); it!=cols.end(); it++) 837 num += it->last-it->first+1; 838 831 839 vector<Double_t> data(num+1); 832 840 #endif … … 1099 1107 ("%,%", vars<string>(), "Format for the output (currently not available in root-mode)") 1100 1108 ("force", po_switch(), "Force reading the fits file even if END key is missing") 1101 ("first", var<size_t>( 0),"First number of row to read")1102 ("limit", var<size_t>( 0),"Limit for the maximum number of rows to read (0=unlimited)")1109 ("first", var<size_t>(size_t(0)), "First number of row to read") 1110 ("limit", var<size_t>(size_t(0)), "Limit for the maximum number of rows to read (0=unlimited)") 1103 1111 ("tablename,t", var<string>(""), "Name of the table to open. If not specified, first binary table is opened") 1104 1112 #ifdef HAVE_ROOT
Note:
See TracChangeset
for help on using the changeset viewer.