def main(args):
    data_file_list = tl.get_data_file_list(args.library)
    if args.list:
        tl.print_list(data_file_list)
        sys.exit(0)
    data = tl.load_data_file(data_file_list, args.select)

    if not args.static:
        logging.debug('Remove zero velocity samples')
        data = ntp.remove_non_positive_velocity_samples(data)

    # Get basic data
    ntp.process_data(data, ntp.process_lte_bw)
    # Now check for difference between 10 and 15 MHz
    ntp.process_data(data, ntp.process_lte_rsrp)
    ntp.process_data(data, ntp.process_lte_rsrp_bw)

    column_list = [
        'RSRP (serving)', 'RSRP (serving) 10', 'RSRP (serving) 15',
        'RSRP/Antenna port - 1', 'RSRP/Antenna port - 1 10',
        'RSRP/Antenna port - 1 15', 'RSRP/Antenna port - 2',
        'RSRP/Antenna port - 2 10', 'RSRP/Antenna port - 2 15'
    ]
    if args.select is None:
        df = tl.concat_pandas_data([df[column_list] for df in data])
    else:
        df = data

    plt.ion()
    plt.figure()
    plt.subplot2grid((2, 1), (0, 0))
    x = np.linspace(-140, -50, 91)
    dpl.plot_ecdf_triplet(df['RSRP/Antenna port - 1 10'].dropna(),
                          df['RSRP/Antenna port - 1'].dropna(),
                          df['RSRP/Antenna port - 1 15'].dropna(), x,
                          'RSRP AP1 10 MHz', 'RSRP AP1', 'RSRP AP1 15 MHz',
                          'dB')
    if args.blind:
        plt.xticks([])
    plt.subplot2grid((2, 1), (1, 0))
    dpl.plot_ecdf_triplet(df['RSRP/Antenna port - 2 10'].dropna(),
                          df['RSRP/Antenna port - 2'].dropna(),
                          df['RSRP/Antenna port - 2 15'].dropna(), x,
                          'RSRP AP2 10 MHz', 'RSRP AP2', 'RSRP AP2 15 MHz',
                          'dB')
    if args.blind:
        plt.xticks([])
    if args.print:
        plt.savefig(args.print, dpi=300, bbox_inches='tight')

    input('Press any key')
def main(args):
    data_file_list = tl.get_data_file_list(args.library)
    if args.list:
        tl.print_list(data_file_list)
        sys.exit(0)
    data = tl.load_data_file(data_file_list,args.select)

    if not args.static:
        logging.debug('Remove zero velocity samples')
        data = ntp.remove_non_positive_velocity_samples(data)

    # Get basic data
    ntp.process_data(data,ntp.process_lte_bw)
    # Now check for difference between 10 and 15 MHz
    ntp.process_data(data,ntp.process_lte_rsrp)
    ntp.process_data(data,ntp.process_lte_rsrp_bw)

    column_list = ['RSRP (serving)','RSRP (serving) 10','RSRP (serving) 15',
                   'RSRP/Antenna port - 1','RSRP/Antenna port - 1 10','RSRP/Antenna port - 1 15',
                   'RSRP/Antenna port - 2','RSRP/Antenna port - 2 10','RSRP/Antenna port - 2 15']
    if args.select is None:
        df = tl.concat_pandas_data([df[column_list] for df in data ])
    else:
        df = data


    plt.ion()
    plt.figure()
    plt.subplot2grid((2,1), (0,0))
    x = np.linspace(-140,-50,91)
    dpl.plot_ecdf_triplet(df['RSRP/Antenna port - 1 10'].dropna(),
                          df['RSRP/Antenna port - 1'].dropna(),
                          df['RSRP/Antenna port - 1 15'].dropna(),x,
                          'RSRP AP1 10 MHz','RSRP AP1','RSRP AP1 15 MHz','dB')
    if args.blind:
        plt.xticks([])
    plt.subplot2grid((2,1), (1,0))
    dpl.plot_ecdf_triplet(df['RSRP/Antenna port - 2 10'].dropna(),
                          df['RSRP/Antenna port - 2'].dropna(),
                          df['RSRP/Antenna port - 2 15'].dropna(),x,
                          'RSRP AP2 10 MHz','RSRP AP2','RSRP AP2 15 MHz','dB')
    if args.blind:
        plt.xticks([])
    if args.print:
        plt.savefig(args.print,dpi=300,bbox_inches='tight')

    input('Press any key')
