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

◆ writetraceheader()

void datrw::oseifestream::writetraceheader ( const unsigned int &  n)
private

Definition at line 95 of file oseifestream.cc.

References DATRW_report_assert, datrw::seife::ParameterLine::dt(), datrw::seife::ParameterLine::format(), datrw::odatstream::free(), datrw::odatstream::hasfree(), datrw::odatstream::Mos, Mtracewritten, datrw::seife::ParameterLine::nsamples(), datrw::seife::seife_standard_format, datrw::seife::Header::set(), datrw::seife::ParameterLine::time(), datrw::odatstream::wid2(), and datrw::seife::Header::write().

Referenced by writetrace().

96  {
98  "WARNING in (oseifestream::writetraceheader):\n"
99  "More than one trace will be written to the same "
100  "seife file!\n"
101  "seife format only supports single trace files.\n");
102  datrw::seife::Header header;
103  datrw::seife::ParameterLine parameters;
104  if (this->hasfree()) { header.set(this->free()); }
105  ::sff::WID2 wid2=this->wid2();
106  libtime::TAbsoluteTime theday(wid2.date.year(), wid2.date.month(),
107  wid2.date.day());
108  parameters.time(wid2.date-theday);
109  parameters.dt(wid2.dt);
110  parameters.nsamples(n);
112  header.set(parameters);
113  header.write(this->Mos);
114  this->Mtracewritten=true;
115  } // void oseifestream::writetraceheader(const unsigned int& n)
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
const char *const seife_standard_format
Definition: seifeio.cc:47
sff::WID2 wid2() const
return WID2 data
Definition: datwrite.h:169
std::ostream & Mos
output stream to be used by this class
Definition: datwrite.h:194
bool Mtracewritten
true, if a trace has be written
Definition: seife.h:103
void set(const ::sff::FREE &free)
set comments
Definition: seifeio.h:149
std::string format() const
return Fortran data format
Definition: seifeio.h:94
sff::FREE free() const
return FREE data
Definition: datwrite.h:175
void write(std::ostream &os) const
! write header to stream
Definition: seifeio.cc:163
double dt() const
return sumpling interval
Definition: seifeio.h:96
class to hold complete seife header
Definition: seifeio.h:132
bool hasfree() const
free is available
Definition: datwrite.h:184
#define DATRW_report_assert(C, M)
Check an assertion and report only.
Definition: error.h:120
Here is the call graph for this function:
Here is the caller graph for this function: