iter_packet_bytes

ccsdspy.utils.iter_packet_bytes(file, include_primary_header=True)[source]

Iterate through packets as raw bytes objects, in the order they appear in a file.

This function works with mixed files containing multiple APIDs, which may include both fixed length and variable length packets.

If end of last packet doesn’t align with end of file, a warning is issued.

Parameters:
filestr, file-like

Path to file on the local file system, or file-like object

include_primary_headerbool

If set to False, excludes the primary header bytes (the first six)

Yields:
packet_bytesbytes

Bytes associated with each packet as it appears in the file. When include_primary_header=False, the primary header bytes are excluded.