Example #3
0
def main(args):
    data_file_list = tl.get_data_file_list(args.library)
    if args.list:
        tl.print_list(data_file_list)
        sys.exit(0)
    data = tl.load_data_file(data_file_list, args.select)

    if not args.static:
        logging.debug('Remove zero velocity samples')
        data = ntp.remove_non_positive_velocity_samples(data)

    # Get basic data
    ntp.process_data(data, ntp.process_velocity)
    ntp.process_data(data, ntp.process_lte_bw)
    ntp.process_data(data, ntp.process_lte_prb_util)
    ntp.process_data(data, ntp.process_lte_prb_util_bw)

    column_list = [
        'Velocity', 'Velocity full', 'DL bandwidth', 'DL bandwidth full',
        'PRB utilization DL', 'PRB utilization DL full',
        'PRB utilization DL 10', 'PRB utilization DL 15'
    ]
    if args.select is None:
        df = tl.concat_pandas_data([df[column_list] for df in data])
    else:
        df = data

    print(df['PRB utilization DL'].describe())
    print(df['PRB utilization DL 10'].describe())
    print(df['PRB utilization DL 15'].describe())
    plt.ion()
    plt.figure()
    x = np.arange(0, 100, 1)
    dpl.plot_ecdf_triplet(df['PRB utilization DL'].dropna(),
                          df['PRB utilization DL 10'].dropna(),
                          df['PRB utilization DL 15'].dropna(), x, 'PRB util.',
                          'PRB util. 10 MHz', 'PRB util. 15 MHz', '%')
    plt.legend(loc=0)
    if args.print:
        plt.savefig(args.print, dpi=300, bbox_inches='tight')

    input('Press any key')
def main(args):
    data_file_list = tl.get_data_file_list(args.library)
    if args.list:
        tl.print_list(data_file_list)
        sys.exit(0)
    data = tl.load_data_file(data_file_list,args.select)

    if not args.static:
        logging.debug('Remove zero velocity samples')
        data = ntp.remove_non_positive_velocity_samples(data)

    # Get basic data
    ntp.process_data(data,ntp.process_velocity)
    ntp.process_data(data,ntp.process_lte_bw)
    ntp.process_data(data,ntp.process_lte_prb_util)
    ntp.process_data(data,ntp.process_lte_prb_util_bw)

    column_list = ['Velocity', 'Velocity full',
                   'DL bandwidth','DL bandwidth full',
                   'PRB utilization DL','PRB utilization DL full',
                   'PRB utilization DL 10','PRB utilization DL 15']
    if args.select is None:
        df = tl.concat_pandas_data([df[column_list] for df in data ])
    else:
        df = data


    print(df['PRB utilization DL'].describe())
    print(df['PRB utilization DL 10'].describe())
    print(df['PRB utilization DL 15'].describe())
    plt.ion()
    plt.figure()
    x = np.arange(0,100,1)
    dpl.plot_ecdf_triplet(df['PRB utilization DL'].dropna(),
                          df['PRB utilization DL 10'].dropna(),
                          df['PRB utilization DL 15'].dropna(),x,
                          'PRB util.','PRB util. 10 MHz','PRB util. 15 MHz','%')
    plt.legend (loc=0)
    if args.print:
        plt.savefig(args.print,dpi=300,bbox_inches='tight')

    input('Press any key')
