plotRoll
Description
plotRoll is a specialized plotting utility designed to visualize the required roll accuracy of a multibeam sonar system as a function of either angle (grazing angle) or range. It generates a custom plot based on a predefined mathematical relationship, which likely models the sensitivity of bathymetric measurements to roll errors at different across-track positions.
This tool is useful for understanding the impact of motion sensor accuracy on sounding quality and for determining acceptable limits for roll compensation, particularly in the context of system calibration and survey planning.
Usage
plotRoll [-range] [-outfile <filename.meta>] [-size <dx> <dy>] [-yrange <min> <max>]
Arguments
| Option | Description | |
|---|---|---|
-range | Changes the X-axis from angle to range. | |
-outfile <filename.meta> | Specifies the output PostScript metafile name. | plot.meta |
-size <dx> <dy> | Specifies the plot size in centimeters. | 18.0 15.0 |
-yrange <min> <max> | (Present in USAGE but fixed to 0.0 to 1.0 in provided code) Sets the Y-axis range (required roll accuracy). | 0.0 to 1.0 |
How It Works
- Initialization: Parses command-line arguments to set plotting options, plot size, and
range_flag. - Plot Setup: Initializes the
plotlibPostScript output (plot.meta). Sets up the overall plot dimensions (xlength,ylength,xoff). Draws the main plot border. - Axis Ranges:
- If
range_flagis set:xmin = 0.0,xmax = 9.0(range). - If
range_flagis not set:xmin = 0.0,xmax = 90.0(angle). ymin = 0.0,ymax = 1.0(fixed for roll accuracy).
- If
- Axis Labels and Grid: Draws X and Y axes with numerical labels and grid lines. The labels on the X-axis will correspond to angle (0-90 degrees) or range (0-9).
- Data Plotting Loop: Iterates for
jfrom18to78(representing angles):- Calculation:
- Calculates
xvalas either the anglejor a derived range2.0 * tan(j * M_PI / 180.0)ifrange_flagis set. - Calculates
yvalusing the formula(180.0 / M_PI) * atan(0.005 / tan(xval * M_PI / 180.0)). This formula relates a small angular error (0.005 radians) to the required roll accuracy as a function of the angle or range.
- Calculates
- Plots
xvalvs.yvalas a continuous line.
- Calculation:
- Additional Lines (
line()function): Plots small vertical lines atyval = 0.9andyval = 1.0at specificxpositions, likely indicating thresholds or reference points for roll accuracy. - Cleanup: Calls
plot_closeto finalize the PostScript output.
Output Files
<outfile_name>: A PostScript metafile (.meta) visualizing the required roll accuracy.
Dependencies
plotlib.h: Forplotlibfunctions.support.h: For general utility functions.math.h: For mathematical functions.
Notes
This tool provides a theoretical model for understanding the impact of roll errors on multibeam depth measurements. It helps in setting specifications for motion sensor accuracy and for visualizing the trade-offs between survey coverage (outer angles/ranges) and vertical accuracy. The yrange option is present in usage but is hardcoded in the current code.