plotDump
Description
plotDump is a versatile plotting utility designed to visualize time-series data dumps, typically from DelayEditor or other processing tools. It can plot various navigation, motion, and sonar-related parameters (e.g., heave, roll, pitch, depths, velocities, accelerations) against time or another parameter.
The tool supports plotting multiple data series on a single graph, filtering, applying squat models, and displaying ranges from multibeam merged files. It’s highly interactive, prompting the user for plot choices and ranges.
Usage
plotDump -infile <file1> [-infile <file2> ...] [-outfile <filename.meta>] [OPTIONS] <merged_file(s)...>
Arguments
| Option | Description | |
|---|---|---|
-infile <file1> ... | Required. One or more input ASCII files containing time-series data. | |
-outfile <filename.meta> | Specifies the output PostScript metafile name. | plot.meta |
-size <dx> <dy> | Specifies the plot size in centimeters. | 20.0 25.0 |
-xplot | Enables plotting one parameter against another (X-Y plot) instead of against time. | |
-dofilt | Enables interactive filtering of data before plotting. | |
-filtlen <val> | Specifies the length of the boxcar filter (number of samples) if filtering is enabled. | 2 |
-squat <bias> <linear> <square> | Overlays a squat model onto the plot (requires -xplot). | |
-filtdepth | (Present in USAGE, but implementation not fully shown for plotting) Intended for filtering depth. | |
-label <string> | Adds a custom title to the plot. | |
-sparse | (Present in USAGE, but implementation not fully shown for plotting) Intended for sparse plotting. | |
-xrange <min> <max> | Sets the X-axis range. | Auto-determined. |
<merged_file(s)...> | (Optional) One or more merged files. Their time extents will be indicated on the plot. |
Interactive Mode
After launching, plotDump will guide the user through a series of prompts:
- Number of Plots (
noplots): Prompts for how many vertical subplots to create. - Y-axis Bounds (per plot): For each plot, it prompts for Y-axis minimum (
ymin[i]) and maximum (ymax[i]) values. It can auto-calculate a range around the average value ifymin[i]is set to-999.0. - Parameter Selection (Y-axis): For each subplot, it presents a menu of 56 available parameters and prompts the user to choose which one to plot on the Y-axis.
- Parameter Selection (X-axis, if
-xplot): If-xplotis enabled, it presents the same menu and prompts for the parameter to plot on the X-axis. - Filtering (
-dofilt): If-dofiltis enabled, it asks the user if they want to filter the current time series and applies a boxcar filter withfiltlen. - Continue Plotting: After plotting one line in a subplot, it asks if the user wants to plot another line in the same subplot.
How It Works
- Initialization: Parses command-line arguments to set plotting options, input file names, and ranges. Initializes a
plotlibPostScript output (plot.meta). - Input File Reading:
- Opens all input ASCII files specified by
-infile. - Reads metadata from each file (file name, time range, X range, start/end records,
delay,lag,scale_factor). - Determines
total_mintimeandtotal_maxtimeacross all files. - Allocates memory for
values[MAX_NOVALUES]to store all data. - Reads all data from all input files into the
valuesarray, normalizing time to a common start. - Calculates
avvalue[i](average) andvalcount[i](number of valid points) for each parameter.
- Opens all input ASCII files specified by
- Plot Setup: Initializes the
plotlibPostScript output. Sets up the overall plot dimensions (xlength,ylength,xoff). - Plotting Loop:
- Divides the plotting area into
noplotsvertical subplots. - For each subplot:
- Draws the subplot border.
- Draws X-axis grid lines and labels (time in minutes) if not
xplot_flag. - Prompts for Y-axis range and the parameter to plot.
- If
xplot_flag, prompts for the X-axis parameter. - If
dofiltis active, interactively asks to filter and appliesfilt_TS(). - Data Plotting: Iterates through
nopoints(records):- Gets
xval(time or chosen X-parameter) andyval(chosen Y-parameter). - If
xvalandyvalare within their respective plot bounds, it draws a line segment from the previous point to the current point.
- Gets
- Squat Model (
-squat): Ifsquat_flagandxplot_flagare active, it overlays a calculated squat curve (bias + linear term * speed + quadratic term * speed^2) onto the plot. - Adds labels for the chosen parameters.
- Divides the plotting area into
- Merged File Extent Plotting: If merged files (
.merged) are provided, it reads their summary headers, extracts their time extents, and indicates these extents as rectangular boxes on the plot. - Filtering Function:
filt_TS(int novals, float *invals, float *outvals, int filtlen): Applies a boxcar (moving average) filter toinvalsand stores results inoutvals.
- Cleanup: Frees allocated memory and closes all input files.
Output Files
<outfile_name>: A PostScript metafile (.meta) containing time-series plots of the selected parameters.
Dependencies
plotlib.h: Forplotlibfunctions.support.h: For general utility functions.math.h: For mathematical functions.OMG_HDCS_jversion.h: For merged file structures.
Notes
plotDump is a highly flexible interactive tool for detailed analysis of time-series data. Its interactive nature allows users to quickly explore different parameters and visualize trends, relationships, and anomalies. It is particularly useful for debugging processing results or for quality control of motion, navigation, and other time-varying data. The integration of filtering and squat models provides additional analytical capabilities.