38 #define TF_WIDXIO_CC_VERSION \ 51 const double epsilon=1.e-30;
54 std::cerr <<
"DEBUG (nsignificantdigits): " 55 <<
"entered function for value:" << v << std::endl;
65 double basefactor=pow(10.,-floor(log10(v)));
69 double factor=basefactor*pow(10.,n);
75 std::cerr <<
"DEBUG (nsignificantdigits): " 76 <<
"basefactor: " << basefactor <<
" " 77 <<
"factor: " << factor <<
" " 79 <<
"v1: " << v1 <<
" " 80 <<
"v2: " << v2 <<
" " 119 std::cerr <<
"DEBUG (WIDXline): entered function" <<
122 std::ostringstream os;
124 os <<
" " << wid2.
date.hierarchicalstring();
127 os.setf(std::ios_base::left, std::ios_base::adjustfield);
128 os << wid2.
station.substr(0,5);
131 os.setf(std::ios_base::left, std::ios_base::adjustfield);
132 os << wid2.
channel.substr(0,3);
135 os.setf(std::ios_base::left, std::ios_base::adjustfield);
136 os << wid2.
auxid.substr(0,4);
139 os.setf(std::ios_base::left, std::ios_base::adjustfield);
140 os << wid2.
instype.substr(0,6);
144 std::cerr <<
"DEBUG (WIDXline): partial result:" <<
145 os.str() << std::endl;
147 double rate=1./wid2.
dt;
148 double value=wid2.
dt;
160 std::cerr <<
"DEBUG (WIDXline): partial result:" <<
161 os.str() << std::endl;
163 os.setf(std::ios_base::scientific, std::ios_base::floatfield);
167 std::cerr <<
"DEBUG (WIDXline): ndigits:" <<
168 ndigits << std::endl;
170 os.precision(ndigits);
187 std::cerr <<
"DEBUG (WIDXline): final result:" <<
188 os.str() << std::endl;
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));
214 if (type ==
"r") { retval.
dt = 1./retval.
dt; }
std::string auxid
Auxiliary identification code.
double calper
calibration reference period
std::string station
Station code.
std::string instype
instrument type
std::string channel
FDSN channel code.
int nsamples
number of samples
libtime::TAbsoluteTime date
time of first sample
#define SFF_assert(C, M)
check condition
std::string WIDXline(const sff::WID2 &wid2, const bool &debug=false)
write WID2 information in extended format
double calib
calibration factor
const char *const WIDXID
ID for extended WID2 format.
double vang
veritcal orientation
int nsignificantdigits(double v, const bool &debug=false)
return number of significant digits
double dt
sampling interval (sec)
double hang
horizontal orientation