RT (Real-Time) is a comprehensive X-windows application designed for real-time unravelling, processing, and visualization of Simrad multibeam sonar telegrams (like EM100, EM1000, EM3000, EM710, etc.) and other sonar formats (RESON, ELAC). It processes raw sonar data, extracts bathymetry, sidescan imagery, attitude, navigation, and sound velocity data, and then displays them graphically in various interactive windows.
The tool can output processed data to OMG-HDCS (Ocean Mapping Group - Hydrographic Data Conversion System) merged files, along with auxiliary attitude, heading, and sidescan data files. It provides interactive controls for panning, zooming, color mapping, and adjusting display parameters. RT is a critical tool for real-time quality control, survey monitoring, and initial data processing of multibeam sonar data.
Usage
RT [OPTIONS] [<input_file(s)>]
Arguments
Option
Description
<input_file(s)>
(Optional) One or more input raw sonar telegram files. If not provided, it will prompt interactively or use auto-discovery.
Buttons Widget: Contains interactive buttons for various controls (e.g., Start Log, Stop Log, Reset, Color Palette, Image Type, Next File, Catchup, Beam Masks, Line Run).
Attitude, Beam Mask, Line Running Widgets: Separate pop-up windows for detailed views and controls related to attitude data, beam masking, and runline parameters.
How It Works
Initialization:
Parses command-line arguments to configure various processing, output, and display options.
Initializes global variables, flags, and data structures (Simrad_em12, OMG_HDCS_jversion, RESON_UNB, UNB_ELAC, RT_unravel, RT_ancil_data, j_ang_resp).
Attempts to auto-guess byte order and sonar model from the input file.
Sets up default tool-type specific variables (e.g., MaxDep, Min_DB, Max_DB, att_flag configuration).
If area_flag is set, loads background imagery (.ssmos, .dtm) and their headers.
X-Windows Setup (if view_flag):
Initializes the X-windows display, creates main and auxiliary windows/widgets, and sets up colormaps.
Initializes XImage structures for main map and sidescan display.
Data Processing Loop (log_data() / log_RESON_data() / log_ELAC_data() / log_SUBMETRIX_data()):
Reads raw sonar telegrams from the input file.
Parses the telegrams based on the detected RAW_type (sonar model). This involves reading binary structures, extracting relevant fields (timestamps, navigation, attitude, depths, intensities, snippets, watercolumn data), and converting them into generic internal data structures.
Performs various processing steps:
Time Synchronization: Matches navigation and attitude data to depth pings.
Tide Correction: Applies tide from a loaded tide file (calc_tide()).
Motion Correction: Applies roll, pitch, heave, and yaw corrections (some are basic/assumed, others rely on detailed motion sensor data).
Beam Masking: Applies user-defined or default beam masks.
Backscatter Processing: Calculates backscatter values from raw intensities, applying TVG, spreading, absorption corrections.
Quality Flagging: Sets quality flags based on various criteria.
Geolocation: Converts sonar beam coordinates to geographic coordinates.
Data Output: Writes processed data to OMG-HDCS merged files and auxiliary files.
Display Update (if view_flag): Updates the X-windows display with new pings, painted bathymetry/sidescan, updated navigation, and attitude plots. Includes functions like paint_bathy(), paint_ampl(), paint_ss(), update_plot().
Interactive Event Loop (process_x_events()):
If view_flag is set, it enters a loop to handle user input (mouse clicks, key presses) for panning, zooming, changing display modes, and interacting with widgets.
Calls various helper functions (shift_view(), zoom_view(), check_for_edge(), change_mask()) to respond to user actions.
Cleanup: Closes all open files and frees allocated memory.