extractRI
Overview
extractRI extracts 8-bit beam reflectivity (intensity) values from Reson SeaBat bathymetry packets (XTF_HEADER_BATHY, packet ID 2) inside an XTF file and writes them as a 2D grayscale raster image (width = number of beams, height = number of bathymetry pings) in either the OMG/JHC .8bit format or Portable Graymap (.pgm) format.
Usage
extractRI [-pgm] -in <basename_without_xtf_extension>
[!IMPORTANT]
extractRIautomatically appends.xtfto the argument supplied to-in(strAppend(basename, ".xtf")). Pass the filename without the.xtfextension!
CLI Options
| Flag | Arguments | Default | Description |
|---|---|---|---|
-in | <basename> | Required | Base name of the input XTF file without the .xtf suffix (opens <basename>.xtf). |
-pgm | None | Off (.8bit) | Output a standard Portable Graymap (<basename>.pgm) instead of an OMG/JHC headered 8-bit image (<basename>.8bit). |
How It Works
- Indexing: Opens
<basename>.xtf, builds an in-memory packet index viabuildXTFIndex(), and prints the packet summary table. - Intensity Verification: Seeks to the first
XTF_HEADER_BATHY(ID 2) record, parses theRESON_BATHYpayload, and checks that beam intensity values (resonBathy.intensity) are present. - Header Initialization: Writes either a PGM header (
writePGM) or an OMG 8-bit raster header (writeJHC) with dimensionsresonBathy.beam_countcolumns bynumBathyRecordsrows. - Radiometric Correction & Output: Iterates through every bathymetry record, calls
corrRESON_BATHY()to normalize the Reson beam intensities into 8-bit values (resonBathy.intensity8bit), and writes one row ofbeam_countbytes per ping to<basename>.pgmor<basename>.8bit.
Practical Examples
1. Extract Reson beam intensities to an OMG .8bit raster (for jview):
# Reads survey_line01.xtf and writes survey_line01.8bit
extractRI -in survey_line01
2. Extract Reson beam intensities to a standard .pgm image:
# Reads survey_line01.xtf and writes survey_line01.pgm
extractRI -pgm -in survey_line01