def read(dir=".", fid_file="fid", procpar_file="procpar", read_blockhead=False,
         shape=None, torder=None, as_2d=False):
    if os.path.isdir(dir) is False:
        raise IOError("directory %s does not exist" % (dir))

    # read in the procpar file
    pdic = read_procpar(os.path.join(dir, procpar_file))

    # determine shape and torder is needed
    if as_2d is False:
        if shape is None:
            shape = find_shape(pdic)
        if torder is None and shape is not None and len(shape) >= 3:
            torder = find_torder(pdic, shape)

    # read in the fid file
    fname = os.path.join(dir, fid_file)
    dic, data = read_fid(fname, shape, torder, as_2d, read_blockhead)

    # add the procpar dictionary to the main dictionary
    dic["procpar"] = pdic

    return dic, data
Read Agilent/Varian files in a directory.
dataset/ETHPy150Open jjhelmus/nmrglue/nmrglue/fileio/varian.py/read