plotSvSonar
Description
plotSvSonar is a specialized plotting utility designed to visualize errors related to sound velocity (Sv) corrections in multibeam sonar data. It reads data from an ASCII file (likely generated by a tool that analyzes Sv errors), and plots various error metrics against different parameters like across-track distance or steered angle.
The tool can display vertical (Z), across-track (Y), or angular errors, helping users assess the quality of sound velocity profiles and identify areas where Sv corrections may be insufficient or incorrect.
Usage
plotSvSonar -infile <file1> [-outfile <filename.meta>] [-size <dx> <dy>] [-across_error | -angle_error] [-multi] [-points] [-v]
Arguments
| Option | Description | |
|---|---|---|
-infile <file1> | Required. Specifies an input ASCII file containing sound velocity error data. | |
-outfile <filename.meta> | Specifies the output PostScript metafile name. | plot.meta |
-size <dx> <dy> | Specifies the plot size in centimeters. | 15.0 5.0 (for Z, Y error) or 15.0 15.0 (for angle error) |
-across_error | Plots across-track (Y) errors. | |
-angle_error | Plots angular errors. | |
-multi | Plots multiple datasets on the same graph (overlapping). | |
-points | Plots data as points instead of lines. | |
-v | Enable verbose output. |
Input File Format (ASCII)
The input ASCII file is expected to contain:
noplots(int): Number of plots (datasets).xmin xmax(float, float): X-axis range.- For each plot
i:ymin[i] ymax[i](float, float): Y-axis range. - For each plot
i:actual assumed(float, float): Actual and assumed values (purpose unclear from snippet). - Then, for each of
nopointsdata points:assumed_angle(float)actual_angle(float)steered_angle(float)angle_error(float)across(float): Across-track distance in meters.depth(float)true_across(float)across_error(float)
How It Works
- Initialization: Parses command-line arguments to set plotting options, input file names, plot size, and the view type (
Z_ERROR,Y_ERROR,ANGLE_ERROR). - Plot Setup: Initializes the
plotlibPostScript output (plot.meta). Sets up the overall plot dimensions (xlength,ylength,xoff). Draws the main plot border for each subplot. - Data Reading:
- Reads
noplotsfrom the input file. - Reads
xmin,xmax(X-axis range). - Reads
ymin,ymax(Y-axis range) for each plot. - Reads
actualandassumedvalues (purpose unclear from snippet). - Reads
nopointsfrom the input file.
- Reads
- Error Data Plotting Loop: For each plot
i:- Sets pen color.
- Reads
nopointsdata records from the input file, each containing various error metrics. - Based on the
viewtype (Z_ERROR,Y_ERROR,ANGLE_ERROR):- Sets
xval(e.g.,across,true_across,steered_angle). - Sets
yval(e.g.,(depth - 1.0) * 100.0,across_error * 100.0,angle_error).
- Sets
- If
xvalandyvalare within their respective plot bounds, it converts them to screen coordinates (xpos,ypos). - Plots the data either as a line segment (default) or as points (if
-pointsis set).
- Allowable Error Curve (
-angle_error): IfviewisANGLE_ERROR, it overlays a curve representing the “allowable error” (calculated fromatan(0.005 / tan(angle))), providing a reference for how much angular error is acceptable. - Cleanup: Calls
plot_closeto finalize the PostScript output and closes the input file.
Output Files
<outfile_name>: A PostScript metafile (.meta) visualizing the sound velocity errors.
Dependencies
plotlib.h: Forplotlibfunctions.support.h: For general utility functions.math.h: For mathematical functions.
Notes
plotSvSonar is a specialized tool for assessing the impact of sound velocity profile errors on multibeam sonar data. It helps users identify areas or beam angles where Sv corrections are critical, which can guide survey planning or post-processing efforts. The tool’s ability to plot various error metrics provides comprehensive insight into the system’s sensitivity to sound velocity variations. The meaning of actual and assumed values in the input file is not explicitly clear from the provided snippet.