validate¶
- ccsdspy.utils.validate(file, valid_apids=None)[source]¶
Validate a file containing CCSDS packets and capturing any exceptions or warnings they generate. This function checks:
Primary header consistency (sequence counts in order, no missing sequence numbers, found APIDs)
File integrity (truncation, extra bytes)
- Parameters:
- file: str or BytesIO
A file path or file-like object with a
read()method.- valid_apids: list of int, optional
Optional list of valid APIDs. If specified, warning will be issued when an APID is encountered outside this list.
- Returns:
- List of
LogRecord, describing potential validation issues. Returns an empty list if no warnings are issued.
- List of