34 #define DATRW_SEEDSTRUCTDUMP_CC_VERSION \ 35 "DATRW_SEEDSTRUCTDUMP_CC V1.0 " 39 #include<datrwxx/seedstructdump.h> 40 #include<datrwxx/mseedread.h> 57 void print_hex(
const unsigned short int& f, std::ostream& os)
59 std::ostream::fmtflags flags=os.flags();
60 os.setf(std::ios_base::hex, std::ios_base::basefield);
61 os.setf(std::ios_base::showbase);
70 os <<
"Control Header:" << std::endl;
72 os << std::string(s.
seqno, 6);
92 libtime::TAbsoluteTime thetime=
convert(s);
93 os << thetime.timestring();
100 os <<
"Data Extension Blockette:" << std::endl;
105 os << s.
iusec() << std::endl;
109 os << s.
ifcount() << std::endl;
116 os <<
"Data Only SEED Blockette:" << std::endl;
120 os <<
" (" << int(s.
format) <<
")" << std::endl;
123 os <<
" (" << s.
ibytesex() <<
")" << std::endl;
126 <<
" bytes (" << s.
ireclen() <<
")" << std::endl;
135 os <<
"Data Record Blockette Header:" << std::endl;
137 os << s.
type << std::endl;
146 os <<
"Fixed Data Record Header:" << std::endl;
159 os << s.
nsamp << std::endl;
161 os << s.
srate << std::endl;
163 os << s.
srmult << std::endl;
179 os << s.
tcorr << std::endl;
209 os <<
"Activity Flags:" << std::endl;
211 { os <<
" calibration signals present" << std::endl; }
212 if (f.
tcorrapp) { os <<
" time correction applied" << std::endl; }
213 if (f.
begevent) { os <<
" beginning of event" << std::endl; }
214 if (f.
endevent) { os <<
" end of event" << std::endl; }
216 { os <<
" a positive leap second happened" << std::endl; }
218 { os <<
" a negative leap second happened" << std::endl; }
219 if (f.
event) { os <<
" event in progress" << std::endl; }
226 os <<
"Quality Flags:" << std::endl;
228 { os <<
" amplifier saturation detected" << std::endl; }
229 if (f.
clip) { os <<
" digitizer clipping detected" << std::endl; }
230 if (f.
spike) { os <<
" spike detected" << std::endl; }
231 if (f.
glitch) { os <<
" glitches detected" << std::endl; }
233 { os <<
" missing/padded data present" << std::endl; }
235 { os <<
" telemetry synchronization error" << std::endl; }
237 { os <<
" a digital filter may be charging" << std::endl; }
238 if (f.
time) { os <<
" time tag is questionable" << std::endl; }
245 os <<
"I/O Flags:" << std::endl;
248 os <<
" station volume parity error possibly present" 251 if (f.
longrec) { os <<
" long record read" << std::endl; }
252 if (f.
shortrec) { os <<
" short record read" << std::endl; }
253 if (f.
start) { os <<
" start of time series" << std::endl; }
254 if (f.
end) { os <<
" end of time series" << std::endl; }
255 if (f.
locked) { os <<
" clock locked" << std::endl; }
264 os <<
"ASCII";
break;
266 os <<
"16 bit integer";
break;
268 os <<
"24 bit integer";
break;
270 os <<
"32 bit integer";
break;
272 os <<
"IEEE floating point";
break;
274 os <<
"IEEE double precision floating point";
break;
276 os <<
"Steim (1) compression";
break;
278 os <<
"Steim (2) compression";
break;
280 os <<
"GEOSCOPE multiplexed 24 bit integer";
break;
282 os <<
"GEOSCOPE multiplexed 16 bit gain ranged 3 bit exponent";
285 os <<
"GEOSCOPE multiplexed 16 bit gain ranged 4 bit exponent";
288 os <<
"US national network compression";
break;
290 os <<
"CDSN 16 bit gain ranged";
break;
292 os <<
"Graefenberg 16 bit gain ranged";
break;
294 os <<
"IPG Strasbourg 16 bit gain ranged";
break;
296 os <<
"Steim (3) compression";
break;
298 os <<
"SRO format";
break;
300 os <<
"HGLP format";
break;
302 os <<
"DWWSSN gain ranged";
break;
304 os <<
"RSTN 16 bit gain ranged";
break;
319 os <<
"SPARC or 68000";
330 os <<
"Steim 1 Frame:" << std::endl;
331 os <<
" control word: 0x";
332 std::ostream::fmtflags flags=os.flags();
333 os.setf(std::ios_base::hex, std::ios_base::basefield);
349 os <<
" data: " << std::endl;
359 os << i <<
" special (" << f.
ctrl(i) <<
"): " 360 << w.
fw << std::endl;
363 for (
int j=0; j<4; ++j)
368 os << i <<
" byte (" << f.
ctrl(i) <<
") #" << j <<
": " 369 << int(w.
byte[j]) << std::endl;
373 for (
int j=0; j<2; ++j)
378 os << i <<
" halfword (" << f.
ctrl(i) <<
") #" << j <<
": " 379 << w.
hw[j] << std::endl;
386 os << i <<
" fullword (" << f.
ctrl(i) <<
"): " 387 << w.
fw << std::endl;
397 os <<
"Steim 2 Frame:" << std::endl;
398 os <<
" control word: 0x";
399 std::ostream::fmtflags flags=os.flags();
400 os.setf(std::ios_base::hex, std::ios_base::basefield);
416 os <<
" data: " << std::endl;
426 os << i <<
" special (" << f.
ctrl(i) <<
"): " 427 << w.
fw << std::endl;
430 for (
int j=0; j<4; ++j)
435 os << i <<
" byte (" << f.
ctrl(i) <<
") #" << j <<
": " 436 << int(w.
byte[j]) << std::endl;
442 for (
int j=0; j<word.
nval(); ++j)
456 os <<
" #" << j <<
": " 457 << word.
value(j) << std::endl;
468 os <<
"Steim Frame:" << std::endl;
469 os <<
" control word: 0x";
470 std::ostream::fmtflags flags=os.flags();
471 os.setf(std::ios_base::hex, std::ios_base::basefield);
487 os <<
" data: " << std::endl;
491 os <<
" (" << f.
iword() <<
"," << f.
idiff() <<
") " 492 << f.
diff() << std::endl;
int idiff() const
return current difference index
unsigned int ireclen() const
int fw
1 4-byte difference (fullword)
bool end
end of time series
int iword() const
return current word index
GEOSCOPE multiplexed 16 bit gain ranged 3 bit exp.
void dump_aflags(const unsigned char &s, std::ostream &os)
int nval() const
return number of values in this word
unsigned char reserved
Reserved.
bool event
event in progress
void reset()
step to first difference value
void dump_ioflags(const unsigned char &s, std::ostream &os)
unsigned int control() const
return control word
unsigned int ibytesex() const
bool shortrec
short record read
US national network compression.
bool calpres
calibration signals present
int dnib() const
return dnib
bool negleap
a negative leap second happend
std::string extractstring(const char *s, const int &l)
Return a maximum of l characters.
void print_field_name(const char *f, std::ostream &os)
bool posleap
a positive leap second happend
bool ampsat
amplifier saturation detected
short int hw[2]
2 2-byte differences (halfword)
bool time
time tag is questionable
GEOSCOPE multiplexed 16 bit gain ranged 4 bit exp.
unsigned int ifcount() const
Root namespace of library.
four 8-bit differences (byte)
libtime::TAbsoluteTime convert(const SEED::BTIME &t)
convert BTIME structure to libtime structure
unsigned char reserved
reserved
DataRecordBlocketteHeader blocketteheader
bool telsynch
telemetry synchronization error
DataRecordBlocketteHeader blocketteheader
bool spike
spikes detected
void dump_qflags(const unsigned char &s, std::ostream &os)
one 32-bit difference (fullword)
bool longrec
long record read
contains non-data information, like headers
bool begevent
beginning of event
void dump(const ControlHeader &s, std::ostream &os)
IEEE double precision floating point.
IPG Strasbourg 16 bit gain ranged.
unsigned char format
Encoding Format.
bool parityerr
station volume parity error possibly present
bool clip
digitizer clipping detected
GEOSCOPE multiplexed 24 bit integer.
void print_hex(const unsigned short int &f, std::ostream &os)
bool glitch
glitches detected
bool miss
missing/padded data present
Graefenberg 16 bit gain ranged.
void next()
step to next difference value
bool tcorrapp
time correction applied
virtual int diff() const =0
return current difference value
SPARC or 68000 byte order.
bool valid() const
we are still inside the frame
bool start
start of time series
unsigned int itquality() const
bool charging
a digital filter may be charging
bool endevent
end of event
static const int nwords
numer of words to process
int word(const int &i) const
return data word i
unsigned char bytesex
Word order.
char byte[4]
4 1-byte differences
ESteimControl ctrl(const int &i) const
return control code for word i
int value(const int &i) const
unsigned int reclenbytes() const
two 16-bit differences (halfword)