glmerge
Description
glmerge is a utility designed to merge Seabeam navigation and depth information onto a raw IOS (Institute of Ocean Sciences) format GLORIA file. The processed data, combining the sidescan imagery with accurate navigation and depth, is then written out as a JCU GLORIA record file. This tool performs time-based interpolation to synchronize the two different datasets.
Usage
glmerge [-declin <degrees>] [-layback <value>] [-azi] [-isolated <time_gap_window>] [-ping <rate>] [-timehack <seconds>] <cbfile> <iosfile_prefix>
Arguments
| Option | Description | Default |
|---|---|---|
-declin <degrees> | Apply a magnetic declination correction (in degrees) to the azimuth values. | 0.0 |
-layback <value> | Specifies the layback value (in seconds or units) to account for the offset between the seabeam and sidescan acquisition. | 0 |
-azi | If specified, the azimuth from the Seabeam file will be merged. | (None) |
-isolated <time_gap_window> | If specified, allows for isolated Seabeam depth/offset values to be used if within the specified time gap window. | (None) |
-ping <rate> | Specifies the ping rate. Used for time-related calculations. | 30 |
-timehack <seconds> | A “timehack” value to be subtracted from the layback. | 0 |
<cbfile> | Required. The input Seabeam file (presumably in sb_urirec format) containing navigation and depth. | |
<iosfile_prefix> | Required. The prefix for the input IOS GLORIA file. The tool assumes the input file has a .ios extension. The output file will be named <iosfile_prefix>.mer. |
How It Works
- File Opening and Initialization: The tool opens the Seabeam file (
cbfile), the input IOS GLORIA file (iosfile), and the output JCU GLORIA file (merfile). It initializes various parameters includinglaybackandtimehack. - Time Synchronization:
- It reads the first IOS GLORIA record to get its raw time. This time is adjusted by
layback(andtimehack). - It then searches within the Seabeam file (
cbfile) to find the closest Seabeam record to this adjusted IOS time, and setscb_recordto point to it.
- It reads the first IOS GLORIA record to get its raw time. This time is adjusted by
- Process IOS GLORIA Records: The tool reads each record from
iosfileone by one:- Time Adjustment: The current IOS record’s time is retrieved using
getiostimeand adjusted bylayback. Time is also adjusted based onpingrate to avoid duplicate timestamps from IOS data lacking seconds. - Skip Non-transmissions: It checks for “non-transmission” or invalid pings by summing a portion of the raw sidescan data; if the sum is below a threshold, the record might be considered a “corner” and handled differently.
- Navigation Interpolation:
- It finds the two Seabeam records (
prev_cb_rec,next_cb_rec) that bracket the adjusted IOS record time. - Linear interpolation weights (
weight1,weight2) are calculated. - Depth and Offset: Seabeam depth and offset values (
cb_depth,cb_offset) for various beams are interpolated. The-isolatedflag provides special handling for using isolated Seabeam data if only one bracketing record is valid and within a specifiedtime_gap_window. - Latitude and Longitude: Latitude and longitude are interpolated from the Seabeam records.
- Azimuth (Optional): If the
-aziflag is set, the azimuth (mer_rec.header.azi) is interpolated from the Seabeam course values and corrected for magnetic declination.
- It finds the two Seabeam records (
- Populate JCU GLORIA Record: The
mer_recis populated with the interpolated header information and the raw sidescan data from the IOS record. - Write Output: The merged
mer_recis written tomerfile.
- Time Adjustment: The current IOS record’s time is retrieved using
getiostimeFunction: A helper function to parse time from the IOS record.- Loop: This process repeats until all records in
iosfilehave been processed.