def main(args):
    data_file_list = tl.get_data_file_list(args.library)
    if args.list:
        tl.print_list(data_file_list)
        sys.exit(0)
    data = tl.load_data_file(data_file_list, args.select)

    if not args.static:
        logging.debug('Remove zero velocity samples')
        data = ntp.remove_non_positive_velocity_samples(data)

    if args.ue == 'e398':
        # Rename MAC downlink throughput in Application downlink throughput if need be
        ntp.process_data(data, ntp.process_lte_rename_mac_to_app)

    # Get basic data
    ntp.process_data(data, ntp.process_lte_app_bw_prb_util)
    ntp.process_data(data, ntp.process_lte_app_bw_prb_util_bw20)
    ntp.process_data(data, ntp.process_lte_app_bw_prb_util_bw10)
    ntp.process_data(data, ntp.process_lte_app_bw_prb_util_bw15)

    # Spectral efficiency
    ntp.process_data(data, ntp.process_se_bw_norm)

    column_list = [
        'DL bandwidth', 'DL bandwidth full', 'PRB utilization DL',
        'PRB utilization DL full', 'PRB utilization DL 10',
        'PRB utilization DL 15', 'PRB utilization DL 20', 'SE', 'SE norm',
        'SE 10 norm', 'SE 15 norm', 'SE 20 norm'
    ]
    if args.select is None:
        df = tl.concat_pandas_data([df[column_list] for df in data])
    else:
        df = data

    print(df['SE'].describe())
    print(df['SE norm'].describe())

    # Remove outliers because of bandwidth normalization issues
    df['SE norm'][df['SE norm'] > 7.5] = np.nan

    print('90% percentile for SE norm: {:.1f} bit/s/Hz'.format(
        np.percentile(df['SE norm'].dropna(), 90)))
    print('95% percentile for SE norm: {:.1f} bit/s/Hz'.format(
        np.percentile(df['SE norm'].dropna(), 95)))
    print('99% percentile for SE norm: {:.1f} bit/s/Hz'.format(
        np.percentile(df['SE norm'].dropna(), 99)))

    print(df['SE 10 norm'].describe())
    print(df['SE 15 norm'].describe())
    print(df['SE 20 norm'].describe())
    plt.ion()

    plt.figure()
    plt.subplot2grid((2, 2), (0, 0), colspan=2)
    x = np.arange(0, 8.1, 0.1)
    dpl.plot_ecdf_pair(df['SE norm'].dropna(), df['SE'].dropna(), x,
                       'Spectral efficiency (PRB norm.)',
                       'Spectral efficiency', 'bit/s/Hz')
    plt.legend(loc=0)
    plt.subplot2grid((2, 2), (1, 0), colspan=1)
    dpl.plot_density(df['SE'].replace([np.inf, -np.inf], np.nan).dropna(), x,
                     'Spectral efficiency', 'bit/s/Hz')
    plt.subplot2grid((2, 2), (1, 1), colspan=1)
    dpl.plot_density(
        df['SE norm'].where(df['SE norm'] < 8).replace([np.inf, -np.inf],
                                                       np.nan).dropna(), x,
        'Spectral efficiency (PRB norm.)', 'bit/s/Hz')

    if args.print:
        plt.savefig(args.print[0], dpi=300, bbox_inches='tight')

    plt.figure()
    if len(df['SE 15 norm'].dropna()) > 0:
        dpl.plot_ecdf_triplet(df['SE 10 norm'].dropna(),
                              df['SE norm'].dropna(),
                              df['SE 15 norm'].dropna(), x,
                              'Spectral efficiency 10 MHz (PRB norm.)\n',
                              'Spectral efficiency (PRB norm.)\n',
                              'Spectral efficiency 15 MHz (PRB norm.)',
                              'bit/s/Hz')
    else:
        dpl.plot_ecdf_pair(df['SE 10 norm'].dropna(), df['SE norm'].dropna(),
                           x, 'Spectral efficiency 10 MHz (PRB norm.)\n',
                           'Spectral efficiency (PRB norm.)\n', 'bit/s/Hz')
    plt.legend(loc=0)
    if args.print:
        plt.savefig(args.print[1], dpi=300, bbox_inches='tight')

    plt.figure()
    if len(df['SE 15 norm'].dropna()) > 0:
        dpl.plot_ecdf_quad(df['SE 10 norm'].dropna(), df['SE norm'].dropna(),
                           df['SE 15 norm'].dropna(), df['SE'].dropna(), x,
                           'SE 10 MHz (PRB norm.)', 'SE (PRB norm.)',
                           'SE 15 MHz (PRB norm.)', 'SE', 'bit/s/Hz')
        plt.xlabel('[bit/s/Hz]')
    else:
        dpl.plot_ecdf_triplet(df['SE 10 norm'].dropna(),
                              df['SE norm'].dropna(), df['SE'].dropna(), x,
                              'Spectral efficiency 10 MHz (PRB norm.)\n',
                              'Spectral efficiency (PRB norm.)\n',
                              'Spectral efficiency', 'bit/s/Hz')
    plt.legend(loc='best')
    plt.tight_layout()
    if args.print:
        plt.savefig(args.print[2], dpi=300, bbox_inches='tight')

    input('Press any key')
