def read_fid_lowmem(filename, shape=None, torder='flat', as_2d=False,
                    read_blockhead=False):
    # open the file
    f = open(filename, 'rb')

    # read the fileheader
    dic = fileheader2dic(get_fileheader(f))
    f.close()

    if dic["ntraces"] != 1:
        raise NotImplementedError

    i2tfunc = torder2i2t(torder)
    data = fid_nd(filename, i2tfunc, shape)
    return dic, data
Read a Agilent/Varian binary (fid) file using mimimal amounts of memory.
dataset/ETHPy150Open jjhelmus/nmrglue/nmrglue/fileio/varian.py/read_fid_lowmem