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

◆ writetraceheader()

void datrw::oasciistream::writetraceheader ( const unsigned int &  n,
const char *  type 
)
private

Definition at line 174 of file oasciistream.cc.

References DATRW_debug, FOUT, datrw::odatstream::free(), datrw::odatstream::hasfree(), datrw::odatstream::hasinfo(), datrw::odatstream::info(), datrw::ascii::keyauxid, datrw::ascii::keycalib, datrw::ascii::keycalper, datrw::ascii::keychannel, datrw::ascii::keydata, datrw::ascii::keydate, datrw::ascii::keydt, datrw::ascii::keyhang, datrw::ascii::keyinstype, datrw::ascii::keynsamples, datrw::ascii::keynstacks, datrw::ascii::keyRECVCS, datrw::ascii::keyRECVX, datrw::ascii::keyRECVY, datrw::ascii::keyRECVZ, datrw::ascii::keystation, datrw::ascii::keyvang, datrw::odatstream::Mdebug, POUT, and datrw::odatstream::wid2().

Referenced by writetrace().

176  {
177  DATRW_debug(Mdebug, "oasciistream::writetraceheader",
178  "entered function");
179  ::sff::WID2 wid2=this->wid2();
180  wid2.nsamples=n;
181  POUT( ascii::keydate, wid2.date.hierarchicalstring() );
182  POUT( ascii::keydt, wid2.dt );
183  POUT( ascii::keynsamples, wid2.nsamples );
184  POUT( ascii::keystation, wid2.station );
185  POUT( ascii::keychannel, wid2.channel );
186  POUT( ascii::keyauxid, wid2.auxid );
187  POUT( ascii::keyinstype, wid2.instype );
188  POUT( ascii::keycalib, wid2.calib );
189  POUT( ascii::keycalper, wid2.calper );
190  POUT( ascii::keyhang, wid2.hang );
191  POUT( ascii::keyvang, wid2.vang );
192  DATRW_debug(Mdebug, "oasciistream::writetraceheader",
193  "WID2 written");
194  if (this->hasinfo())
195  {
196  ::sff::INFO info=this->info();
197  POUT( ascii::keynstacks, info.nstacks );
198  POUT( ascii::keyRECVX, info.cx );
199  POUT( ascii::keyRECVY, info.cy );
200  POUT( ascii::keyRECVZ, info.cz );
201  POUT( ascii::keyRECVCS, ::sff::coosysID(info.cs) );
202  }
203  DATRW_debug(Mdebug, "oasciistream::writetraceheader",
204  "INFO written if present");
205  if (this->hasfree())
206  {
207  const ::sff::FREE& free=this->free();
208  ::sff::FREE::Tlines::const_iterator I=free.lines.begin();
209  while (I!=free.lines.end())
210  {
211  FOUT( *I );
212  ++I;
213  }
214  }
215  DATRW_debug(Mdebug, "oasciistream::writetraceheader",
216  "trace FREE written if present");
217  POUT( ascii::keydata, type);
218  DATRW_debug(Mdebug, "oasciistream::writetraceheader",
219  "finished");
220  } // void oasciistream::writetraceheader(const unsigned int& n)
const char *const keyinstype
key for WID2 line header field
Definition: ascii.cc:51
bool hasinfo() const
info is available
Definition: datwrite.h:182
const char *const keyRECVY
key for INFO line header field
Definition: ascii.cc:65
sff::WID2 wid2() const
return WID2 data
Definition: datwrite.h:169
const char *const keydt
key for WID2 line header field
Definition: ascii.cc:46
const char *const keyRECVCS
key for INFO line header field
Definition: ascii.cc:67
const char *const keyhang
key for WID2 line header field
Definition: ascii.cc:54
sff::INFO info() const
return SRCE data
Definition: datwrite.h:173
const char *const keycalib
key for WID2 line header field
Definition: ascii.cc:52
const char *const keyauxid
key for WID2 line header field
Definition: ascii.cc:50
const char *const keychannel
key for WID2 line header field
Definition: ascii.cc:49
const char *const keydate
key for WID2 line header field
Definition: ascii.cc:45
const char *const keynstacks
key for INFO line header field
Definition: ascii.cc:68
#define POUT(K, V)
Definition: oasciistream.cc:47
sff::FREE free() const
return FREE data
Definition: datwrite.h:175
const char *const keyRECVX
key for INFO line header field
Definition: ascii.cc:64
const char *const keycalper
key for WID2 line header field
Definition: ascii.cc:53
#define DATRW_debug(C, N, M)
produce debug output
Definition: debug.h:50
bool Mdebug
global debug flag
Definition: datwrite.h:197
const char *const keynsamples
key for WID2 line header field
Definition: ascii.cc:47
const char *const keyRECVZ
key for INFO line header field
Definition: ascii.cc:66
const char *const keyvang
key for WID2 line header field
Definition: ascii.cc:55
#define FOUT(V)
Definition: oasciistream.cc:48
bool hasfree() const
free is available
Definition: datwrite.h:184
const char *const keystation
key for WID2 line header field
Definition: ascii.cc:48
const char *const keydata
key for DATA type header field
Definition: ascii.cc:70
Here is the call graph for this function:
Here is the caller graph for this function: