734 vector<minMaxStruct> statData(cols.size());
737 const size_t last = limit ?
first + limit : size_t(-1);
741 const size_t row =
GetRow();
745 auto statsIt = statData.begin();
747 for (
auto it=cols.begin(); it!=cols.end(); it++, statsIt++)
749 if ((it->name==
"UnixTimeUTC" || it->name==
"PCTime") && it->first==0 && it->last==1)
751 const uint32_t *val =
reinterpret_cast<const uint32_t*
>(it->ptr);
752 if (fNoZeroPlease && val[0]==0 && val[1]==0)
755 statsIt->add(
Time(val[0], val[1]).Mjd());
759 for (uint32_t
i=it->first; i<=it->last;
i++)
763 if (fNoZeroPlease && cValue == 0)
766 statsIt->add(cValue);
774 auto statsIt = statData.begin();
775 for (
auto it=cols.begin(); it!=cols.end(); it++, statsIt++)
777 fout <<
"\n[" << it->name <<
':' << it->first;
778 if (it->first!=it->last)
779 fout <<
':' << it->last;
782 if (statsIt->numValues == 0)
784 fout <<
"Min: -\nMax: -\nAvg: -\nRms: -" << endl;
788 const long &num = statsIt->numValues;
790 long double &avg = statsIt->average;
791 long double &rms = statsIt->squared;
796 rms = rms<0 ? 0 : sqrt(rms);
798 fout <<
"Min: " << statsIt->min <<
'\n';
799 fout <<
"Max: " << statsIt->max <<
'\n';
800 fout <<
"Avg: " << avg <<
'\n';
801 fout <<
"Rms: " << rms << endl;
Adds some functionality to boost::posix_time::ptime for our needs.
size_t GetNumRows() const
int64_t first
Size of this column in the tile.
double GetDouble(const MyColumn &, size_t) const