#NEWLINE# def get_nblocks_ntraces( f , nblocks , ntraces , pts , nbheaders , dt , read_blockhead ) : #NEWLINE# #INDENT# '\n    Read multiple blocks from a Agilent/Varian binary file which may have\n    multiple traces per block.\n\n    Parameters\n    ----------\n    f : file object\n        File object of open Agilent/Varian binary file.\n    nblock : int\n        Number of blocks to read.\n    ntrace : int\n        Number of traces per block\n    pts : int\n        Number of points per trace.\n    nbheaders : int\n        Number of block header in each block.\n    dt : dtype\n        Data type of data in binary file (real type).\n    read_blockheaders : bool\n        True to read the blockheader(s) and return them in the returned\n        dictionary.  False ignores blockheader, reading over them.\n\n    Returns\n    -------\n    dic : dict, optional\n        Dictionary of blockheaders, only returned if read_blockheaders is True.\n    data : 2D ndarray of size (nblocks * ntraces, pts)\n        Array of read blocks.\n\n    ' #NEWLINE# data = np . empty ( ( ( nblocks * ntraces ) , pts ) , dtype = nbheaders ) #NEWLINE# if read_blockhead : #NEWLINE# #INDENT# bdic = ( [ 0 ] * nblocks ) #NEWLINE# #UNINDENT# for i in range ( nblocks ) : #NEWLINE# #INDENT# if read_blockhead : #NEWLINE# #INDENT# ( bdic [ i ] , bdata ) = get_block_ntraces ( f , ntraces , pts , nbheaders , dt , True ) #NEWLINE# data [ ( i * ntraces ) : ( ( i + 1 ) * ntraces ) ] = bdata #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# bdata = get_block_ntraces ( f , ntraces , pts , nbheaders , dt , False ) #NEWLINE# data [ ( i * ntraces ) : ( ( i + 1 ) * ntraces ) ] = bdata #NEWLINE# #UNINDENT# #UNINDENT# if read_blockhead : #NEWLINE# #INDENT# return ( bdic , data ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return data