def read_xyreim(filename):
    f = open(filename, 'r')

    # first pass, determine NP, NI
    blines = 0  # number of blank lines, gives us num. of indirect points
    for nline, line in enumerate(f):
        if line == '\n':
            if blines == 0:     # location of first blank line gives us NP
                NP = int(nline)
            blines += 1
    NI = blines

    # second pass, place text-data into data and unit arrays
    f.seek(0)
    data = np.empty((NI, NP), dtype='complex64')
    units = np.recarray((NI, NP), dtype=[('ni_unit', 'f8'), ('np_unit', 'f8')])

    for l_idx, line in enumerate(f):
        ni_idx, np_idx = divmod(l_idx, NP + 1)  # determine indicies
        if np_idx == NP:    # skip blank line between blocks
            continue
        # unpack the line and store
        ni_unit, np_unit, r_val, i_val = [float(i) for i in line.split()]
        data.real[ni_idx, np_idx] = r_val
        data.imag[ni_idx, np_idx] = i_val
        units[ni_idx, np_idx].ni_unit = ni_unit
        units[ni_idx, np_idx].np_unit = np_unit

    f.close()
    return {'units': units}, data


######################
# Read raw_bin files #
######################
Read a 2D indexed SIMPSON file. See :py:func:`read`.
dataset/ETHPy150Open jjhelmus/nmrglue/nmrglue/fileio/simpson.py/read_xyreim