Sbat2OMG
Overview
Sbat2OMG converts 60-beam Reson SeaBat 9001 multibeam bathymetry stored in Lloyd Huff’s ASCII format (with UTM Easting/Northing coordinates referenced to central meridian -69.0°W) into OMG HDCS v1 .depth files (toolType = Seabat9001, numDepths = 60).
Usage
Sbat2OMG (-v) (-allowed 3) (-centre 30) -old linename -new linename
CLI Options
| Flag | Arguments | Default | Description |
|---|---|---|---|
-old | <linename> | required | Input Huff-format ASCII SeaBat 9001 file. |
-new | <linename> | required | Output file prefix; creates <linename>.depth. |
-allowed | <min_quality> | 3 | Minimum acceptable beam quality (quality[j] >= allowed); beams below this value are flagged with status = 22. |
-centre | <beam_index> | 30 | Center beam index. |
-v | none | 0 | Enable verbose output. |
How It Works
- ASCII Ping Header & UTM Conversion: For each ping, reads a 10-field ASCII header (
year,jday,secs,heave,roll,pitch,heading,tide,ship_east,ship_north) and converts UTM Easting/Northing to WGS84 latitude and longitude viautmgeo(&ship_lat, &ship_lon, -69.0, ship_east, ship_north, 'n'). - 60-Beam Loop: Reads 60 lines per ping (
beamno,depth,across,along,c_east,c_north,quality,bs), converts each beam’s UTM coordinates to latitude/longitude viautmgeo(), negatesdepth,across, andalonginto millimeters (-(int)(val * 1000.0)), flags beams wherequality < allowedasstatus = 22, and writes the OMG HDCS v1 profile and beams to<linename>.depth. - Summary Header Finalization: Rewinds
<linename>.depthat EOF to updatesummary.numProfileswith the total ping count and prints the time and geographic bounding box.
Practical Examples
Convert a Huff ASCII SeaBat 9001 file to OMG .depth format
Sbat2OMG -v -allowed 3 -old huff_line01.asc -new huff_line01
This creates huff_line01.depth.