NAME

msdd - debugging miniseed files

SYNOPSIS

msdd [-bhovx] miniseed ...
msdd [-hi] miniseed
msdd [-hi] 'command;command' miniseed ...

DESCRIPTION

msdd dumps the contents of miniSEED (or the data blocks of full SEED) files in some detail. In interactive mode (with the -i option), it allows inspecting miniseed blocks one a time, and extracting selected blocks to another file.

It also allows some limited inspection by hexadecimal dump, and extraction of specified sections with the excerpt command.

Debugging miniseed

There has been a plague of errors in miniseed files from various dataloggers and other producers. These errors range from the innocuous (out of order sequence numbers, and blank records with only a sequence number) to the pernicious:

No doubt, there are still many to be discovered, especially as the standard continues to change with new blockettes added and old conventions discarded.

msdd is a tool for you to investigate problems with miniseed data. If an Antelope program like miniseed2db(1) or seed2db(1) spouts error messages, you should try to isolate and understand the problem using msdd -- and, of course, the SEED manual:

To get started, run msdd with the -i option against a problem miniseed file. There are a collection of commands you can then use to move around in the file, find bad records, and examine and extract them.

Probably the fastest way to zero in on the trouble is to begin with the scan command. This reads through the file (starting from the current position); it stops with a message when a problem is found (unless you specify the -k option to keep going). You can also automatically write the bad record and the previous record to a file with the -s filename option.

If you know the problem occurs at a particular offset in the file, you can move directly to that offset with the = command; append the offset directly after the = sign.

At this point, you may already have enough information. But perhaps you want a bit more. There are a variety of options for printing the current (problem) record: enter one of the print options: expose, unstuff, peek or dump, and then enter . to print the current record. Use + or - to move forward or backward one record.

If msdd doesn't recognize a record at some point, try =mmm to print a hexdump of 64 bytes at an offset of mmm bytes in the file, or +nn to print 64 bytes nn bytes from the current position, or -nn to print 64 bytes nn bytes before the current position.

Use save filename followed by ., + or reap commands to copy particular records out to a separate file.

Or, if no record is recognized, use excerpt to grab a portion of the file and write it to an external file.

Once you've identified the problem, and perhaps extracted it from any fabulously large file in which it was embedded, you should contact the producer of the bad data. Don't contact BRTT, unless you think the data is ok and the software is misinterpreting the actual record. Look at bugs(5) if you decide on the latter.

OPTIONS

EXAMPLE

# miniseed data from the DMC
% msdd -i TA-104_2004-366_2004.14.22183
* scan -q
<Enter any character to stop>

*** unrecognized bytes:
#1) %     0 (offset 0)
        00000000  3030 3030 3031 5620 3031 3030 3131 3530 000001V 01001150
        00000010  322e 3431 3232 3030 342c 3335 332c 3030 2.4122004,353,00
        00000020  3a30 303a 3030 2e30 3030 307e 3230 3034 :00:00.0000~2004
        00000030  2c33 3630 2c30 303a 3030 3a30 302e 3030 ,360,00:00:00.00

inspected 1 more records
*
<Enter any character to stop>

*** unrecognized bytes:
#7830) %     0 (offset 4929536)
        00000000  3030 3132 3034 2020 2020 2020 2020 2020 001204
        00000010  2020 2020 2020 2020 2020 2020 2020 2020
        00000020  2020 2020 2020 2020 2020 2020 2020 2020
        00000030  2020 2020 2020 2020 2020 2020 2020 2020

inspected 7829 more records

# miniseed data from a baler
% msdd -i TA-N26A_4-20090528090827
* scan -q
<Enter any character to stop>
msdd: abandoning possible seed record at offset = 3575808 because blockette type=1001 has next blockette offset 64 > max allowable 59

*** problem in miniseed header bytes:
#874) %150447 TA  N26A BHZ      5/28/2009 (148)  8:30:04.875   2989    40.00sps (offset 3575808)
sequence        150447
quality         D
net             TA
sta             N26A
loc
chan            BHZ
year            2009
day_of_year     148
hour             8
minutes         30
seconds          4
msec_x_10       8750
nsamp           2989
samprate_factor    40
samprate_multiplier     1
nominal_samprate  40.000
activity_flags    44
io_flags          20
quality_flags      0
blocks_following  4
time_correction 0
data_offset     64
next_blockette_offset 48
      B1000: format=11(Steim 2) order=1(sparc)  log2(recsize)=12 (4096)  (next_blockette_offset=56)
      B1001: timing_quality=100  usec=0  frame_count=61  (next_blockette_offset=64)

inspected 874 more records

# using interactive command on a list of files
% msdd -i 'scan -q -k' * > & /tmp/scan_results

% msdd -i 2003/100/NM_VA11_BHE_.msd

2003/100/NM_VA11_BHE_.msd
* help
   ?          show some information about file

Advance current record
   .          show current record
   +          show next record
   -          show previous record
   ]          show last record