def main(args):
    data_file_list = tl.get_data_file_list(args.library)
    if args.list:
        tl.print_list(data_file_list)
        sys.exit(0)
    data = tl.load_data_file(data_file_list, args.select)

    if not args.static:
        logging.debug('Remove zero velocity samples')
        data = ntp.remove_non_positive_velocity_samples(data)

    if args.ue == 'e398':
        # Rename MAC downlink throughput in Application downlink throughput if need be
        ntp.process_data(data, ntp.process_lte_rename_mac_to_app)

    # Get basic data
    ntp.process_data(data, ntp.process_lte_app_bw_prb_util)
    ntp.process_data(data, ntp.process_lte_app_bw_prb_util_bw20)
    ntp.process_data(data, ntp.process_lte_app_bw_prb_util_bw10)
    ntp.process_data(data, ntp.process_lte_app_bw_prb_util_bw15)

    column_list = [
        'Application throughput downlink',
        'Application throughput downlink 10',
        'Application throughput downlink 15',
        'Application throughput downlink 20'
    ]
    if args.select is None:
        df = tl.concat_pandas_data([df[column_list] for df in data])
    else:
        df = data

    print(df['Application throughput downlink'].describe())
    print(df['Application throughput downlink 10'].describe())
    print(df['Application throughput downlink 15'].describe())
    print(df['Application throughput downlink 20'].describe())

    # Normalize
    f_norm = lambda x: x / 1e6

    plt.ion()
    plt.figure()
    plt.subplot2grid((2, 3), (0, 0), colspan=3)
    x = np.arange(0, 120, 1)
    dpl.plot_ecdf_triplet(
        df['Application throughput downlink 10'].dropna().apply(f_norm),
        df['Application throughput downlink'].dropna().apply(f_norm),
        df['Application throughput downlink 15'].dropna().apply(f_norm), x,
        'Application th. (10 MHz)', 'Application th.',
        'Application th. (15 MHz)', 'Mbit/s')
    plt.legend(loc=0)
    plt.subplot2grid((2, 3), (1, 0), colspan=1)
    dpl.plot_density(
        df['Application throughput downlink'].dropna().apply(f_norm), x,
        'App. th.', 'Mbit/s')
    plt.subplot2grid((2, 3), (1, 1), colspan=1)
    dpl.plot_density(
        df['Application throughput downlink 10'].dropna().apply(f_norm), x,
        'App. th. 10 MHz', 'Mbit/s')
    plt.subplot2grid((2, 3), (1, 2), colspan=1)
    dpl.plot_density(
        df['Application throughput downlink 15'].dropna().apply(f_norm), x,
        'App. th. 15 MHz', 'Mbit/s')

    if args.print:
        plt.savefig(args.print, dpi=300, bbox_inches='tight')

    input('Press any key')
def main(args):
    data_file_list = tl.get_data_file_list(args.library)
    if args.list:
        tl.print_list(data_file_list)
        sys.exit(0)
    data = tl.load_data_file(data_file_list,args.select)

    if not args.static:
        logging.debug('Remove zero velocity samples')
        data = ntp.remove_non_positive_velocity_samples(data)

    # Get basic data
    ntp.process_data(data,ntp.process_lte_bw)
    # Now check the RS-SNR difference between 10 and 15 MHz
    ntp.process_data(data,ntp.process_lte_rs_snr)
    ntp.process_data(data,ntp.process_lte_rs_snr_bw)

    column_list = ['DL bandwidth','DL bandwidth full',
                   'RS SNR/Antenna port - 1','RS SNR/Antenna port - 1 10','RS SNR/Antenna port - 1 15',
                   'RS SNR/Antenna port - 2','RS SNR/Antenna port - 2 10','RS SNR/Antenna port - 2 15']
    if args.select is None:
        df = tl.concat_pandas_data([df[column_list] for df in data ])
    else:
        df = data

    print(df['RS SNR/Antenna port - 1'].describe())
    print(df['RS SNR/Antenna port - 2'].describe())
    print('95% percentile for AP 1 and 2: {:.1f}, {:.1f} dB'.format(np.percentile(df['RS SNR/Antenna port - 1'].dropna(),95),np.percentile(df['RS SNR/Antenna port - 2'].dropna(),95)))
    print('99% percentile for AP 1 and 2: {:.1f}, {:.1f} dB'.format(np.percentile(df['RS SNR/Antenna port - 1'].dropna(),99),np.percentile(df['RS SNR/Antenna port - 2'].dropna(),99)))

    plt.ion()
    plt.figure()
    plt.subplot2grid((2,1), (0,0))
    x = np.linspace(-15,37,53)
    if len(df['RS SNR/Antenna port - 1 15'].dropna()) > 0:
        dpl.plot_ecdf_triplet(df['RS SNR/Antenna port - 1 10'].dropna(),
                              df['RS SNR/Antenna port - 1'].dropna(),
                              df['RS SNR/Antenna port - 1 15'].dropna(),x,
                              'RS-SNR AP1 10 MHz','RS-SNR AP1','RS-SNR AP1 15 MHz','dB')
    else:
        dpl.plot_ecdf_pair(df['RS SNR/Antenna port - 1 10'].dropna(),
                              df['RS SNR/Antenna port - 1'].dropna(),x,
                              'RS-SNR AP1 10 MHz','RS-SNR AP1','dB')
    plt.xlim([-12,33])
    if args.blind:
        plt.xticks([])
    plt.subplot2grid((2,1), (1,0))
    if len(df['RS SNR/Antenna port - 2 15'].dropna()) > 0:
        dpl.plot_ecdf_triplet(df['RS SNR/Antenna port - 2 10'].dropna(),
                              df['RS SNR/Antenna port - 2'].dropna(),
                              df['RS SNR/Antenna port - 2 15'].dropna(),x,
                              'RS-SNR AP2 10 MHz','RS-SNR AP2','RS-SNR AP2 15 MHz','dB')
    else:
        dpl.plot_ecdf_pair(df['RS SNR/Antenna port - 2 10'].dropna(),
                           df['RS SNR/Antenna port - 2'].dropna(),x,
                              'RS-SNR AP2 10 MHz','RS-SNR AP2','dB')
    plt.xlim([-12,33])
    if args.blind:
        plt.xticks([])
    if args.print:
        plt.savefig(args.print,dpi=300,bbox_inches='tight')

    input('Press any key')
