107 std::cout <<
"(ihpmostream::read): read " 108 << blocks.size() <<
" blocks of data" << std::endl;
110 int nblocksread=blocks.size();
112 "ERROR (ihpmostream::read): " 113 "illegal number of minute blocks in file!" "\n" 114 " Use ihpmostream only together with original HPMO data");
116 if (verbose) { std::cout <<
"(ihpmostream::read): copy block #"; }
118 for (
int iblock=0; iblock<nblocksread; iblock++)
130 std::cout << std::endl
131 <<
"(ihpmostream::read): found gap" << std::endl;
132 std::cout <<
" between block # " << iblock-1 <<
" @ " 133 << prevblock.
Mtime.timestring() << std::endl;
134 std::cout <<
" and block # " << iblock <<
" @ " 135 << block.
Mtime.timestring() << std::endl;
136 std::cout <<
"(ihpmostream::read): copy block #";
145 if (verbose) { std::cout <<
" " << iblock; }
149 std::cout << std::endl;
150 std::cout <<
"(ihpmostream::read): extracted " 151 <<
Mnblocks <<
" contiguous data block(s)" << std::endl;
159 std::ostringstream oss;
162 filefree.append(
"ihpmostream read " + oss.str() +
" blocks from file");
165 filefree.append(
"found " + oss.str() +
" contiguous sets of blocks");
#define DATRW_assert(C, M)
Check an assertion and report by throwing an exception.
sff::FREE qualityreports(const MinuteBlock *blocks, const int &nblocks)
prepare a report on unusual quality reports
void setfilefree(const sff::FREE &free)
std::vector< MinuteBlock > Tvecofblocks
within the inner reading functions, we use vector to hold minute blocks
libtime::TRelativeTime dt()
return sampling interval of HPMO data acquisition (i.e. 5 sec)
const int nsamples
number of samples per minute block and channel
datrw::hpmo::MinuteBlock Mdatafile[datrw::hpmo::nminutes]
buffer to hold one data file
libtime::TAbsoluteTime Mtime
Tvecofblocks readfile(std::istream &is, const bool &verbose)
read a full data file
int Mindex[datrw::hpmo::nminutes]
const int nminutes
number of minute blocks per file (1h)