def initDataRingBuffer(self):
    '[initialize the data ring buffer, by getting some seed messages and datapackets to get the data sizes etc.]\n\n        Returns:\n            [type]: [description]\n        '
    print('geting some initial data to setup the ring buffer')
    databuf = []
    nmsg = 0
    iter = 0
    data_start_ts = None
    data_ts = 0
    while ((data_start_ts is None) or ((data_ts - data_start_ts) < 3000)):
        msgs = self.getNewMessages(100)
        for m in msgs:
            m = self.preprocess_message(m)
            if (m.msgID == DataPacket.msgID):
                if (len(m.samples) > 0):
                    databuf.append(m)
                    if (data_start_ts is None):
                        data_start_ts = m.timestamp
                    data_ts = m.timestamp
                else:
                    print('Huh? got empty data packet: {}'.format(m))
            else:
                self.msg_ringbuffer.append(m)
                self.msg_timestamp = m.timestamp
                nmsg = (nmsg + 1)
    nsamp = [len(m.samples) for m in databuf]
    data_ts = [m.timestamp for m in databuf]
    if (self.raw_fs is None):
        self.raw_fs = np.median(((np.array(nsamp[1:]) / np.diff(data_ts)) * 1000.0))
    print('Estimated sample rate {} samp in {} s ={}'.format(sum(nsamp), ((data_ts[(- 1)] - data_ts[0]) / 1000.0), self.raw_fs))
    if self.data_preprocessor:
        self.data_preprocessor.fit(np.array(databuf[0].samples)[0:1, :], fs=self.raw_fs)
    tmpdatabuf = [self.processDataPacket(m) for m in databuf]
    tmpdatabuf = [d for d in tmpdatabuf if (d.shape[0] > 0)]
    pp_nsamp = [m.shape[0] for m in tmpdatabuf]
    pp_ts = [m[((- 1), (- 1))] for m in tmpdatabuf]
    self.fs = np.median(((np.array(pp_nsamp[1:]) / np.diff(pp_ts)) * 1000.0))
    print('Estimated pre-processed sample rate={}'.format(self.fs))
    if self.data_ringbuffer:
        print('Warning: re-init data ring buffer')
    self.data_ringbuffer = RingBuffer(maxsize=((self.fs * self.datawindow_ms) / 1000), shape=tmpdatabuf[0].shape[1:], dtype=np.float32)
    self.data_timestamp = None
    nsamp = 0
    if self.data_preprocessor:
        self.data_preprocessor.fit(np.array(databuf[0].samples)[0:1, :], fs=self.raw_fs)
    if ((self.sample2timestamp is None) or isinstance(self.sample2timestamp, str)):
        self.sample2timestamp = timestamp_interpolation(fs=self.fs, sample2timestamp=self.sample2timestamp)
    for m in databuf:
        d = self.processDataPacket(m)
        self.data_ringbuffer.extend(d)
        nsamp = (nsamp + d.shape[0])
    return (nsamp, nmsg)
[initialize the data ring buffer, by getting some seed messages and datapackets to get the data sizes etc.]

Returns:
    [type]: [description]
def initDataRingBuffer(self):
    '[initialize the data ring buffer, by getting some seed messages and datapackets to get the data sizes etc.]\n\n        Returns:\n            [type]: [description]\n        '
    print('geting some initial data to setup the ring buffer')
    databuf = []
    nmsg = 0
    iter = 0
    data_start_ts = None
    data_ts = 0
    while ((data_start_ts is None) or ((data_ts - data_start_ts) < 3000)):
        msgs = self.getNewMessages(100)
        for m in msgs:
            m = self.preprocess_message(m)
            if (m.msgID == DataPacket.msgID):
                if (len(m.samples) > 0):
                    databuf.append(m)
                    if (data_start_ts is None):
                        data_start_ts = m.timestamp
                    data_ts = m.timestamp
                else:
                    print('Huh? got empty data packet: {}'.format(m))
            else:
                self.msg_ringbuffer.append(m)
                self.msg_timestamp = m.timestamp
                nmsg = (nmsg + 1)
    nsamp = [len(m.samples) for m in databuf]
    data_ts = [m.timestamp for m in databuf]
    if (self.raw_fs is None):
        self.raw_fs = np.median(((np.array(nsamp[1:]) / np.diff(data_ts)) * 1000.0))
    print('Estimated sample rate {} samp in {} s ={}'.format(sum(nsamp), ((data_ts[(- 1)] - data_ts[0]) / 1000.0), self.raw_fs))
    if self.data_preprocessor:
        self.data_preprocessor.fit(np.array(databuf[0].samples)[0:1, :], fs=self.raw_fs)
    tmpdatabuf = [self.processDataPacket(m) for m in databuf]
    tmpdatabuf = [d for d in tmpdatabuf if (d.shape[0] > 0)]
    pp_nsamp = [m.shape[0] for m in tmpdatabuf]
    pp_ts = [m[((- 1), (- 1))] for m in tmpdatabuf]
    self.fs = np.median(((np.array(pp_nsamp[1:]) / np.diff(pp_ts)) * 1000.0))
    print('Estimated pre-processed sample rate={}'.format(self.fs))
    if self.data_ringbuffer:
        print('Warning: re-init data ring buffer')
    self.data_ringbuffer = RingBuffer(maxsize=((self.fs * self.datawindow_ms) / 1000), shape=tmpdatabuf[0].shape[1:], dtype=np.float32)
    self.data_timestamp = None
    nsamp = 0
    if self.data_preprocessor:
        self.data_preprocessor.fit(np.array(databuf[0].samples)[0:1, :], fs=self.raw_fs)
    if ((self.sample2timestamp is None) or isinstance(self.sample2timestamp, str)):
        self.sample2timestamp = timestamp_interpolation(fs=self.fs, sample2timestamp=self.sample2timestamp)
    for m in databuf:
        d = self.processDataPacket(m)
        self.data_ringbuffer.extend(d)
        nsamp = (nsamp + d.shape[0])
    return (nsamp, nmsg)