def main(args):
    data_file_list = tl.get_data_file_list(args.library)
    if args.list:
        tl.print_list(data_file_list)
        sys.exit(0)
    data = tl.load_data_file(data_file_list,args.select)

    if not args.static:
        logging.debug('Remove zero velocity samples')
        data = ntp.remove_non_positive_velocity_samples(data)

    if args.ue == 'e398':
        # Rename MAC downlink throughput in Application downlink throughput if need be
        ntp.process_data(data,ntp.process_lte_rename_mac_to_app)

    # Get basic data
    ntp.process_data(data,ntp.process_lte_app_bw_prb_util)
    ntp.process_data(data,ntp.process_lte_app_bw_prb_util_bw20)
    ntp.process_data(data,ntp.process_lte_app_bw_prb_util_bw10)
    ntp.process_data(data,ntp.process_lte_app_bw_prb_util_bw15)

    column_list = ['Application throughput downlink',
                   'Application throughput downlink 10',
                   'Application throughput downlink 15',
                   'Application throughput downlink 20']
    if args.select is None:
        df = tl.concat_pandas_data([df[column_list] for df in data ])
    else:
        df = data

    print(df['Application throughput downlink'].describe())
    print(df['Application throughput downlink 10'].describe())
    print(df['Application throughput downlink 15'].describe())
    print(df['Application throughput downlink 20'].describe())

    # Normalize
    f_norm = lambda x: x/1e6

    plt.ion()
    plt.figure()
    plt.subplot2grid((2,3), (0,0),colspan=3)
    x = np.arange(0,120,1)
    dpl.plot_ecdf_triplet(df['Application throughput downlink 10'].dropna().apply(f_norm),
                          df['Application throughput downlink'].dropna().apply(f_norm),
                          df['Application throughput downlink 15'].dropna().apply(f_norm),x,
                          'Application th. (10 MHz)',
                          'Application th.',
                          'Application th. (15 MHz)',
                          'Mbit/s')
    plt.legend(loc=0)
    plt.subplot2grid((2,3), (1,0),colspan=1)
    dpl.plot_density(df['Application throughput downlink'].dropna().apply(f_norm),x,
                     'App. th.','Mbit/s')
    plt.subplot2grid((2,3), (1,1),colspan=1)
    dpl.plot_density(df['Application throughput downlink 10'].dropna().apply(f_norm),x,
                     'App. th. 10 MHz','Mbit/s')
    plt.subplot2grid((2,3), (1,2),colspan=1)
    dpl.plot_density(df['Application throughput downlink 15'].dropna().apply(f_norm),x,
                     'App. th. 15 MHz','Mbit/s')

    if args.print:
        plt.savefig(args.print,dpi=300,bbox_inches='tight')

    input('Press any key')
