gsftest
Overview
gsftest is a detailed GSF inspection and verification utility linked against the full gsf_lib library (gsfOpen / gsfRead). Originally written to verify GSF files produced by omg2gsf and third-party hydrographic packages, it prints ping headers, scale factors, and full sensor-specific bathymetry and imagery subrecords for R2Sonic (2022/2024), Reson SeaBat 7125, Kongsberg EM4 (EM710, EM302, EM122), and Kongsberg EM3002, along with optional per-beam sounding arrays (-print_beams) and snippet time series (-print_snippet_data).
Usage
gsftest [-print_beams] [-print_snippet_data] -in <filename.gsf>
CLI Options
| Flag | Arguments | Default | Description |
|---|---|---|---|
-in | <filename.gsf> | Required | Path to the input .gsf file. |
-print_beams | None | Off | Print per-beam flags, angles, two-way travel times, (along, across, depth) coordinates, relative/calibrated amplitudes, and snippet sample counts. |
-print_snippet_data | None | Off | Print every individual snippet time-series sample (raw, signed short, and 0.1 dB scaled float) for every beam in every ping. |
How It Works
- Sequential GSF Reading: Opens the
.gsffile viagsfOpen(inname, GSF_READONLY, &handle)and iterates through all records usinggsfRead(handle, GSF_NEXT_RECORD, ...). - Header, Comment, and Ping Inspection: Prints
GSF_RECORD_HEADERversion strings andGSF_RECORD_COMMENTstrings. For eachGSF_RECORD_SWATH_BATHYMETRY_PING, prints ping time, attitude, navigation, beam count, sensor ID, depth/tide/GPS-tide correctors, and travel-time scale factor/offset. - Sensor-Specific Subrecord Dumping: Inspects
in_record.mb_ping.sensor_idand prints all fields ofgsfR2SonicSpecific/gsfR2SonicImagerySpecific,gsfReson7100Specific,gsfEM4Specific(including all transmit sectors andgsfEM4ImagerySpecific), orgsfEM3ImagerySpecific. - Beam & Snippet Dumping: If
-print_beamsor-print_snippet_datais enabled, loops through0..number_beams-1and prints beam arrays andbrb_inten->time_series[j]snippet traces.
Practical Examples
1. Inspect ping headers and sensor-specific metadata in a GSF file:
gsftest -in line01.gsf | head -n 60
2. Dump all beam soundings and calibrated snippet samples:
gsftest -print_beams -print_snippet_data -in line01.gsf > line01_dump.txt