plotAngStrip
Description
plotAngStrip is a specialized plotting utility designed to visualize angular response data generated by compAngStrip -ss. It reads an ASCII file containing stacked angular response curves (representing backscatter strength versus grazing angle) and plots them as a series of graphs.
The tool allows for plotting multiple stacked curves, defining custom plot ranges, and adding titles, making it suitable for analyzing how angular response varies along a survey line or between different processing stages.
Usage
plotAngStrip -infile <file1> [-outfile <filename.meta>] [-size <dx> <dy>] [-yrange <min> <max>] [OPTIONS]
Arguments
| Option | Description | |
|---|---|---|
-infile <file1> | Required. Specifies an input ASCII file from compAngStrip -ss. | |
-outfile <filename.meta> | Specifies the output PostScript metafile name. | plot.meta |
-size <dx> <dy> | Specifies the total plot size in centimeters (X and Y dimensions). | 15.0 22.0 |
-yrange <min> <max> | Sets the Y-axis range (backscatter strength in dB). | -40.0 to -15.0 |
-together | Plots all stacked curves on a single graph, overlapping. | |
-sparse | (Not fully implemented) Intended for sparse plotting. | |
-tit1 <string> / -tit2 <string> | Sets titles for the plot. |
Input File Formats (ASCII from compAngStrip -ss)
The input ASCII file is expected to contain:
no_stacks(int): Total number of stacked angular response curves.- For each stack:
cen_stack(int): Center stack number.ByAngle[j](double): Backscatter value for each angle binj(0-179).
How It Works
- Initialization: Parses command-line arguments to set plotting options, input/output filenames, plot size, and ranges. Initializes a
plotlibPostScript output (plot.meta). - Plot Area Setup: Sets up the overall plot dimensions (
xlength,ylength,xoff,yoff). Draws the main plot border. - Title and Labels: If titles are provided, they are added to the plot.
- File Reading: Opens the input ASCII file from
compAngStrip -ss. - Stacked Curve Iteration: Reads
no_stacks(total number of stacked curves) from the input file. Then, for each stack:- Reads
cen_stackand theByAngle[j]values (backscatter per angle bin). - Plotting Geometry: If
together_flagis not set, it recalculatesylengthandyoffto create separate vertical strips for each stack. - Draws a border for the current stack’s plot area.
- Draws vertical lines at -25 and 25 degrees (related to typical grazing angle ranges).
- Draws horizontal lines at -0 dB and the Y-axis range.
- Curve Plotting: Iterates through
jfrom0to179(representing angles):- If
ByAngle[j]is valid, it converts the angle (j - 90.0) and backscatterByAngle[j]to screen coordinates (xpos,ypos). - Draws a line segment from the previous valid point to the current point, creating the angular response curve.
- If
- Reads
- Cleanup: Calls
plot_closeto finalize the PostScript output and closes the input file.
Output Files
<outfile.meta>: A PostScript metafile (.meta) containing plots of the stacked angular response curves.
Dependencies
plotlib.h: Forplotlibfunctions.support.h: For general utility functions.math.h: For mathematical functions.
Notes
This tool provides a visual means to track the variability of angular response along a survey line, which can be indicative of changing seafloor types or processing artifacts. The ability to plot multiple stacked curves allows for direct comparison of different segments of the data. The -sparse option is listed but not fully implemented.