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 nopoints data 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

  1. Initialization: Parses command-line arguments to set plotting options, input file names, plot size, and the view type (Z_ERROR, Y_ERROR, ANGLE_ERROR).
  2. Plot Setup: Initializes the plotlib PostScript output (plot.meta). Sets up the overall plot dimensions (xlength, ylength, xoff). Draws the main plot border for each subplot.
  3. Data Reading:
    • Reads noplots from the input file.
    • Reads xmin, xmax (X-axis range).
    • Reads ymin, ymax (Y-axis range) for each plot.
    • Reads actual and assumed values (purpose unclear from snippet).
    • Reads nopoints from the input file.
  4. Error Data Plotting Loop: For each plot i:
    • Sets pen color.
    • Reads nopoints data records from the input file, each containing various error metrics.
    • Based on the view type (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).
    • If xval and yval are 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 -points is set).
  5. Allowable Error Curve (-angle_error): If view is ANGLE_ERROR, it overlays a curve representing the “allowable error” (calculated from atan(0.005 / tan(angle))), providing a reference for how much angular error is acceptable.
  6. Cleanup: Calls plot_close to 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: For plotlib functions.
  • 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.