def read_data(self, dstart=None, dend=None):
        """Read data from `file` and return it as Numpy array.

        Parameters
        ----------
        dstart : int, optional
            Offset in bytes of the data field. By default, it is taken to
            be the header size as determined from reading the header.
            Backwards indexing with negative values is also supported.
            Use a value larger than the header size to extract a data subset.
        dend : int, optional
            End position in bytes until which data is read (exclusive).
            Backwards indexing with negative values is also supported.
            Use a value different from the file size to extract a data subset.

        Returns
        -------
        data : `numpy.ndarray`
            The data read from `file`.

        See Also
        --------
        read_header
        """
        self.file.seek(0, 2)  # 2 means "from the end"
        filesize_bytes = self.file.tell()
        if dstart is None:
            dstart_abs = int(self.header_size)
        elif dstart < 0:
            dstart_abs = filesize_bytes + int(dstart)
        else:
            dstart_abs = int(dstart)

        if dend is None:
            dend_abs = int(filesize_bytes)
        elif dend < 0:
            dend_abs = int(dend) + filesize_bytes
        else:
            dend_abs = int(dend)

        if dstart_abs >= dend_abs:
            raise ValueError('invalid `dstart` and `dend`, resulting in '
                             'absolute `dstart` >= `dend` ({} >= {})'
                             ''.format(dstart_abs, dend_abs))
        if dstart_abs < self.header_size:
            raise ValueError('invalid `dstart`, resulting in absolute '
                             '`dstart` < `header_size` ({} < {})'
                             ''.format(dstart_abs, self.header_size))
        if dend_abs > filesize_bytes:
            raise ValueError('invalid `dend`, resulting in absolute '
                             '`dend` > `filesize_bytes` ({} < {})'
                             ''.format(dend_abs, filesize_bytes))

        num_elems = (dend_abs - dstart_abs) / self.data_dtype.itemsize
        if num_elems != int(num_elems):
            raise ValueError(
                'trying to read {} bytes, which is not a multiple of '
                'the itemsize {} of the data type {}'
                ''.format(dend_abs - dstart_abs, self.data_dtype.itemsize,
                          self.data_dtype))
        self.file.seek(dstart_abs)
        array = np.empty(int(num_elems), dtype=self.data_dtype)
        self.file.readinto(array.data)
        return array
Read data from `file` and return it as Numpy array.

        Parameters
        ----------
        dstart : int, optional
            Offset in bytes of the data field. By default, it is taken to
            be the header size as determined from reading the header.
            Backwards indexing with negative values is also supported.
            Use a value larger than the header size to extract a data subset.
        dend : int, optional
            End position in bytes until which data is read (exclusive).
            Backwards indexing with negative values is also supported.
            Use a value different from the file size to extract a data subset.

        Returns
        -------
        data : `numpy.ndarray`
            The data read from `file`.

        See Also
        --------
        read_header