Fix Zheng auto-depth divergence: proportional inst-depth crop cap + outlier filter#199
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.