Data Reader

Class for reading data from a file-like object which is seekable.

class bosdyn.bddf.data_reader.DataReader(infile=None, filename=None)[source]

Bases: BaseDataReader

Class for reading data from a file-like object which is seekable.

Methods raise ParseError if there is a problem with the format of the file.

series_descriptor(series_index)[source]

Return SeriesDescriptor for given series index, loading it if necessary.

num_data_blocks(series_index)[source]

Returns the number of data blocks for a given series in the file.

total_bytes(series_index)[source]

Returns the total number of bytes for data in a given series in the file.

read(series_index, index_in_series)[source]

Retrieves a message and related information from the file.

Parameters:
  • series_index – int selecting from which series to read the message.

  • index_in_series – The index number of the message within the channel.

Returns: DataTypeDescriptor for channel, timestamp_nsec (int), message-data (bytes)

Raises ParseError if there is a problem with the format of the file.

series_block_index(series_index)[source]

Returns the SeriesBlockIndexes for the given series_index, loading it as needed.