modbeam
Description
modbeam is a utility designed to modify the beam pattern by incorporating a vertical beam function. It uses existing beam-angle and aspherical spreading component files (in JHC image format) to compute new, modified beam patterns for both port and starboard transducers. The output consists of two new lookup array files (.beam_port and .beam_stbd) representing these modified beam patterns. This tool does not appear to incorporate beam focusing.
Usage
modbeam -water <file_prefix> [-first <record>] [-last <record>]
Arguments
| Option | Description |
|---|---|
-water <file_prefix> | Required. Specifies a prefix for related water column files. The tool expects to find <file_prefix>.beam_angle and <file_prefix>.aspherical. It will output <file_prefix>.beam_port and <file_prefix>.beam_stbd. |
-first <record> | Specifies the first record number to include in processing. |
-last <record> | Specifies the last record number to include in processing. |
How It Works
- Input Loading:
- The tool opens the specified beam-angle (
.beam_angle) and aspherical component (.aspherical) files. These files are expected to be JHC image files containingfloatdata. - It reads their
JHC_headerto determine image dimensions and loads the entire image data into memory as arrays offloat(beamsandaspherical).
- The tool opens the specified beam-angle (
- Output Initialization:
- Two new output files,
.beam_portand.beam_stbd, are created, each with a header copied from the inputbeam_head. - A
newbeamsarray is allocated to store the computed beam pattern.
- Two new output files,
- Beam Pattern Calculation (for Port and Starboard): The tool performs this calculation twice, once for port (k=0) and once for starboard (k=1).
- Wavenumber Calculation:
wave_numberis calculated based on the respectivePORT_FREQorSTBD_FREQandSOUND_SPEED. - Pixel Iteration: It iterates through each pixel (
j,i) of the input image data (skipping the edges for boundary conditions). - For each pixel:
rbeamis read from thebeamsarray and converted from a scaled value to radians.rasphis read from theasphericalarray (though it is not used in the provided calculation snippet forD).- Vertical Beam Function: The core directivity
Dis calculated based onrbeamand the physical parametersTRANSDUCER_SPACING,TRANSDUCER_RADIUS, andwave_number. This calculation involves two terms:- One term from
sin((2. * values)) / (2. * sin(values))usingvalues = TRANSDUCER_SPACING * wave_number * sin(rbeam) / 2.0. This models a two-element array pattern. - Another term
2. * j1(x) / xusingx = wave_number * TRANSDUCER_RADIUS * sin(rbeam). This models the directivity of a circular transducer.
- One term from
Dis the product of these two terms.- The squared magnitude (
pow((double)D, 2.0)) is stored in thenewbeamsarray.
- Wavenumber Calculation:
- Write Output: The calculated
newbeamsarray is written asfloatvalues to the respective.beam_portor.beam_stbdoutput file, preceded by its header.