sidescanpy.io.jsf.subset#

Cut a run of pings out of a JSF file, byte for byte.

write_subset() copies every message from the first sonar data message (type 80) of the first kept ping up to (not including) the first sonar data message of the ping after the last kept one, unchanged. A ping is a distinct ping_number among sonar data messages, so every channel and subsystem of a kept ping is kept. Other messages inside that span (navigation, attitude, system information) are kept; those before or after it are not. Used to make small test fixtures from public recordings.

2026 rshomberg@uri.edu

Contents

write_subset

Write pings start_ping to start_ping + n_pings of src to dst.

sidescanpy.io.jsf.subset.write_subset(src, dst, *, n_pings, start_ping=0)#

Write pings start_ping to start_ping + n_pings of src to dst.

Parameters:
src, dststr or Path

Source JSF file and output file (overwritten).

n_pingsint

Pings (distinct sonar ping_number values) to keep.

start_pingint, default 0

Index of the first ping kept, counting distinct ping numbers in file order.

Returns:
int

Number of pings written (fewer than n_pings if the file ends first).