def main(args):
    data_file_list = tl.get_data_file_list(args.library)
    if args.list:
        tl.print_list(data_file_list)
        sys.exit(0)
    data = tl.load_data_file(data_file_list,args.select)

    if not args.static:
        logging.debug('Remove zero velocity samples')
        data = ntp.remove_non_positive_velocity_samples(data)

    if args.ue == 'e398':
        # Rename MAC downlink throughput in Application downlink throughput if need be
        ntp.process_data(data,ntp.process_lte_rename_mac_to_app)

    # Get basic data
    ntp.process_data(data,ntp.process_lte_app_bw_prb_util)
    ntp.process_data(data,ntp.process_lte_app_bw_prb_util_bw20)
    ntp.process_data(data,ntp.process_lte_app_bw_prb_util_bw10)
    ntp.process_data(data,ntp.process_lte_app_bw_prb_util_bw15)

    # Spectral efficiency
    ntp.process_data(data,ntp.process_se_bw_norm)

    column_list = ['DL bandwidth','DL bandwidth full',
                   'PRB utilization DL','PRB utilization DL full',
                   'PRB utilization DL 10','PRB utilization DL 15','PRB utilization DL 20',
                   'SE','SE norm','SE 10 norm','SE 15 norm','SE 20 norm']
    if args.select is None:
        df = tl.concat_pandas_data([df[column_list] for df in data ])
    else:
        df = data


    print(df['SE'].describe())
    print(df['SE norm'].describe())

    # Remove outliers because of bandwidth normalization issues
    df['SE norm'][df['SE norm'] > 7.5] = np.nan

    print('90% percentile for SE norm: {:.1f} bit/s/Hz'.format(np.percentile(df['SE norm'].dropna(),90)))
    print('95% percentile for SE norm: {:.1f} bit/s/Hz'.format(np.percentile(df['SE norm'].dropna(),95)))
    print('99% percentile for SE norm: {:.1f} bit/s/Hz'.format(np.percentile(df['SE norm'].dropna(),99)))

    print(df['SE 10 norm'].describe())
    print(df['SE 15 norm'].describe())
    print(df['SE 20 norm'].describe())
    plt.ion()

    plt.figure()
    plt.subplot2grid((2,2), (0,0),colspan=2)
    x = np.arange(0,8.1,0.1)
    dpl.plot_ecdf_pair(df['SE norm'].dropna(),
                       df['SE'].dropna(),x,
                       'Spectral efficiency (PRB norm.)',
                       'Spectral efficiency',
                       'bit/s/Hz')
    plt.legend(loc=0)
    plt.subplot2grid((2,2), (1,0),colspan=1)
    dpl.plot_density(df['SE'].replace([np.inf, -np.inf], np.nan).dropna(),x,
                     'Spectral efficiency','bit/s/Hz')
    plt.subplot2grid((2,2), (1,1),colspan=1)
    dpl.plot_density(df['SE norm'].where(df['SE norm'] < 8).replace([np.inf, -np.inf], np.nan).dropna(),x,
                     'Spectral efficiency (PRB norm.)','bit/s/Hz')

    if args.print:
        plt.savefig(args.print[0],dpi=300,bbox_inches='tight')

    plt.figure()
    if len(df['SE 15 norm'].dropna()) > 0:
        dpl.plot_ecdf_triplet(df['SE 10 norm'].dropna(),
                              df['SE norm'].dropna(),
                              df['SE 15 norm'].dropna(),x,
                              'Spectral efficiency 10 MHz (PRB norm.)\n',
                              'Spectral efficiency (PRB norm.)\n',
                              'Spectral efficiency 15 MHz (PRB norm.)',
                              'bit/s/Hz')
    else:
        dpl.plot_ecdf_pair(df['SE 10 norm'].dropna(),
                           df['SE norm'].dropna(),x,
                           'Spectral efficiency 10 MHz (PRB norm.)\n',
                           'Spectral efficiency (PRB norm.)\n',
                           'bit/s/Hz')
    plt.legend(loc=0)
    if args.print:
        plt.savefig(args.print[1],dpi=300,bbox_inches='tight')

    plt.figure()
    if len(df['SE 15 norm'].dropna()) > 0:
        dpl.plot_ecdf_quad(df['SE 10 norm'].dropna(),
                           df['SE norm'].dropna(),
                           df['SE 15 norm'].dropna(),
                           df['SE'].dropna(),x,
                           'SE 10 MHz (PRB norm.)',
                           'SE (PRB norm.)',
                           'SE 15 MHz (PRB norm.)','SE',
                           'bit/s/Hz')
        plt.xlabel('[bit/s/Hz]')
    else:
        dpl.plot_ecdf_triplet(df['SE 10 norm'].dropna(),
                              df['SE norm'].dropna(),df['SE'].dropna(),x,
                              'Spectral efficiency 10 MHz (PRB norm.)\n',
                              'Spectral efficiency (PRB norm.)\n','Spectral efficiency',
                              'bit/s/Hz')
    plt.legend (loc='best')
    plt.tight_layout ()
    if args.print:
        plt.savefig(args.print[2],dpi=300,bbox_inches='tight')

    input('Press any key')
