gox β Vernier Interferometer Cross-Phase Trajectory Script
Overview
gox is an 8-line shell script in sub2k/ that executes testWrap with the -xplot flag using a here-document (<< eno) supplying three stave baselines (3.0, 6.00, and 8.5 wavelengths $\lambda$), plots the resulting 2D phase-difference trajectory in wraps as discrete points via asciiplot -points -infile wraps, and launches viewmeta plot.meta &.
Whereas go plots wrapped phase as a function of arrival angle $\theta$, gox plots the 2D phase-space locus (dp12 on the X-axis vs. dp23 on the Y-axis) across 5,000 steps of $\sin(\theta) \in [-1, +1]$. In this 2D phase space, an interferometric sonarβs ambiguity resolution corresponds to identifying which diagonal stripe a noisy (dp12, dp23) measurement lies closest to.
Usage
./gox
CLI Options
gox takes no command-line arguments. Its internal pipeline is configured as follows:
| Step / Parameter | Value | Description |
|---|---|---|
testWrap -xplot << eno | 3.0 6.00 8.5 | Runs testWrap in cross-plot mode (plot_type = 1) with stave spacings $d_1 = 3.0\lambda$, $d_2 = 6.00\lambda$, and $d_3 = 8.5\lambda$. |
asciiplot -points -infile wraps | -points -infile wraps | Renders the 5,000 (dp12, dp23) coordinates in wraps as a scatter/point plot in plot.meta (avoiding wrap-around connecting lines when phase jumps from $+180^\circ$ to $-180^\circ$). |
viewmeta plot.meta & | plot.meta | Launches the OMG X11 metafile viewer in the background. |
How It Works
The complete source of sub2k/gox is:
testWrap -xplot << eno
3.0 6.00 8.5
eno
asciiplot -points -infile wraps
viewmeta plot.meta &
- Cross-Phase Locus Generation (
testWrap -xplot):testWrapsetsplot_type = 1when-xplotis passed on the command line.- It reads
d1 = 3.0,d2 = 6.00,d3 = 8.5fromstdin. - It steps
sin_thetafrom-1.0to+1.0in increments of0.0004(5,000 points), computing wrapped phase differencesdp12anddp23in degrees ([-180.0, +180.0]) and writing them towraps.
- Scatter Plot Rendering (
asciiplot -points):- Because
dp12anddp23wrap discontinuously at $\pm 180^\circ$, drawing continuous polylines would create false retrace lines across the plot. Passing-pointstoasciiplotplots each of the 5,000 samples as an individual point.
- Because
Practical Examples
Generate and View the 2D Phase-Difference Locus
cd /path/to/code/sub2k
sh ./gox