mapbeam
Description
mapbeam is a utility that scans JCU GLORIA/MR1 format sidescan files to stack their across-track profiles. It organizes this data according to a series of depth bins, effectively computing a depth-dependent angular function or beammap. This tool is designed as a faster alternative to older beam pattern correction methods like glbeam_bydepth.c, providing an empirical representation of the beam pattern.
Usage
mapbeam [-maxdep <depth>] [-mindep <depth>] [-depbin <count>] <basename> <datafile1> [datafile2 ...]
Arguments
| Option | Description | Default |
|---|---|---|
-maxdep <depth> | Set the maximum depth for binning. | 4000.0 |
-mindep <depth> | Set the minimum depth for binning. | 200.0 |
-depbin <count> | Set the number of depth bins. | 750 |
<basename> | Required. A base name for the output files. Two files will be generated: <basename>.mean and <basename>.count. | Β |
<datafile1> [datafile2 ...] | Required. One or more input sidescan files (GLORIA/MR1 format) to be processed. | Β |
How It Works
- Initialization:
- The tool allocates memory for
sumandcountarrays, which are used to accumulate pixel intensity sums and pixel counts for each depth and across-track bin. - It initializes
maxcountto track the maximum number of pings contributing to any single bin.
- The tool allocates memory for
- Configuration: Users can define the minimum depth (
-mindep), maximum depth (-maxdep), and the number of depth bins (-depbin) for the mapping process. - Process Input Files (
scanfilefunction):- The tool iterates through each provided
<datafile>. - For each GLORIA record in an input file:
- It extracts the
depth(fromheader.altitude). - It calculates the
row(depth bin index) using theDEPTHTOROWmacro. - It iterates through all pixels (
SWATH_WIDTH) in the recordβs sidescan data (stbd_data). - For each valid pixel (not 255):
- Its intensity is added to
sum[index]andcount[index]is incremented, whereindexmaps the current depth bin and across-track position.
- Its intensity is added to
- It extracts the
- The tool iterates through each provided
- Dump Data (
dump_datafunction): After processing all input files, the tool generates two output files:<basename>.mean(Mean Beam Pattern):- For each depth bin, it calculates the average pixel intensity (
sum[index] / count[index]). - These average intensities are then written as GLORIA records to the
.meanfile. Theheader.altitudeof each record in this file represents the mean depth of that bin.
- For each depth bin, it calculates the average pixel intensity (
<basename>.count(Coverage Count):- For each depth bin, it scales the
count[index]by255 / maxcountto represent the pixel coverage as an 8-bit image. - These scaled counts are written to the
.countfile.
- For each depth bin, it scales the