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

◆ readheader()

void datrw::ipdasstream::readheader ( )
private

Definition at line 116 of file ipdasstream.cc.

References datrw::pdas::Header::dataset, datrw::pdas::Header::date, datrw::pdas::Header::interval, datrw::pdas::Header::lines, datrw::idatstream::Mis, Mtype, datrw::idatstream::newtrace(), datrw::pdas::readheader(), datrw::idatstream::setlast(), datrw::idatstream::settracefree(), datrw::idatstream::setwid2(), datrw::pdas::Header::signal, datrw::pdas::Header::time, datrw::pdas::Header::type, and datrw::idatstream::wid2().

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

117  {
118  this->newtrace();
119  sff::WID2 wid2;
120  sff::FREE tracefree;
122  std::copy(hd.lines.begin(), hd.lines.end(),
123  std::back_inserter(tracefree.lines));
124  wid2.station=hd.dataset.substr(2,3);
125  wid2.channel=hd.dataset.substr(0,2);
126  wid2.auxid=hd.signal;
127  int ipday=hd.date.find('-');
128  int ipyear=hd.date.find('-',1+ipday);
129  std::string datestring=hd.date.substr(1+ipyear)
130  + '/' + hd.date.substr(0,ipday)
131  + '/' + hd.date.substr(1+ipday,ipyear-ipday-1);
132  int ipspace=hd.time.find(' ');
133  datestring += '_' + hd.time.substr(0,ipspace);
134  wid2.date=libtime::TAbsoluteTime(datestring.c_str());
135  wid2.dt=std::atof(hd.interval.c_str());
136  Mtype=hd.type;
137  this->settracefree(tracefree);
138  this->setwid2(wid2);
139  this->setlast();
140  }
std::string interval
Definition: pdasread.h:69
sff::WID2 wid2() const
Definition: datread.h:111
std::istream & Mis
Definition: datread.h:126
void setwid2(const sff::WID2 &wid2)
Definition: datread.cc:113
std::string signal
Definition: pdasread.h:69
pdas::Etype Mtype
Definition: pdas.h:79
std::string time
Definition: pdasread.h:69
std::vector< std::string > lines
Definition: pdasread.h:72
std::string dataset
Definition: pdasread.h:69
void settracefree(const sff::FREE &free)
Definition: datread.cc:105
struct to hold complete header
Definition: pdasread.h:68
Header readheader(std::istream &is, const bool &verbose)
function to read the file header
Definition: pdasread.cc:82
std::string date
Definition: pdasread.h:69
Here is the call graph for this function:
Here is the caller graph for this function: