sidescanpy.targets.waterfall#
Target boxes in waterfall plot coordinates.
A waterfall is drawn either in pixel space (x_axis="sample",
y_axis="ping": port samples negative, starboard positive, the global
ping index up the y-axis) or in meters (x_axis="across_track",
y_axis="along_track"). waterfall_boxes() places each target in
whichever of the two is active and returns plain rectangles for a plotting
layer to draw.
2026 rshomberg@uri.edu
Contents
|
|
A labeled rectangle in waterfall axis units (lower-left corner + size). |
|
Mean across-track meters per sample over one ping's finite samples. |
|
Median along-track meters per ping (robust to turns); |
|
Where |
|
Rectangles for every |
|
Targets on |
- sidescanpy.targets.waterfall.BOX_AXES = (('sample', 'ping'), ('across_track', 'along_track'))#
(x_axis, y_axis)pairswaterfall_boxes()can place targets on.
- class sidescanpy.targets.waterfall.WaterfallBox(label, x0, y0, width, height)#
Bases:
NamedTupleA labeled rectangle in waterfall axis units (lower-left corner + size).
- label#
Alias for field number 0
- x0#
Alias for field number 1
- y0#
Alias for field number 2
- width#
Alias for field number 3
- height#
Alias for field number 4
- sidescanpy.targets.waterfall.mean_sample_spacing_m(ds, local_ping, channel_idx)#
Mean across-track meters per sample over one ping’s finite samples.
Averaged over the whole ping rather than a local difference, so it is stable near the water-column boundary.
1.0with fewer than two finite samples.
- sidescanpy.targets.waterfall.median_ping_spacing_m(along_track)#
Median along-track meters per ping (robust to turns);
1.0if undefined.
- sidescanpy.targets.waterfall.target_waterfall_position(target, ds, ping_idx, ping_offset, x_axis, y_axis, along_track=None)#
Where
targetlands on a waterfall’s axes, and the axis scale.- Parameters:
- targetTarget
Needs
sample;channeldefaults to port.- dsxr.Dataset or None
The plotted window (only read for the meters axes).
- ping_idxint
The target’s global ping index (the pixel y-axis value).
- ping_offsetint
Global ping index of
ds’s first ping.- x_axis, y_axisstr
One of
BOX_AXES.- along_tracknp.ndarray, optional
Along-track meters per
dsping (meters axes;Nonefalls back to the local ping index).
- Returns:
- (x, y, x_scale, y_scale) or None
x_scale/y_scaleconvert one pixel (sample, ping) into axis units: 1.0 on the pixel axes; meters per sample (mean_sample_spacing_m()) and per ping (median_ping_spacing_m()) on the meters axes.Nonewhen the target has no sample, lies outsideds, has no finite across-track position, or the axes are unsupported.
- sidescanpy.targets.waterfall.waterfall_boxes(ds, boxes, ping_offset, x_axis, y_axis, box_size)#
Rectangles for every
(target, global_ping_idx)placeable on these axes.box_sizeis in pixels (samples x pings) and is scaled into axis units per target (seetarget_waterfall_position()).
- sidescanpy.targets.waterfall.targets_by_global_ping(placements, freq_key, file_start_ping)#
Targets on
freq_key, keyed by their ping in a concatenated survey.- Parameters:
- placementssequence of CatalogPlacement
From
correlate_catalog().- freq_keystr
- file_start_pingdict
{path: first global ping}of each concatenated file (files withoutfreq_keyare absent).