deJaw
Description
deJaw is a utility designed to identify and flag specific types of noise artifacts in multibeam sonar data, colloquially referred to as “alligators” or “jaws.” These artifacts manifest as sudden, significant changes in the across-track slope of the seafloor from ping to ping. The tool uses a combination of slope analysis and thresholding to detect these anomalies and marks the affected beams as bad.
It can also detect and flag profiles with vesselHeading outside the valid 0-360 range.
Usage
deJaw <mergefile(s)> [-v] [-badazi] [-port | -stbd]
Arguments
| Option | Description |
|---|---|
<mergefile(s)> | Required. One or more paths to OMG-HDCS merged files to be processed. These files are modified in place. |
-v | Enable verbose output. |
-badazi | Flags all beams in a profile if the profile.vesselHeading is found to be outside the valid 0-360 degree range. |
-port | Only analyze and correct the port side of the swath. |
-stbd | Only analyze and correct the starboard side of the swath. |
-criteria <filename> | (Present in USAGE but not implemented) This option likely suggests an external file for defining slope criteria, but the internal interping_distance, ACROSS_twoslopelimit, and ALONG_twoslopelimit are hardcoded. |
How It Works
- File Processing: The tool iterates through each provided merged file.
- Summary Header Reading: Reads the summary header for basic file information.
- Profile Iteration (
kfrom 1 tonumProfiles - 2):badaziCheck: If-badaziis specified, it reads theprofile.vesselHeadingfor the current ping. If the heading is outside 0-360, it flags all beams in that ping as22(bad).- “Alligator” Detection (Default): If
-badaziis not specified:- Slope Calculation: It reads the beams from the previous (
before_beams), current (beams), and next (after_beams) pings. For each of these sets of beams, it calculates an average across-track slope (get_slopefunction) within the specified side of the swath (-port,-stbd, orBOTH). - Slope Difference Analysis: It then calculates the differences in across-track slope between consecutive pings:
before_slope = current_slope - previous_slopeandafter_slope = next_slope - current_slope. - Thresholding: If both
fabs(before_slope)andfabs(after_slope)exceed a predefinedthreshold(hardcoded to0.25), it indicates a significant change, marking a potential “alligator” (got_a_gatorflag is set). - Flagging Beams: If an “alligator” is detected (
got_a_gatoris true), it then iterates through each beamiin the current ping:- Calculates the along-track slope between
before_beams[i]andbeams[i], and betweenbeams[i]andafter_beams[i]. - If both along-track slopes exceed
ALONG_twoslopelimit(hardcoded to5.0), it flagsbeams[i].statusas22.
- Calculates the along-track slope between
- Slope Calculation: It reads the beams from the previous (
- In-Place Update: The modified
beams(with updatedstatusflags) are written back to the merged file for the current profile. - Beam Buffer Update: Before processing the next profile, the
beamsfrom the current ping are copied tobefore_beams, andafter_beamsare copied tobeams, to maintain the sliding window.
get_slope Function
This helper function:
- Takes an array of
OMG_HDCS_beamstructures. - Calculates a linear least-squares fit for depth vs. across-track distance for valid beams within a specified side of the swath (
check_side). - Returns the slope (in degrees) of this fit, representing the average across-track slope of the seafloor.
Output Files
The input merged files are modified in-place.
Dependencies
OMG_HDCS_jversion.h: For OMG-HDCS data structures.support.h: For general utility functions and error handling.math.h: For mathematical functions.
Notes
The “alligator” artifacts are usually indicative of problems with motion compensation, sound velocity correction, or data processing. This tool provides an automated way to identify and remove such noise, improving the quality of the bathymetric model. The hardcoded thresholds suggest these values were empirically determined to be effective for specific data types or sonar systems.