split_by_apid

ccsdspy.utils.split_by_apid(mixed_file, valid_apids=None)[source]

Split a stream of mixed APIDs into separate streams by APID.

Parameters
mixed_file: str, file-like

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

valid_apids: list of int, None

Optional list of valid APIDs. If specified, warning will be issued when an APID is encountered outside this list.

Returns
Dictionary mapping integer apid number to BytesIO instance with the file
pointer at the beginning of the stream.