blimpy/guppi.py
def find_n_data_blocks(self):
        """ Seek through the file to find how many data blocks there are in the file

        Returns:
            n_blocks (int): number of data blocks in the file
        """
        self.file_obj.seek(0)
        header0, data_idx0 = self.read_header()

        self.file_obj.seek(data_idx0)
        block_size = int(header0['BLOCSIZE'])
        n_bits = int(header0['NBITS'])
        self.file_obj.seek(int(header0['BLOCSIZE']), 1)
        n_blocks = 1
        end_found = False
        while not end_found:
            try:
                header, data_idx = self.read_header()
                self.file_obj.seek(data_idx)
                self.file_obj.seek(header['BLOCSIZE'], 1)
                n_blocks += 1
            except EndOfFileError:
                end_found = True
                break

        self.file_obj.seek(0)
        return n_blocks
def find_n_data_blocks(self):
        """ Seek through the file to find how many data blocks there are in the file

        Returns:
            n_blocks (int): number of data blocks in the file
        """
        self.file_obj.seek(0)
        header0, data_idx0 = self.read_header()

        self.file_obj.seek(data_idx0)
        block_size = int(header0['BLOCSIZE'])
        n_bits = int(header0['NBITS'])
        self.file_obj.seek(int(header0['BLOCSIZE']), 1)
        n_blocks = 1
        end_found = False
        while not end_found:
            try:
                header, data_idx = self.read_header()
                self.file_obj.seek(data_idx)
                self.file_obj.seek(header['BLOCSIZE'], 1)
                n_blocks += 1
            except EndOfFileError:
                end_found = True
                break

        self.file_obj.seek(0)
        return n_blocks
def find_n_data_blocks ( self ) : self . file_obj . seek ( 0 ) header0 , data_idx0 = self . read_header ( ) self . file_obj . seek ( data_idx0 ) block_size = int ( header0 [ 'BLOCSIZE' ] ) n_bits = int ( header0 [ 'NBITS' ] ) self . file_obj . seek ( int ( header0 [ 'BLOCSIZE' ] ) , 1 ) n_blocks = 1 end_found = False while not end_found : try : header , data_idx = self . read_header ( ) self . file_obj . seek ( data_idx ) self . file_obj . seek ( header [ 'BLOCSIZE' ] , 1 ) n_blocks += 1 except EndOfFileError : end_found = True break self . file_obj . seek ( 0 ) return n_blocks
Seek through the file to find how many data blocks there are in the file

        Returns:
            n_blocks (int): number of data blocks in the file
Seek through the file to find how many data blocks there are in the file