shoalBias
Description
shoalBias (written by John Hughes Clarke, November 1995) downsamples a high-resolution 32-bit floating-point (.r4) OMG1 bathymetric DTM into larger hydrographic shoal-biased cells of size -binsize <meters>. Within each output bin, it retains the shoalest depth while recording the exact sub-bin latitude and longitude offsets of that shoal sounding in companion <outfile>.lat and <outfile>.lon grids so hydrographic fair sheets can plot the sounding at its true geographic position.
CLI Options & Usage
shoalBias -binsize <meters> -in <highres.r4> -out <shoal.r4>
-binsize <meters>: Target ground cell size in meters (count = binsize / head.dx).-in <highres.r4>: Input georeferenced 32-bit floatOMG1.r4bathymetric DTM.-out <shoal.r4>: Output shoal-biased.r4DTM (also generates<shoal.r4>.latand<shoal.r4>.lon).
Algorithm
- Computes the integer decimation factor
count = binsize / dx, setsout_xmax = xmax / count,out_ymax = ymax / count, and updatesout_head.dx = out_head.dy = count * dx. - For each
count à countblock of input cells, finds the minimum positive depth value (lowest < 9999.0), computes the exact geographic coordinates(real_lat, real_lon)of the winning source pixel(low_i, low_j)and the bin center(bin_lat, bin_lon)viaresolve_pos_from_pixel(), and stores:<out>:lowestdepth<out>.lat:real_lat - bin_lat<out>.lon:real_lon - bin_lon