read file
read next trace from file.
All reading is controlled within this function...
File reading always is one record ahead. The record being read in advance is stored in member field imseedstream::Mrecord. This type of operation is necessary, since data data contiguity can only be checked after the next record has been read. If this record is not contiguous, it must be stored for the next read request, where it will provide the first samples of the next trace.
Reading is done as follows:
- Data records are read from input as long as the next record read is contiguous to the previous one. They are intermediately stored in a vector.
- After having read all contiguous records, the total number of samples in the trace is established and data samples can be collected in a series container.
Definition at line 194 of file imseedstream.cc.
References datrw::mseed::key::data, datrw::mseed::Record::data, DATRW_assert, DATRW_debug, datrw::hpmo::dt(), Mchecks, datrw::idatstream::Mdebug, Mdumpascii, MestimateNframes, datrw::idatstream::Mis, Mrecord, Mttolerance, datrw::hpmo::nsamples, datrw::mseed::Record::read(), datrw::idatstream::setlast(), datrw::idatstream::setwid2(), datrw::mseed::Record::valid, datrw::mseed::Record::wid2, and datrw::mseed::Record::xm1.
Referenced by dseries(), fseries(), iseries(), and skipseries().
199 typedef std::vector<Tiseries> Tvecofrecorddata;
200 Tvecofrecorddata vecofrecorddata;
206 "invalid record; passed end of file?");
214 libtime::TRelativeTime
dt=libtime::double2time(wid2line.dt);
219 sff::WID2compare wid2areequal(sff::Fdate
230 wid2areequal.setdatetolerance(this->
Mttolerance*1.e-6/wid2line.dt);
240 sff::WID2 nextwid2=wid2line;
243 bool contiguous=
true;
248 "save data from record (" 252 if (!skipdata) { vecofrecorddata.push_back(
data.copyout()); }
303 Tvecofrecorddata::const_iterator I(vecofrecorddata.begin());
308 while (I != vecofrecorddata.end())
bool Mdumpascii
dump ASCII data if true
#define DATRW_assert(C, M)
Check an assertion and report by throwing an exception.
datrw::mseed::Record Mrecord
data read ahead
datrw::mseed::ConsistencyChecks Mchecks
libtime::TRelativeTime dt()
return sampling interval of HPMO data acquisition (i.e. 5 sec)
void read(std::istream &is, const bool &dumpascii=false, const bool &estimateNframes=false, const ConsistencyChecks &checks=ConsistencyChecks(true, true))
read and decode a record to SFF
const int nsamples
number of samples per minute block and channel
void setwid2(const sff::WID2 &wid2)
const char *const data
keywords for consistency checks
bool MestimateNframes
estimate frame count flags controlling consistency checks
double Mttolerance
timing tolerance in microseconds
aff::Series< int > Tiseries
#define DATRW_debug(C, N, M)
produce debug output