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

◆ line()

std::string datrw::seife::ParameterLine::line ( ) const

create line for output from values

Definition at line 112 of file seifeio.cc.

References Mdt, Mformat, Mnsamples, Mtime, and datrw::util::ntrailingdigits().

Referenced by main(), ParameterLine(), set(), and datrw::seife::Header::write().

113  {
114  libtime::TRelativeTime
115  ttmin(Mtime.days(),Mtime.hour(),Mtime.minute());
116  libtime::TRelativeTime ttsec(Mtime);
117  ttsec -= ttmin;
118  double tmin, tsec;
119  tmin=1440.*ttmin.days()+60.*ttmin.hour()+ttmin.minute();
120  tsec=libtime::time2double(ttsec);
121  std::ostringstream oss;
122  oss << std::setw(10) << std::left << Mnsamples;
123  oss << std::setw(20) << std::left << Mformat;
124  oss << std::setw(10) << std::left << std::showpoint <<
125  std::setprecision(3);
127  { oss << std::scientific; }
128  else
129  { oss << std::fixed; }
130  oss << Mdt;
131  oss << std::setw(10) << std::left << std::setprecision(1)
132  << std::fixed << tmin;
133  oss << std::setw(10) << std::left << std::setprecision(6) << tsec;
134  return(oss.str());
135  } // void ParameterLine::set(const std::string& line)
unsigned int Mnsamples
number of samples
Definition: seifeio.h:117
int ntrailingdigits(double v, const bool &debug)
return number of trailing digits (after decimal point)
Definition: util.cc:97
std::string Mformat
Fortran data format.
Definition: seifeio.h:119
double Mdt
sampling interval
Definition: seifeio.h:121
libtime::TRelativeTime Mtime
time of first sample
Definition: seifeio.h:123
Here is the call graph for this function:
Here is the caller graph for this function: