glbeam_bypass
Description
glbeam_bypass is a utility for beam pattern correction of a JCU GLORIA file. This tool has two primary modes of operation:
- Calculate Beam Pattern: If no beam pattern file is supplied, it calculates the average beam pattern parameters from the input GLORIA file.
- Apply Beam Pattern: If a beam pattern file is supplied, it applies the corrections from that file to the input GLORIA file.
Usage
glbeam_bypass <infile> <outfile> <beamfile_or_null>
Arguments
| Option | Description |
|---|---|
<infile> | Required. The input JCU GLORIA file. |
<outfile> | Required. The output JCU GLORIA file with beam pattern correction applied. |
<beamfile_or_null> | Required. Either the path to a beam pattern file (.beam_pattern format) to apply, or the string “null” to instruct the tool to calculate the beam pattern from the infile. |
How It Works
- Mode Determination:
- If
<beamfile_or_null>is “null”, the tool enters “calculate beam pattern” mode. - Otherwise, it enters “apply beam pattern” mode and loads the supplied beam pattern parameters.
- If
- Calculate Beam Pattern Mode (
<beamfile_or_null>is “null”):- Reads the input GLORIA file record by record.
- For each pixel in the sidescan data (port and starboard), it calculates the
theta(angle) based on its distance from nadir and the altitude. - It then accumulates the sum of pixel intensities and the count of pixels for each
itheta(integerthetabin). - After processing the entire file, it computes the average intensity (
stbd_ave,port_ave) for eachithetabin. - It calculates
stbd_parandport_parby dividing the average intensity in each bin by the overall average intensity within a defined range (min_usetomax_use). Thesestbd_parandport_pararrays represent the calculated beam pattern.
- Apply Beam Pattern Mode (a
beamfileis supplied):- Loads the beam pattern parameters (
stbd_par,port_par,stbd_ave,port_ave) from the supplied beam pattern file. - For each parameter, it calculates its reciprocal so that corrections can be done by multiplication.
- Loads the beam pattern parameters (
- Correction Application (both modes):
- Reads the input GLORIA file record by record.
- For each pixel in the sidescan data (port and starboard):
- Calculates
thetaandithetaas described above. - It interpolates
parameterfromstbd_par/port_pararrays based onithetaand weights (weight1,weight2). - The raw pixel value is multiplied by
parameterto get thecorrectedvalue. - The
correctedvalue is clamped to a maximum of 254.
- Calculates
- The corrected record is written to the output file.