plotADCPgridcurrents
Overview
plotADCPgridcurrents reads a 2D 32-bit floating-point (.r4) vertical section grid of ADCP current velocities (such as tangential velocity produced by convertSectionUVtoRadTan), block-averages the velocities over configurable along-section distance (-distAv) and depth (-depthAv) bins, and renders a stick/vector profile plot in OMG plotlib metafile format (plot.meta by default).
Syntax & CLI Options
plotADCPgridcurrents [OPTIONS] -infile <vel_section.r4> [-outfile <plot.meta>]
| Option | Description | Default |
|---|---|---|
-infile <filename> | Required. Input 32-bit float (.r4) ADCP velocity section grid (data_type == 3). | None |
-outfile <filename> | Output plotlib vector metafile name. | plot.meta |
-distAv <meters> | Along-track horizontal averaging interval in meters (AvDistanceBins = distAv / JHChead.ystep). | 50.0 |
-depthAv <meters> | Vertical depth averaging interval in meters (AvDepthBins = depthAv / JHChead.xstep). | 2.0 |
-maxvel <m/s> | Reference maximum velocity scale in m/s (maxvel). | 1.0 |
-point | Sets internal point_flag. | Disabled |
-v | Enable verbose output. | Disabled |
How It Works
- Grid Orientation & Aspect Ratio: Reads
JHCheadfrom-infile(wheredyrepresents binned pings along distanceymin..ymaxwith stepystep, anddxrepresents vertical depth binsxmin..xmaxwith stepxstep). Scales the plot frame (20 cmalong the longer axis) to preserve the gridβs aspect ratio. - 2D Block Averaging:
- Steps through the along-section rows by
AvDistanceBins = distAv / ystep, averaging all non-zero velocity samples in each depth column intodist_fbuf. - Steps through depth bins by
AvDepthBins = depthAv / xstep, averaging non-zero values indist_fbufto obtain the bin-averaged velocitycurrent.
- Steps through the along-section rows by
- Vector Plotting: At each bin center
(xpos, ypos), draws a horizontal velocity vector line from(xpos, ypos)to(xpos + current, ypos)and closes theplotlibmetafile.
Examples
Average an ADCP tangential velocity section into 50 m horizontal by 3 m vertical bins and plot:
plotADCPgridcurrents -distAv 50 -depthAv 3 -maxvel 1.5 -infile adcp_tang.r4 -outfile adcp_sticks.meta
Workflow Context
- Upstream:
extractVertSectionandconvertSectionUVtoRadTan.