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

◆ settraceheader()

void datrw::iseifestream::settraceheader ( )
private

Definition at line 59 of file iseifestream.cc.

References datrw::seife::Header::comments(), DATRW_assert_modifiers_are_recognized, datrw::seife::ParameterLine::dt(), datrw::seife::ParameterLine::format(), datrw::idatstream::free(), datrw::idatstream::Mis, Mmodifier, datrw::idatstream::newtrace(), datrw::seife::ParameterLine::nsamples(), datrw::seife::Header::parameters(), datrw::idatstream::settracefree(), datrw::idatstream::setwid2(), datrw::seife::ParameterLine::time(), datrw::Subformat::value(), and datrw::idatstream::wid2().

Referenced by dseries(), fseries(), and skipseries().

60  {
61  this->newtrace();
62  datrw::Subformat subformat(Mmodifier);
63  datrw::seife::Header header(Mis);
64  ::sff::FREE free=header.comments();
65  datrw::seife::ParameterLine pl=header.parameters();
66  free.append("input format: "+pl.format());
67  ::sff::WID2 wid2;
68  wid2.dt=pl.dt();
69  libtime::TAbsoluteTime date(subformat.value("date","2000/1/1"));
70  wid2.date=libtime::TAbsoluteTime(date.year(), date.month(), date.day());
71  wid2.date+=pl.time();
72  wid2.nsamples=pl.nsamples();
73  wid2.station=subformat.value("station","NSP");
74  wid2.channel=subformat.value("channel","NSP");
75  wid2.auxid=subformat.value("auxid","NSP");
76  wid2.instype=subformat.value("instype","NSP");
77  this->settracefree(free);
78  this->setwid2(wid2);
79  // check for unrecognized modifiers since this is the only place where
80  // modifiers are evaluated in this stream
82  "iseifestream::settraceheader()");
83  } // void iseifestream::settraceheader()
seife format header parameter line
Definition: seifeio.h:69
libtime::TRelativeTime time() const
return time of first sample as offset from midnight
Definition: seifeio.h:98
unsigned int nsamples() const
return number of samples
Definition: seifeio.h:92
sff::WID2 wid2() const
Definition: datread.h:111
std::string Mmodifier
format modifier
Definition: seife.h:79
std::istream & Mis
Definition: datread.h:126
void setwid2(const sff::WID2 &wid2)
Definition: datread.cc:113
#define DATRW_assert_modifiers_are_recognized(S, F)
abort if user passed unused modifiers
std::string format() const
return Fortran data format
Definition: seifeio.h:94
sff::FREE free() const
Definition: datread.cc:79
void settracefree(const sff::FREE &free)
Definition: datread.cc:105
double dt() const
return sumpling interval
Definition: seifeio.h:96
class to hold complete seife header
Definition: seifeio.h:132
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.
Here is the call graph for this function:
Here is the caller graph for this function: