split_packet_bytes¶
- ccsdspy.utils.split_packet_bytes(file, include_primary_header=True)[source]¶
Retrieve a list of bytes objects corresponding to each packet 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)
- Returns:
- packet_byteslist of bytes
List of bytes objects associated with each packet as it appears in the file. When include_primary_header=False, each byte object will have its primary header bytes excluded.