def read_xreim(filename):
    f = open(filename, 'r')
    # first pass, determine NP
    for iline, line in enumerate(f):
        pass
    NP = int(iline + 1)

    # second pass, place text-data into data and unit arrays
    f.seek(0)
    data = np.empty((NP, ), dtype='complex64')
    units = np.empty((NP, ), dtype='float32')

    for l_idx, line in enumerate(f):
        np_unit, r_val, i_val = [float(i) for i in line.split()]
        units[l_idx] = np_unit
        data.real[l_idx] = r_val
        data.imag[l_idx] = i_val

    f.close()
    return {'units': units}, data
Notify all extension drivers during port creation.
dataset/ETHPy150Open jjhelmus/nmrglue/nmrglue/fileio/simpson.py/read_xreim--crossover with--dataset/ETHPy150Open openstack/neutron/neutron/plugins/ml2/managers.py/ExtensionManager.process_create_port