MSpecBS_Xplot
Description
MSpecBS_Xplot (written by John Hughes Clarke, November 2015) cross-plots co-referenced pixels from two or three multi-frequency acoustic backscatter mosaics (*.mos, e.g., 100 kHz vs. 400 kHz R2Sonic or Kongsberg multispectral mosaics), optionally constrained to a specific water-depth range via a co-registered .r4 bathymetric DTM (-dep). It generates a 300ร300 floating-point 2D histogram density cross-plot (<prefix>.xplot.r4) covering -40 dB to -10 dB and, when supplied with a painted classification lookup table (-class_mask), maps acoustic classes back into geographic space (classification.map).
CLI Options & Usage
MSpecBS_Xplot -out <prefix> [-av <halfwidth>] [-DN_shift <dB>] \
[-dep <bathy.r4> -mindepth <m> -maxdepth <m>] \
[-class_mask <mask.8bit>] <mos1.mos> <mos2.mos> [<mos3.mos>]
-out <prefix>: Output prefix for<prefix>.xplot.r4and<prefix>.xplot.params.-av <n>: Spatial smoothing half-width (2n+1 ร 2n+1boxcar average, requiring at least 75% valid pixels in the window; default0).-DN_shift <dB>: dB offset applied when converting 8-bit mosaic Digital Numbers to decibels (dB = (DN * 0.5) - 127.0 + DN_shift; default40.0).-dep <bathy.r4>: Co-registered 32-bit float bathymetry grid used to filter pixels by water depth.-mindepth <m> -maxdepth <m>: Minimum and maximum water depths included in the cross-plot when-depis active.-class_mask <mask.8bit>: 300ร300 8-bitOMG1image painted over the cross-plot space (-40to-10 dB) used to classify every co-registered geographic pixel intoclassification.map.
Algorithm
- Verifies that all input
.mosfiles (and optional-dep.r4grid) have identicalxmaxandymaxdimensions. - Converts valid (
DN < 254) pixels (or local(2*av+1)ยฒneighborhood means) into decibels and maps pairs(dB_0, dB_1)into a 300ร300 grid (0.1 dBbin resolution from-40to-10 dB). - Normalizes the 2D histogram counts (
0..100scale, setting empty bins to99999.0) and writes<prefix>.xplot.r4. - If
-class_maskis provided, looks up each pixelโs(bx, by)cross-plot bin in the mask and writes the assigned class code (255 - mval) toclassification.map.