go â Vernier Interferometer Phase-Wrap Simulation Script
Overview
go is an 8-line shell script in sub2k/ that executes testWrap using a here-document (<< eno) supplying three receive stave spacing baselines (3.5, 6.75, and 8.5 acoustic wavelengths $\lambda$), converts the resulting wraps output table into an OMG plot metafile (plot.meta) via asciiplot, and launches the X11 metafile viewer viewmeta.
It is used to visualize how a 3-baseline Vernier interferometric sonar unwraps phase across a $\pm 90^\circ$ receive sector when the baseline pair difference $(8.5 - 6.75 = 1.75\lambda)$ and $(6.75 - 3.5 = 3.25\lambda)$ form a Vernier scale.
Usage
./go
CLI Options
go takes no command-line arguments. Its parameters are embedded directly in the script:
| Step / Parameter | Value | Description |
|---|---|---|
testWrap << eno | 3.5 6.75 8.5 | Runs testWrap in standard angle-sweep mode (plot_type = 0) with stave spacings $d_1 = 3.5\lambda$, $d_2 = 6.75\lambda$, and $d_3 = 8.5\lambda$. |
asciiplot -infile wraps | -infile wraps | Reads the wraps ASCII plot file written by testWrap and generates plot.meta. |
viewmeta plot.meta & | plot.meta | Opens plot.meta asynchronously in the OMG viewmeta X11 graphics viewer. |
How It Works
The complete source of sub2k/go is:
testWrap << eno
3.5 6.75 8.5
eno
asciiplot -infile wraps
viewmeta plot.meta &
- Phase-Wrap Calculation (
testWrap):testWrapreadsd1 = 3.5,d2 = 6.75,d3 = 8.5fromstdin.- Because
-xplotis not passed,testWrapsweeps receive angle $\theta$ from $-90^\circ$ to $+90^\circ$ in $0.1^\circ$ increments (1,800 steps) and writes wrapped phase curves (p1,p2,p3), differential phases (dp12,dp23), and double-difference Vernier phase (ddp) into the output filewraps.
- Metafile Rendering (
asciiplot):asciiplot -infile wrapsreads thex:/y:header directives and coordinate series fromwrapsand rendersplot.meta.
- Interactive Display (
viewmeta):viewmeta plot.meta &displays the multi-curve phase plot on screen.
Practical Examples
Run the Standard Vernier Phase-Wrap Simulation
cd /path/to/code/sub2k
sh ./go