Read through file
   reap       [n] work through [n] remaining records
   scan       [-q] [-s file] [-k] [n] scan for [n] bad blocks
   /          search for sequence number, net, sta, chan or loc or combo
   =xxx [n]   dump n bytes at offset xxx in file
   +xxx [n]   dump n bytes at current offset+xxx
   -xxx [n]   dump n bytes at current offset-xxx

Extract parts of file
   save     save to filename/stop saving
   excerpt  excerpt range of bytes to file

Set verbosity
   terse      show main miniseed header info/skip bad records
   hdr        show more of the miniseed header
   opaque     show opaque blockettes
   expose     print out the miniseed record header in detail/return bad records
   diffs      show steim differences
   peek       show 64 bytes of hex data
   unstuff    show data
   npts       specify how many data points to show

   help       list commands
   q        quit

* hdr
* .
#1) %     1 MS  MSSV BHZ      7/12/1996 (194) 13:29:24.575   5047    20.00sps (offset 0)
      T-delta: 0.00000 rate: 20 factor: 1 Activity: 0 I/O: 0 Quality: 0
      B1000: format=11(Steim 2) order=1(sparc)  log2(recsize)=12 (4096)  (next_blockette_offset=56)
      B1001: timing_quality=40  usec=81  frame_count=49  (next_blockette_offset=0)

* npts 5
* .
#1) %     1 MS  MSSV BHZ      7/12/1996 (194) 13:29:24.575   5047    20.00sps (offset 0)
         1817     1818     1817     1818     1818

* diffs
* .
#1) %     1 MS  MSSV BHZ      7/12/1996 (194) 13:29:24.575   5047    20.00sps (offset 0)
#1 D MS_MSSV_BHZ_ 1996 (194) 13:29:24.5749 nsamp:5047 f:20 m:1 (20/s (sdh)) Flags[A: 0 I: 0 Q: 0] #blks:2 Tc:0 data:64 Nxt:48
    B1000 Nxt:56 datafmt:11 sparc:1 recl:12
    B1001 Nxt:0 timing_quality:40 usec=81 frame_count:49
 Frame # 0 Codes :  00 00 00 11 11 11 11 11 11 11 11 11 11 11 11 11
  First:       1817 Last:       1818
    W 3 :7x4b : 0 1 -1 1 0 -1 1
    W 4 :7x4b : -1 1 0 -1 1 -1 1
    W 5 :7x4b : 0 -1 0 1 0 0 -1
    W 6 :7x4b : 1 0 0 0 -1 1 -1
    W 7 :7x4b : 0 1 -1 1 0 -1 1
    W 8 :7x4b : 0 0 0 -1 1 0 0
    W 9 :7x4b : -1 0 1 -1 1 0 0
        .
        .
        .

% msdd -dv G_ATD_BHE_.msd
#158 D G_ATD_BHE_ 2003 (050)  3:45:12.6000 nsamp:3799 f:20 m:1 (20/s (sdh)) Flags[A: 0 I: 0 Q: 0] #blks:2 Tc:-121612 data:64 Nxt:48
    B1000 Nxt:56 datafmt:11 sparc:1 recl:12
 Frame # 0 Codes :  00 00 00 10 01 01 01 01 01 01 01 01 01 01 01 01
  First:       -348 Last:       -756
    W 3 :3x10b : -348 -62 -62
    W 4 :4x8b: 21 59 13  2
    W 5 :4x8b: 27 32 -3 -12
    W 6 :4x8b: -22 -6 57 27
    W 7 :4x8b: -33 -70 -76  1
    W 8 :4x8b: 28 -1 -8 -36
    W 9 :4x8b: -57 -40 -50 -53
    W10 :4x8b: -23 -3 -31 -51
        .
        .
        .

% msdd -b miniseed
> /d/week/frank/big
Record Sequence Net  Sta Chan Loc       Time                    Samprate Nsamp Arch RecordSize DataFmt   Offset  Blockettes
#00001  S000000  CI   FUR LHE     4/20/2004 (111)  0:46:17.757   1.00sps  2670 sparc 4096b/rcd Steim-1        0  B1000
#00002  S000000  CI   FUR LHE     4/20/2004 (111)  1:30:47.757   1.00sps  2734 sparc 4096b/rcd Steim-1     4096  B1000
#00003  S000000  CI   FUR LHE     4/20/2004 (111)  2:16:21.757   1.00sps  2620 sparc 4096b/rcd Steim-1     8192  B1000
#00004  S000000  CI   FUR LHE     4/20/2004 (111)  3:00:01.757   1.00sps  2672 sparc 4096b/rcd Steim-1    12288  B1000
    .
    .
    .

SEE ALSO

sdd(1)
miniseed2days(1)
miniseed2db(1)

BUGS AND CAVEATS

msdd will also read from stdin, but not in interactive mode, and then prints only a terse version of the SEED records; the other flags have no effect. For a more in-depth analysis, you must use a miniseed file. Reading from stdin may be useful for reading files larger than a Gbyte (or so) with a 32 bit version of Antelope, but a better choice is to use a 64 bit version.

AUTHOR

Daniel Quinlan

Table of Contents
Antelope Release 4.11 Mac OS X 10.5.7 2010-01-13
Boulder Real Time Technologies, Inc For more information, contact support@brtt.com