diplomat.utils.frame_store_fmt.DLFSReader¶
- class diplomat.utils.frame_store_fmt.DLFSReader(file: BinaryIO)[source]¶
Bases:
FrameReaderA DIPLOMAT Frame Store Reader. Allows for reading “.dlfs” files.
- __init__(file: BinaryIO)[source]¶
Create a new DIPLOMAT Frame Store Reader.
- Parameters:
file – The binary file object to read a frame store from, file opened with ‘rb’.
Methods
__init__(file)Create a new DIPLOMAT Frame Store Reader.
close()Close this frame reader, cleaning up any resources used during reading from the file.
Get the header of this Diplomat frame store file.
has_next([num_frames])Checks if this frame store object at least num_frames more frames to be read.
read_frames([num_frames])Read the next num_frames frames from this frame store object and returns a TrackingData object.
seek_frame(frame_idx)Make this frame reader seek to the given frame index.
Get the current frame the frame reader is on.
Attributes
HEADER_DATA_TYPES- HEADER_OFFSETS = array([ 4, 12, 16, 20, 24, 32, 40, 44, 48, 52])¶
- _assert_true(assertion: bool, error_msg: str)[source]¶
Private method, if the assertion is false, throws a ValueError.
- close()[source]¶
Close this frame reader, cleaning up any resources used during reading from the file. Does not close the passed file handle!
- get_header() DLFSHeader[source]¶
Get the header of this Diplomat frame store file.
- Returns:
A DLFSHeader object, contains important metadata info from this frame store.
- has_next(num_frames: int = 1) bool[source]¶
Checks if this frame store object at least num_frames more frames to be read.
- Parameters:
num_frames – An Integer, The number of frames to check the availability of, defaults to 1.
- Returns:
True if there are at least num_frames more frames to be read, otherwise False.
- read_frames(num_frames: int = 1) TrackingData[source]¶
Read the next num_frames frames from this frame store object and returns a TrackingData object.
- Parameters:
num_frames – The number of frames to read from the frame store.
- Returns:
A TrackingData object storing all frame info that was stored in this Diplomat Frame Store….
- Raises:
An EOFError if more frames were requested then were available.