makemesh
Overview
makemesh creates a synthetic 8-bit JHC_header raster (data_type = 1) containing one of three patterns:
- Regular Grid / Mesh (default): Horizontal and vertical grid lines spaced every
-spacingpixels (with configurable line and background digital numbers). - Colorbar / Greyscale Wedge (
-colorbar): A 2D 8-color $\times$ 30-shade color-intensity palette wedge (or 0â255 vertical greyscale ramp with-grey). - Interferometric Phase-Difference Circular Pattern (
-wavelengths/-mount_angle): A circular polar plot illustrating two-element interferometric sonar phase wraps (dlambda = wavelengths * sin(angle - mount_angle)) across a transducer stave pair.
Syntax & CLI Options
makemesh (-xlen <nx> -ylen <ny> | -getsizeimage <ref_file>) [OPTIONS] -out <filename>
| Option | Description | Default |
|---|---|---|
-out <filename> | Required. Output 8-bit JHC_header filename. | None |
-xlen <pixels> | Horizontal width (dx) of the output array in pixels. | Required unless -getsizeimage is used |
-ylen <pixels> | Vertical height (dy) of the output array in pixels. | Required unless -getsizeimage is used |
-getsizeimage <file> | Copy dx, dy, and georeferencing metadata from an existing JHC_header file. | Disabled |
-spacing <pixels> | Grid line interval in pixels for mesh mode. | 10 |
-xoffset <pixels> | Horizontal phase offset (j % spacing == xoffset) for vertical mesh lines. | 0 |
-yoffset <pixels> | Vertical phase offset (i % spacing == yoffset) for horizontal mesh lines. | 0 |
-line <DN> | Digital number (0..255) for mesh grid lines. | 0 (255 if -invert) |
-back <DN> | Digital number (0..255) for mesh background pixels. | 255 (0 if -invert) |
-invert | Swap default mesh colors so grid lines are 255 and background is 0. | Disabled |
-colorbar | Generate a 2D color-intensity palette bar (16 + 30*(j/xlen) + 30*int(8*i/ylen)) instead of a mesh. | Disabled |
-grey | Used with -colorbar: generate a smooth vertical 0..255 greyscale ramp instead of the 8-color $\times$ 30-shade palette. | Disabled |
-wavelengths <N> | Enable interferometric phase-difference pattern mode with transducer baseline separation <N> wavelengths ($d/\lambda$). | 0.5 |
-mount_angle <deg> | Enable interferometric phase-difference pattern mode with stave tilt angle <deg> degrees. | 0.0 |
-360 | Used in phase-difference mode: plot across the full $360^\circ$ circle instead of restricting to the forward hemisphere ($-90^\circ$ to $+90^\circ$). | Disabled |
How It Works
- Header Initialization: Either reads an existing
JHC_headervia-getsizeimageor constructs a newOMG1header withdx = xlen,dy = ylen, anddata_type = 1(8-bit unsigned char). - Pattern Generation:
- Mesh Mode (default): Sets pixel
(j, i)toMESH_LINEwheneveri % spacing == yoffsetorj % spacing == xoffset, andMESH_BACKotherwise. - Colorbar Mode (
-colorbar): Maps horizontal positionjacross 30 intensity shades and vertical positioniacross 8 color bands (DN = 16 .. 255), matching the defaultmix_cicolor-intensity table. - Phase-Difference Mode (
-wavelengthsor-mount_angle): Within a circle of radius $\min(\text{xlen}, \text{ylen})/2$, computes polar angle $\theta$ relative tomount_angle, evaluates wrapped phase path difference $\Delta\lambda = \text{frac}(d/\lambda \cdot \sin\theta) \in [-0.5, 0.5)$, and maps it to palette indices16..254.
- Mesh Mode (default): Sets pixel
Examples
1. Create a 20-pixel mesh matching the dimensions and projection of an existing .r4 grid:
makemesh -getsizeimage survey.r4 -spacing 20 -line 0 -back 255 -out survey_mesh.8bit
2. Create a 2D color-intensity legend bar for mix_ci maps:
makemesh -xlen 100 -ylen 400 -colorbar -out ci_legend.8bit
3. Generate a 2-wavelength interferometric sonar phase-wrap diagram tilted at 30°:
makemesh -xlen 500 -ylen 500 -wavelengths 2.0 -mount_angle 30.0 -out interf_phase.8bit