gsfTool
Overview
gsfTool is a fast diagnostic utility based on the lightweight omg_gsf parser that scans a Generic Sensor Format (.gsf) file, validates 4-byte record alignment, prints the GSF version header, optionally dumps specific record types (-vid), and outputs a summary count of all record types encountered.
Usage
gsfTool [-v] [-vid <ID>] -in <inputfile.gsf>
CLI Options
| Flag | Arguments | Default | Description |
|---|---|---|---|
-in | <inputfile.gsf> | Required | Path to the input .gsf file. |
-v | None | Off | Print the record name and byte size for every packet read. |
-vid | <ID> | Off | Verbose dump of decoded fields for a specific GSF record ID (2 Swath Bathymetry Ping, 3 Sound Velocity Profile, 4 Processing Parameters, 5 Sensor Parameters, 6 Attitude). May be specified multiple times. |
How It Works
- Packet Peeking: Iterates through the
.gsffile callingpeek_GSF_packet(infile, &record_id, &record_size)and warns ifrecord_sizeis not a multiple of 4 bytes. - Record Parsing: Dynamically grows a
GSF_Bufferas needed, reads the record payload, prints the 12-byteGSF_HEADERversion string (GSF-vXX.XX), and dispatches record IDs2..6to their respectiveparse_GSF_*andprint_GSF_*routines. - Summary Output: Prints
<record_id>, <record_name>: <count>for each non-zero record type at EOF.
Practical Examples
1. Print a record inventory of a GSF file:
gsfTool -in survey01.gsf
2. Dump all Sensor Parameters (ID 5) and Sound Velocity Profiles (ID 3):
gsfTool -vid 5 -vid 3 -in survey01.gsf