35 #define DATRW_HPMO_CC_VERSION \ 41 #include <datrwxx/readhpmo.h> 61 Tbase(is, true, true, false),
62 Mnblocks(0), Mnextblock(0), Mnextchannel(0)
63 { this->
read(is, verbose); }
71 const int nblocks=lastblock-firstblock+1;
75 for (
int iblock=firstblock; iblock<=lastblock; ++iblock)
90 {
return(datrw::util::convert<Tdseries, Tfseries>(this->
dseries())); }
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");
176 const int nblocks=lastblock-firstblock+1;
184 wid2line.station=
"BFO";
185 wid2line.auxid=
"HPMO";
187 std::ostringstream oss;
192 wid2line.channel=oss.str();
193 wid2line.nsamples=nsamp;
196 wid2line.date -= libtime::TRelativeTime(0,0,0,57);
202 << lastblock-firstblock+1 <<
" contiguous minute blocks";
204 tracefree.append(oss.str());
206 lastblock-firstblock+1));
virtual Tdseries dseries()
#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
const double sampling_interval
sampling interval in seconds
aff::Series< float > Tfseries
const int nchannels
number of channels in HP MO data acquisition system
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)
aff::Series< double > Tdseries
static const std::ios_base::openmode openmode
const int nsamples
number of samples per minute block and channel
const bool isbinary
Format properties.
void read(std::istream &is, const bool &verbose=false)
read one data file
void setwid2(const sff::WID2 &wid2)
datrw::hpmo::MinuteBlock Mdatafile[datrw::hpmo::nminutes]
buffer to hold one data file
libtime::TRelativeTime toffset(const int &ichannel)
return time offset for channel ichannel (due to multiplexer)
Root namespace of library.
libtime::TAbsoluteTime Mtime
utilities used by more than one type of data reader (prototypes)
void set_next_header()
set header for next request
void settracefree(const sff::FREE &free)
Tvecofblocks readfile(std::istream &is, const bool &verbose)
read a full data file
provide data from HP Mo (BFO data acquisition system) (prototypes)
const char *const streamID
Format properties.
virtual void skipseries()
virtual Tfseries fseries()
int Mindex[datrw::hpmo::nminutes]
ihpmostream(std::istream &is, const bool &verbose=false)
const int nminutes
number of minute blocks per file (1h)