plotSVP is a comprehensive plotting and processing utility for Sound Velocity Profiles (SVPs). It can read SVP data from various formats (Simrad, MVP, Seabird, JWC, custom ASCII), calculate derived parameters (salinity, density, gradients, Richardson number), and then generate 2D plots (profiles, time-series, raster images) of these parameters.
The tool supports advanced features such as plotting multiple SVPs on the same graph, filtering profiles based on area or time, painting profiles into a 2D array, and outputting processed SVPs in JWC (JHC Water Column) format. It’s a critical tool for analyzing, visualizing, and standardizing SVP data within oceanographic workflows.
Calculates density difference from a reference SVP (MVP_m1 format) with reference salinity and temperature.
-sali_scale <val> / -dens_scale <val>
Scales salinity/density values.
Titles & Footers
Option
Description
-tit1 <string> / -tit2 <string>
Sets plot titles.
-footer <string>
Sets a footer for the plot.
-refazi <val>
Reference azimuth for current plotting.
Debugging
Option
Description
-v
Enable verbose output.
-skip_extra <val>
Skips extra lines.
How It Works
Initialization: Parses command-line arguments to set numerous options for SVP type, plotting parameters, filters, and output.
File Setup:
Opens a plotlib PostScript output (plot.meta).
If svp_type is MVP-related, JWC, etc., it opens svp.coords to list SVP locations.
If array_flag is set, it opens svp.r4 for 2D array output.
If prof_flag is set, it reads profile coordinates from profname.
If area_flag or only_in_area_flag is set, it reads map header information from areaname.
If refvalname is set (for density difference), it reads the reference MVP data into the_refval.
If ancilname is set, it reads ancillary OS500 data.
If navTimeBounds or external_navfile is set, it reads navigation data for time/location matching.
SVP Data Reading Loop: Loops through each input SVP file specified by svpfilename(s):
Opens the input SVP file(s).
Reads the SVP data based on svp_type (Simrad, MVP, Seabird, JWC, etc.), handling various header formats and data structures.
For some types (MVP, Seabird), it attempts to extract time and geographic location (using NMEA GPGGA and GPZDA parsing, or external_navfile).
Performs data validation (e.g., validVels) and derived calculations (e.g., guessing salinity from T, P, V; calculating harmonic velocity, gradients, Richardson number, density difference).
Downcast Filtering (-downcast): If set, it truncates the SVP to only include the downcast portion.
JWC Output (-outasJWC): If set, it writes the processed SVP data to a JWC file (.jwc), collapsing to 0.2m bins if collapseJWC is set.
Array Output (-array): If array_flag is set, it paints the SVP data into a 2D float array (svpXZ), which can be rotated. This array represents SVP parameter values against depth and horizontal position/time.
Profile Painting (-paint_in_profile): If set, it paints the profile’s data into the svpXZ array, creating a visual representation of the profile along a track.
Plotting:
Sets up the plotting area (potentially in a table format if tableX/tableY are set).
Adds titles and footers.
Draws X/Y axes and labels (velocity/salinity/temperature/etc. vs. depth).
Plots the SVP data as lines, using different pens for different files or highlighting (if rainbow_flag, highlight).
For T-S plots, it can mark points with squares or diamonds based on range.
For current plots (-curr), it can draw current vectors.
If tableX/tableY are set, it divides the plotting area and plots each SVP in its respective cell.
Raster Output (-raster): If raster_flag is set, it generates a raster image (.raster) of the SVP data (e.g., velocity vs. depth, or currents).
Cleanup: Closes all open files and plotlib output.
Output Files
<outfile_name>: A PostScript metafile (.meta) containing the SVP plots.
<svpfilename_prefix>.r4: JHC .r4 array file containing SVP data (if -array is used).
<svpfilename_prefix>.jwc: JWC format SVP file (if -outasJWC is used).
<svpfilename_prefix>.raster: Raster image file (if -raster is used).
density_contrib.dump.txt: Debug dump for density difference calculations.
Dependencies
plotlib.h: For plotlib functions.
support.h: For general utility functions.
stdtime.h: For time conversion.
array.h: For JHC_header structure.
j_proj.h: For coordinate projection functions.
j_watercolumn.h: For water column structures and functions.
jcu_nav.h: For navigation data structures.
Notes
plotSVP is a versatile tool for comprehensive analysis and visualization of sound velocity profiles, which are crucial for accurate multibeam sonar data processing. Its ability to handle diverse input formats and calculate derived oceanographic parameters makes it an invaluable asset in oceanographic research and hydrographic surveying. The tool offers a wide range of plotting and output options for flexible data representation.