SFF++ library: reading and writing SFF from C++

◆ WIDXline() [2/2]

sff::WID2 sff::WIDXline ( const std::string &  line)

read WID2 information with extended format

read WID information from extended format.

See also
WIDXline(const sff::WID2& wid2)

Definition at line 199 of file widXio.cc.

References sff::WID2::auxid, sff::WID2::calib, sff::WID2::calper, sff::WID2::channel, sff::WID2::date, sff::WID2::dt, sff::WID2::hang, sff::WID2::instype, sff::WID2::nsamples, SFF_assert, sff::WID2::station, sff::WID2::vang, and WIDXID.

200  {
201  sff::WID2 retval;
202  SFF_assert(line.substr(0,4) == WIDXID,
203  "wrong line ID");
204  retval.date=libtime::TAbsoluteTime(line.substr(5,26));
205  retval.station=line.substr(32,5);
206  retval.channel=line.substr(38,3);
207  retval.auxid=line.substr(42,4);
208  retval.instype=line.substr(47,6);
209  std::istringstream is(line.substr(54));
210  is >> retval.nsamples;
211  std::string type;
212  is >> type;
213  is >> retval.dt;
214  if (type == "r") { retval.dt = 1./retval.dt; }
215  is >> retval.calib;
216  is >> retval.calper;
217  is >> retval.hang;
218  is >> retval.vang;
219  return(retval);
220  } // sff::WID2 WIDXline(const std::string& line)
std::string auxid
Auxiliary identification code.
Definition: sffxx.h:218
double calper
calibration reference period
Definition: sffxx.h:222
std::string station
Station code.
Definition: sffxx.h:216
std::string instype
instrument type
Definition: sffxx.h:223
std::string channel
FDSN channel code.
Definition: sffxx.h:217
int nsamples
number of samples
Definition: sffxx.h:219
libtime::TAbsoluteTime date
time of first sample
Definition: sffxx.h:215
#define SFF_assert(C, M)
check condition
Definition: sffxx.h:82
double calib
calibration factor
Definition: sffxx.h:221
const char *const WIDXID
ID for extended WID2 format.
Definition: sffxx.h:132
Waveform Header.
Definition: sffxx.h:209
double vang
veritcal orientation
Definition: sffxx.h:225
double dt
sampling interval (sec)
Definition: sffxx.h:220
double hang
horizontal orientation
Definition: sffxx.h:224