sidescanpy.export.target_window#

Target-window correction: TVG then display orientation.

Composes the decode-only reader in sidescanpy.io.jsf.targets with apply_tvg_to_amplitude() and orient_for_display().

2026 rshomberg@uri.edu

Contents

decode_and_correct_window

Decode target's window and run it through the same TVG -> orient-for-display chain used everywhere this project renders a target crop.

correct_decoded_window

Apply TVG then display orientation to an already-decoded window.

sidescanpy.export.target_window.decode_and_correct_window(target, *, freq_hz)#

Decode target’s window and run it through the same TVG -> orient-for-display chain used everywhere this project renders a target crop.

Does not apply detrend_by_range(): the per-column median it subtracts is present whether or not a target is there, so at crop scale it mostly flattens real seafloor texture.

Lives in export (not io.jsf.targets) because TVG is a processing step and orientation an export convention; io only decodes.

Parameters:
targetTarget

Must have extra_attributes["ping_meters_per_sample"] (set by read_discover_targets).

freq_hzfloat

Acquisition frequency for the TVG absorption term — this survey’s target catalogs don’t record it per-target, so callers pass their own known constant (see absorption_for_frequency).

Returns:
(window, target)

TVG-corrected, display-oriented window, and a copy of target with .sample/extra_attributes["window_row"] remapped to match orient_for_display’s flips (see that function’s docstring).

sidescanpy.export.target_window.correct_decoded_window(window, target, *, freq_hz)#

Apply TVG then display orientation to an already-decoded window.

Second half of decode_and_correct_window(); see its docstring for the parameters and return value (window is the raw array from io.jsf.targets.decode_target_window).