DATRW++ library: seismic data I/O with multiple formats

◆ imseedstream()

datrw::imseedstream::imseedstream ( std::istream &  is,
const std::string &  modifier = "",
const bool &  debug = false 
)

Definition at line 90 of file imseedstream.cc.

References datrw::mseed::key::all, datrw::mseed::key::data, datrw::mseed::ConsistencyChecks::data, DATRW_assert_modifiers_are_recognized, DATRW_debug, datrw::mseed::ConsistencyCheckControl::docheck, datrw::mseed::key::dumpascii, datrw::mseed::key::estimateNframes, datrw::mseed::ConsistencyCheckControl::fatal, datrw::Subformat::isset(), Mchecks, datrw::idatstream::Mdebug, Mdumpascii, MestimateNframes, datrw::idatstream::Mis, Mmodifier, Mrecord, Mttolerance, datrw::mseed::key::nframes, datrw::mseed::ConsistencyChecks::nframes, datrw::mseed::key::nonfatal, datrw::mseed::key::nsamples, datrw::mseed::ConsistencyChecks::nsamples, datrw::mseed::Record::read(), datrw::mseed::key::skipcheck, datrw::mseed::key::ttolerance, datrw::mseed::key::usec, datrw::mseed::ConsistencyChecks::usec, datrw::Subformat::value(), and datrw::mseed::Record::wid2.

92  :
93  Tbase(is, true, true, true, debug), Mmodifier(modifier),
94  Mdumpascii(false), Mchecks(true, true)
95  {
96  datrw::Subformat subformat(Mmodifier);
97  Mdumpascii=subformat.isset(mseed::key::dumpascii);
98  subformat(mseed::key::ttolerance, "0.") >> this->Mttolerance;
100 
101  // note: flags have opposite meaning compared to subformat flags
102  if (subformat.isset(mseed::key::nonfatal))
103  {
104  std::string checks=subformat.value(mseed::key::nonfatal);
105  bool all=(checks.find(mseed::key::all)!=std::string::npos);
107  =!(all||(checks.find(mseed::key::nframes)!=std::string::npos));
109  =!(all||(checks.find(mseed::key::nsamples)!=std::string::npos));
111  =!(all||(checks.find(mseed::key::data)!=std::string::npos));
113  =!(all||(checks.find(mseed::key::usec)!=std::string::npos));
114  }
115 
116  // note: flags have opposite meaning compared to subformat flags
117  if (subformat.isset(mseed::key::skipcheck))
118  {
119  std::string checks=subformat.value(mseed::key::skipcheck);
120  bool all=(checks.find(mseed::key::all)!=std::string::npos);
122  =!(all||(checks.find(mseed::key::nframes)!=std::string::npos));
124  =!(all||(checks.find(mseed::key::nsamples)!=std::string::npos));
126  =!(all||(checks.find(mseed::key::data)!=std::string::npos));
128  =!(all||(checks.find(mseed::key::usec)!=std::string::npos));
129  }
130 
132  "imseedstream::imseedstream()");
133 
134  /* We must always be one record in advance. Data reading will be done by
135  * concatenating several MiniSEED records. A time series will be
136  * terminated after reading a noncontiguous MiniSEED record. We have to
137  * store this record after reading and thus must always be one record
138  * ahead.
139  */
141  DATRW_debug(Mdebug, "Mrecord read", Mrecord.wid2.line());
142  } // imseedstream::imseedstream(std::istream& is, const bool& debug)
bool Mdumpascii
dump ASCII data if true
Definition: mseed.h:182
bool fatal
Consequences of check.
Definition: mseed.h:77
const char *const usec
keywords for consistency checks
ConsistencyCheckControl nsamples
Check for consistent number of samples.
Definition: mseed.h:106
ConsistencyCheckControl data
Check for consistent data values.
Definition: mseed.h:121
datrw::mseed::Record Mrecord
data read ahead
Definition: mseed.h:180
idatstream Tbase
Definition: mseed.h:165
datrw::mseed::ConsistencyChecks Mchecks
Definition: mseed.h:186
const char *const nframes
keywords for consistency checks
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 char *const ttolerance
keywords for format modifiers
ConsistencyCheckControl usec
Check for usec field being in specified range.
Definition: mseed.h:134
std::istream & Mis
Definition: datread.h:126
#define DATRW_assert_modifiers_are_recognized(S, F)
abort if user passed unused modifiers
const char *const data
keywords for consistency checks
const char *const dumpascii
keywords for format modifiers
bool debug()
indicate debug mode
Definition: datread.h:116
::sff::WID2 wid2
Definition: mseed.h:144
bool MestimateNframes
estimate frame count flags controlling consistency checks
Definition: mseed.h:184
bool docheck
Activation of check.
Definition: mseed.h:72
const char *const skipcheck
keywords for format modifiers
double Mttolerance
timing tolerance in microseconds
Definition: mseed.h:183
#define DATRW_debug(C, N, M)
produce debug output
Definition: debug.h:50
Class to handle format modifiersThis class is used to parse a format modifier string. Detailed instructions will be given upon request. For some hints have a look at tests/libdatrwxxtests.c.
const char *const all
keywords for consistency checks
std::string Mmodifier
format modifier
Definition: mseed.h:181
const char *const nsamples
number of samples per minute block and channel
const char *const estimateNframes
keywords for format modifiers
ConsistencyCheckControl nframes
Check for consistent number of frames.
Definition: mseed.h:98
const char *const nonfatal
keywords for format modifiers
Here is the call graph for this function: