updateArray
Overview
updateArray recomputes a final 32-bit floating-point bathymetric grid (<prefix>.r4) from its intermediate weighted-gridding accumulator files (<prefix>.r4_weights and <prefix>.r4_weight_depth) by dividing each cellโs accumulated weighted depth sum by its accumulated weight sum (sum_weight_depth / sum_weight).
Syntax & CLI Options
updateArray <prefix>
| Argument | Description |
|---|---|
<prefix> | Grid filename prefix. Reads <prefix>.r4_weights and <prefix>.r4_weight_depth, and writes <prefix>.r4. |
How It Works
- Opens
<prefix>.r4_weight_depthand<prefix>.r4_weightsfor reading, and<prefix>.r4for writing. - Reads the
JHC_headerfrom<prefix>.r4_weight_depthand writes it to<prefix>.r4. - Streams through all
ynorows (xnofloats per row):- For each column
k, ifsum_weight[k] != 0, computesfinal_data[k] = sum_weight_depth[k] / sum_weight[k]; otherwise assigns0.0. - Writes the normalized scanline to
<prefix>.r4.
- For each column
Examples
Recompute .r4 depths after merging or updating accumulator grids
updateArray sheet01
Workflow Context
- Upstream:
weigh_grid(when run with-save_weights) andaddWG(which combines multiple.r4_weightsand.r4_weight_depthaccumulator pairs). - Downstream:
jview,r4to8bit,r4toESRI.