8kTool
Description
8kTool is a diagnostic utility for older Reson SeaBat 8000 series (.81x) files. Its primary function is to parse an .81x file, identify and count bathymetry and snippet data records, and optionally print verbose dumps of their contents to standard output.
This tool is useful for inspecting the raw structure and content of .81x files, verifying data integrity, and understanding the types and quantity of data stored within them. It supports RESON_BATHY and RESON_SNIPPET (SNP0 and SNP1) records.
Usage
8kTool -in <inputfile> [-v] [-vb] [-vs]
Arguments
| Option | Description |
|---|---|
-in <inputfile> | Required. Path to the input Reson SeaBat 8000 series (.81x) file. |
-v | Enable general verbose output (e.g., sync header, packet type). |
-vb | Verbose output for Bathymetry records. |
-vs | Verbose output for Snippet records. |
How It Works
- Initialization: Parses command-line arguments to get the input
.81xfilename and various verbose flags. InitializesRESON_PEEKER,RESON_BATHY,RESON_SNIPPET, andSNP1structures. - File Opening: Opens the input
.81xfile for reading. - Record Processing Loop: Reads the
.81xfile record by record:- Sync Search: Calls
seek_next_8K_sync()(an external function) to find the next Reson 8k synchronization pattern. - Peeker Reading: Reads
RESON_PEEKERto get thesynch_headerandpacket_type. - Record Parsing and Printing: Uses a
switchstatement based onpeeker.synch_header:- If
RESON_8K_SYNC_PATTERN: ReadsRESON_BATHYdata. Ifverbose_bathyis set, callsprintRESON_BATHY()(an external function). Incrementscount_bathy. - If
SNIPPET_ID_SNP0: ReadsRESON_SNIPPETdata. Ifverbose_snippetsis set, callsprintRESON_SNIPPET()(an external function). Incrementscount_snippets. - If
SNIPPET_ID_SNP1: ReadsSNP1data. Ifverbose_snippetsis set, callsprintSNP1()(an external function). Seeks past the snippet sample data. - For unsupported packet types, it prints a warning and seeks past the record.
- If
- Updates
corrupt_bathycounter if reading a bathy record fails.
- Sync Search: Calls
- Summary Output: After processing the entire input file, it prints a summary of the total number of bathymetry and snippet records found, and the number of corrupt bathy datagrams.
- Cleanup: Closes the input file.
Output
- A summary of bathymetry and snippet record counts, and optionally verbose dumps of selected record types, printed to standard output.