Skip to content

Fix Zheng auto-depth divergence: proportional inst-depth crop cap + outlier filter#199

Merged
CameronBodine merged 1 commit into
mainfrom
dev
Apr 29, 2026
Merged

Fix Zheng auto-depth divergence: proportional inst-depth crop cap + outlier filter#199
CameronBodine merged 1 commit into
mainfrom
dev

Conversation

@CameronBodine
Copy link
Copy Markdown
Owner

  • Replace hard-coded instDepBufM=5.0 offset with inst_depth_mult=3.0 multiplier in _depthZheng so the max bed-search depth scales with actual water depth. Multiplier of 3x keeps the water column at ~25% of each cropped side, preventing far-range lock artifacts when configured range >> true depth (e.g., 1.4m depth, 12m range on port side).

  • Add zero-padding when Ws < 0 (i.e., inst_depth * mult + WsBuf exceeds available range). Port gains pad_far zero columns on the far-range (left) side; star gains them on the right. Zero columns are interpreted as no acoustic return by the model, anchoring picks at the real data boundary. Port recovery subtracts pad_far to restore correct pixel coordinates.

  • Add post-pick outlier filter in _saveDepth (_flag_depth_outliers): rolling-median MAD spike detection + hard cap at inst_depth * 3 (matching crop multiplier). Flagged picks are set to NaN and filled by existing interp.

  • Add cross-side divergence resolver: when |port - star| > 5m, invalidate the side farther from inst_dep_m; rolling-residual fallback used when instrument depth unavailable.

  • WCProp changed from 1/3 to 1/4 to reduce water-column crop in second Zheng stage.

Tested on Rec00014 (shallow channel, 12m configured range): previous run had 2776 row-pairs with |star-port| > 5m (avg 2.99m, max 11.23m); fix confirmed working.

…utlier filter

- Replace hard-coded instDepBufM=5.0 offset with inst_depth_mult=3.0 multiplier
  in _depthZheng so the max bed-search depth scales with actual water depth.
  Multiplier of 3x keeps the water column at ~25% of each cropped side, preventing
  far-range lock artifacts when configured range >> true depth (e.g., 1.4m depth,
  12m range on port side).

- Add zero-padding when Ws < 0 (i.e., inst_depth * mult + WsBuf exceeds available
  range). Port gains pad_far zero columns on the far-range (left) side; star gains
  them on the right. Zero columns are interpreted as no acoustic return by the model,
  anchoring picks at the real data boundary. Port recovery subtracts pad_far to
  restore correct pixel coordinates.

- Add post-pick outlier filter in _saveDepth (_flag_depth_outliers):
  rolling-median MAD spike detection + hard cap at inst_depth * 3 (matching crop
  multiplier). Flagged picks are set to NaN and filled by existing interp.

- Add cross-side divergence resolver: when |port - star| > 5m, invalidate the
  side farther from inst_dep_m; rolling-residual fallback used when instrument
  depth unavailable.

- WCProp changed from 1/3 to 1/4 to reduce water-column crop in second Zheng stage.

Tested on Rec00014 (shallow channel, 12m configured range): previous run had 2776
row-pairs with |star-port| > 5m (avg 2.99m, max 11.23m); fix confirmed working.
@CameronBodine CameronBodine merged commit 9431eac into main Apr 29, 2026
3 of 6 checks passed
@CameronBodine CameronBodine deleted the dev branch April 29, 2026 07:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant