dumpReflect
Description
dumpReflect is a utility designed to extract and process reflectivity or backscatter data from OMG-HDCS merged files. It can dump raw or processed reflectivity values, apply various corrections (e.g., gain adjustments, grazing angle corrections), and generate a 2D map of reflectivity or corrected backscatter.
The tool supports specific processing for EM1000 and similar sonar types, allowing for recalculation of calibrated backscatter, and provides options for mapping and normalization.
Usage
dumpReflect <OMG_HDCS_datafile> <dumpfile> [OPTIONS]
Arguments
| Option | Description | |
|---|---|---|
<OMG_HDCS_datafile> | Required. The path to the input OMG-HDCS merged file. | |
<dumpfile> | Required. The path for the output dump file. The format depends on the options (e.g., JHC .r4 image or ASCII). | |
-verbose | Enable verbose output. | |
-recalc | Recalculates calibratedBackscatter for EM1000 and similar sonars based on internal algorithms, then uses this for output. | |
-calib | Use calibratedBackscatter field for processing (if available), otherwise reflectivity. | |
-gainout | Normalizes the output backscatter values to an average of 128 (for Angle-Independent Backscatter). | |
-map | Generates a 2D map (JHC .r4 image) of reflectivity or corrected backscatter. This requires a skip value to determine ping resolution. | |
-graz <val> | Applies a user-specified correction for grazing angle, defined as DN per degree. | 0.0 |
-skip <val> | Number of pings to skip when generating a map (for vertical resolution). | 1 |
-signal <min_dB> <max_dB> | Defines a signal range (in dB) for backscatter values (used during recalculation). | 140.0 to 180.0 |
-range <start_ping> <end_ping> | Process pings only within this range (inclusive). | All pings |
-dumpmod | (Present in USAGE but not fully implemented in main path) Likely intended to dump modified values. |
How It Works
- File Opening & Initialization: Opens the input merged file and the specified output dump file. Initializes global flags and parameters.
- Summary Header Reading: Reads the summary header from the merged file to determine sonar type and number of profiles.
- Recalculation (
-recalc): If specified, it iterates through all beams in all pings, recalculatingcalibratedBackscatterusingEM_convert_amplitude(for EM100_depth_ss, Seabat9001) or specific EM1000 logic. This updates thecalibratedBackscatterfield in the merged file. - Accumulate Averages (
-mapor-gainout): If-mapor-gainoutis active, it iterates through pings and beams to calculate the average reflectivity/calibrated backscatter per beam number (sum[j]) and the count of valid beams (count[j]). - Map Generation (
-map): If-mapis active:- Writes a JHC header to the output dump file (
outname). - Iterates through pings (skipping with
skip):- Extracts reflectivity/backscatter for each beam.
- Scales and places these values into an
amplitudearray, which is then written to the.r4file. This creates a 2D image where one dimension is beam number and the other is ping number. - If
calib_flaganddumpraw_flagare active, it outputs raw calibrated backscatter. Otherwise, it applies a correction based onsum[j]. - Also writes auxiliary information (pulse length, power, attenuation, TVG) to
plot.ascii.
- Writes a JHC header to the output dump file (
- Gain Normalization (
-gainout): If active:- Calculates an overall average energy from central beams (excluding nadir and edges).
- Normalizes the
pseudoAngleIndependentBackscattervalues for all beams such that the average energy of the swath becomes 128.
- Output to Merged File: If
!dumpraw_flag(meaning modified values are being used and mapped), it updates thepseudoAngleIndependentBackscatterfield in the merged file (andreflectivityfor certain sonar types). - Cleanup: Closes all open files.
Output Files
<dumpfile>: The main output file, which can be a JHC.r4image of reflectivity/backscatter map, or ASCII listing depending on options.- The input merged file may be modified in-place if
-recalcor-gainoutare used. plot.ascii: Auxiliary ASCII file with plotting information (if-mapis used).
Dependencies
OMG_HDCS_jversion.h: For OMG-HDCS data structures.array.h: ForJHC_headerstructure and.r4file handling.support.h: For general utility functions and error handling.Echo_calib.h: ForEM_convert_amplitudefunction (for recalculation).
Notes
This tool is flexible for debugging, visualizing, and standardizing backscatter data. The -recalc option is particularly useful for re-applying or comparing manufacturer-specific backscatter algorithms. The -map option provides a quick visual overview of the backscatter patterns across a survey line. The tool’s behavior regarding in-place modification or new file creation depends on the chosen options.