sidescanpy.io.xtf.subset#
Cut a run of pings out of an XTF file, byte for byte.
write_subset() copies the file header and every packet from the
first kept sonar ping up to (not including) the sonar ping after the last
kept one, unchanged. Non-sonar packets inside that span (navigation,
attitude, notes) are kept; those before or after it are not. Used to make
small test fixtures from public recordings.
2026 rshomberg@uri.edu
Contents
Write sonar pings |
- sidescanpy.io.xtf.subset.write_subset(src, dst, *, n_pings, start_ping=0)#
Write sonar pings
start_pingtostart_ping + n_pingsofsrctodst.- Parameters:
- src, dststr or Path
Source XTF file and output file (overwritten).
- n_pingsint
Sonar packets (pings) to keep.
- start_pingint, default 0
Index of the first sonar packet kept.
- Returns:
- int
Number of sonar pings written (fewer than
n_pingsif the file ends first).