def main(args):
    data_file_list = tl.get_data_file_list(args.library)
    if args.list:
        tl.print_list(data_file_list)
        sys.exit(0)
    data = tl.load_data_file(data_file_list, args.select)

    if not args.static:
        logging.debug("Remove zero velocity samples")
        data = ntp.remove_non_positive_velocity_samples(data)

    if args.ue == "e398":
        # Rename MAC downlink throughput in Application downlink throughput if need be
        ntp.process_data(data, ntp.process_lte_rename_mac_to_app)

    # Get basic data
    ntp.process_data(data, ntp.process_lte_app_bw_prb_util)
    ntp.process_data(data, ntp.process_lte_app_bw_prb_util_bw20)
    ntp.process_data(data, ntp.process_lte_app_bw_prb_util_bw10)
    ntp.process_data(data, ntp.process_lte_app_bw_prb_util_bw15)

    # Spectral efficiency
    ntp.process_data(data, ntp.process_se_bw_norm)
    # Alternate version
    ntp.process_data(data, ntp.process_lte_se_rb)

    column_list = [
        "DL bandwidth",
        "DL bandwidth full",
        "PRB utilization DL",
        "PRB utilization DL full",
        "PRB utilization DL 10",
        "PRB utilization DL 15",
        "PRB utilization DL 20",
        "SE",
        "SE norm",
        "SE 10 norm",
        "SE 15 norm",
        "SE 20 norm",
        "SE RB",
        "SE RB norm",
    ]
    if args.select is None:
        df = tl.concat_pandas_data([df[column_list] for df in data])
    else:
        df = data

    print(df["SE"].describe())
    print(df["SE norm"].describe())
    print(df["SE 10 norm"].describe())
    print(df["SE 15 norm"].describe())
    print(df["SE 20 norm"].describe())
    print(df["SE RB"].describe())
    print(df["SE RB norm"].describe())
    plt.ion()

    plt.figure()
    plt.subplot2grid((2, 2), (0, 0), colspan=2)
    x = np.arange(0, 8.1, 0.1)
    dpl.plot_ecdf_pair(
        df["SE norm"].dropna(),
        df["SE"].dropna(),
        x,
        "Spectral efficiency (PRB norm.)",
        "Spectral efficiency",
        "bit/s/Hz",
    )
    plt.legend(loc=0)
    plt.subplot2grid((2, 2), (1, 0), colspan=1)
    dpl.plot_density(df["SE"].replace([np.inf, -np.inf], np.nan).dropna(), x, "Spectral efficiency", "bit/s/Hz")
    plt.subplot2grid((2, 2), (1, 1), colspan=1)
    dpl.plot_density(
        df["SE norm"].where(df["SE norm"] < 8).replace([np.inf, -np.inf], np.nan).dropna(),
        x,
        "Spectral efficiency (PRB norm.)",
        "bit/s/Hz",
    )

    if args.print:
        plt.savefig(args.print[0], dpi=300, bbox_inches="tight")

    plt.figure()
    if len(df["SE 15 norm"].dropna()) > 0:
        dpl.plot_ecdf_triplet(
            df["SE 10 norm"].dropna(),
            df["SE norm"].dropna(),
            df["SE 15 norm"].dropna(),
            x,
            "Spectral efficiency 10 MHz (PRB util. norm.)\n",
            "Spectral efficiency (PRB util. norm.)\n",
            "Spectral efficiency 15 MHz (PRB util. norm.)",
            "bit/s/Hz",
        )
    else:
        dpl.plot_ecdf_pair(
            df["SE 10 norm"].dropna(),
            df["SE norm"].dropna(),
            x,
            "Spectral efficiency 10 MHz (PRB util. norm.)\n",
            "Spectral efficiency (PRB util. norm.)\n",
            "bit/s/Hz",
        )
    plt.legend(loc=0)
    if args.print:
        plt.savefig(args.print[1], dpi=300, bbox_inches="tight")

    plt.figure()
    plt.subplot2grid((2, 2), (0, 0), colspan=2)
    dpl.plot_ecdf_pair(
        df["SE norm"].dropna(),
        df["SE RB norm"].dropna(),
        x,
        "Spectral efficiency (PRB util. norm.)\n",
        "Spectral efficiency (RB norm.)",
        "bit/s/Hz",
    )
    plt.legend(loc=0)
    plt.subplot2grid((2, 2), (1, 0), colspan=1)
    dpl.plot_density(df["SE"].replace([np.inf, -np.inf], np.nan).dropna(), x, "Spectral efficiency", "bit/s/Hz")
    plt.subplot2grid((2, 2), (1, 1), colspan=1)
    dpl.plot_density(df["SE RB norm"].dropna(), x, "Spectral efficiency (RB norm.)", "bit/s/Hz")

    input("Press any key")
def main(args):
    data_file_list = tl.get_data_file_list(args.library)
    if args.list:
        tl.print_list(data_file_list)
        sys.exit(0)
    data = tl.load_data_file(data_file_list, args.select)

    if not args.static:
        logging.debug('Remove zero velocity samples')
        data = ntp.remove_non_positive_velocity_samples(data)

    # Get basic data
    ntp.process_data(data, ntp.process_lte_bw)
    # Now check the RS-SNR difference between 10 and 15 MHz
    ntp.process_data(data, ntp.process_lte_rs_snr)
    ntp.process_data(data, ntp.process_lte_rs_snr_bw)

    column_list = [
        'DL bandwidth', 'DL bandwidth full', 'RS SNR/Antenna port - 1',
        'RS SNR/Antenna port - 1 10', 'RS SNR/Antenna port - 1 15',
        'RS SNR/Antenna port - 2', 'RS SNR/Antenna port - 2 10',
        'RS SNR/Antenna port - 2 15'
    ]
    if args.select is None:
        df = tl.concat_pandas_data([df[column_list] for df in data])
    else:
        df = data

    print(df['RS SNR/Antenna port - 1'].describe())
    print(df['RS SNR/Antenna port - 2'].describe())
    print('95% percentile for AP 1 and 2: {:.1f}, {:.1f} dB'.format(
        np.percentile(df['RS SNR/Antenna port - 1'].dropna(), 95),
        np.percentile(df['RS SNR/Antenna port - 2'].dropna(), 95)))
    print('99% percentile for AP 1 and 2: {:.1f}, {:.1f} dB'.format(
        np.percentile(df['RS SNR/Antenna port - 1'].dropna(), 99),
        np.percentile(df['RS SNR/Antenna port - 2'].dropna(), 99)))

    plt.ion()
    plt.figure()
    plt.subplot2grid((2, 1), (0, 0))
    x = np.linspace(-15, 37, 53)
    if len(df['RS SNR/Antenna port - 1 15'].dropna()) > 0:
        dpl.plot_ecdf_triplet(df['RS SNR/Antenna port - 1 10'].dropna(),
                              df['RS SNR/Antenna port - 1'].dropna(),
                              df['RS SNR/Antenna port - 1 15'].dropna(), x,
                              'RS-SNR AP1 10 MHz', 'RS-SNR AP1',
                              'RS-SNR AP1 15 MHz', 'dB')
    else:
        dpl.plot_ecdf_pair(df['RS SNR/Antenna port - 1 10'].dropna(),
                           df['RS SNR/Antenna port - 1'].dropna(), x,
                           'RS-SNR AP1 10 MHz', 'RS-SNR AP1', 'dB')
    plt.xlim([-12, 33])
    if args.blind:
        plt.xticks([])
    plt.subplot2grid((2, 1), (1, 0))
    if len(df['RS SNR/Antenna port - 2 15'].dropna()) > 0:
        dpl.plot_ecdf_triplet(df['RS SNR/Antenna port - 2 10'].dropna(),
                              df['RS SNR/Antenna port - 2'].dropna(),
                              df['RS SNR/Antenna port - 2 15'].dropna(), x,
                              'RS-SNR AP2 10 MHz', 'RS-SNR AP2',
                              'RS-SNR AP2 15 MHz', 'dB')
    else:
        dpl.plot_ecdf_pair(df['RS SNR/Antenna port - 2 10'].dropna(),
                           df['RS SNR/Antenna port - 2'].dropna(), x,
                           'RS-SNR AP2 10 MHz', 'RS-SNR AP2', 'dB')
    plt.xlim([-12, 33])
    if args.blind:
        plt.xticks([])
    if args.print:
        plt.savefig(args.print, dpi=300, bbox_inches='tight')

    input('Press any key')