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)

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

    print(df['DL bandwidth'].describe())
    print('Percentage of each bandwidth:')
    print(df['DL bandwidth'].dropna().value_counts(normalize=True))
    bandwidth_transitions_count = df['DL bandwidth'].dropna().diff(
    ).value_counts(normalize=True)
    print(
        'Percentage of bandwidth transitions: ', bandwidth_transitions_count[
            bandwidth_transitions_count.index != 0].sum())

    plt.ion()
    plt.figure()
    plt.subplot2grid((1, 5), (0, 0), colspan=4)
    dpl.plot_ts(df['DL bandwidth'].dropna(), 'DL bandwidth', 'MHz', 10,
                [9.5, 15.5])
    plt.subplot2grid((1, 5), (0, 4), colspan=1)

    bandwidth_counts = df['DL bandwidth'].dropna().value_counts(normalize=True)
    per10 = bandwidth_counts[bandwidth_counts.index == 10] * 100
    per15 = bandwidth_counts[bandwidth_counts.index == 15] * 100

    # print(per10,per15)
    plt.bar(1,
            per15,
            width=0.4,
            bottom=per10,
            color='Orange',
            align='center',
            label='15 MHz')
    plt.bar(1, per10, width=0.4, color='m', align='center', label='10 MHz')
    plt.grid(True)
    plt.legend()
    plt.xlim([0, 2])
    plt.xticks([])
    plt.tight_layout()
    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)

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

    print(df['DL bandwidth'].describe())
    print('Percentage of each bandwidth:')
    print(df['DL bandwidth'].dropna().value_counts(normalize=True))
    bandwidth_transitions_count = df['DL bandwidth'].dropna().diff().value_counts(normalize=True)
    print('Percentage of bandwidth transitions: ',bandwidth_transitions_count[bandwidth_transitions_count.index != 0].sum())

    plt.ion()
    plt.figure()
    plt.subplot2grid((1,5),(0,0),colspan=4)
    dpl.plot_ts(df['DL bandwidth'].dropna(),
                'DL bandwidth','MHz',
                10,[9.5,15.5])
    plt.subplot2grid((1,5),(0,4),colspan=1)

    bandwidth_counts = df['DL bandwidth'].dropna().value_counts(normalize=True)
    per10 = bandwidth_counts[bandwidth_counts.index == 10]*100
    per15 = bandwidth_counts[bandwidth_counts.index == 15]*100

    # print(per10,per15)
    plt.bar(1,per15,width=0.4,bottom=per10,color='Orange',align='center',
            label='15 MHz')
    plt.bar(1,per10,width=0.4,color='m',align='center',
            label='10 MHz')
    plt.grid(True)
    plt.legend()
    plt.xlim([0,2])
    plt.xticks([])
    plt.tight_layout()
    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)

    ntp.process_data(data, ntp.process_velocity)
    ntp.process_data(data, ntp.process_pdsch_mcs_qpsk)

    column_list = [
        'mcs_0', 'mcs_1', 'mcs_2', 'mcs_3', 'mcs_4', 'mcs_5', 'mcs_6', 'mcs_7',
        'mcs_8', 'mcs_9'
    ]

    if args.select is None:
        df = tl.concat_pandas_data([df[column_list] for df in data])
    else:
        df = data[column_list]

    plt.ion()
    plt.figure()

    for index in np.arange(0, 10):
        print(index, index)
        print(df[['mcs_' + str(index)]].dropna().describe())
        plt.boxplot(df[['mcs_' + str(index)]].dropna().values,
                    positions=[index + 1])
    plt.ylim([0, 100])
    plt.xlim([0, 11])
    plt.xticks(np.arange(1, 11),
               ['MCS ' + str(index) for index in np.arange(0, 10)],
               rotation=45)
    plt.grid(True)
    plt.tight_layout()

    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)

    ntp.process_data(data, ntp.process_velocity)
    ntp.process_data(data, ntp.process_pdsch_mcs_16_64qam)

    column_list = ["mcs_" + str(index) for index in np.arange(10, 29)]

    if args.select is None:
        df = tl.concat_pandas_data([df[column_list] for df in data])
    else:
        df = data[column_list]

    plt.ion()
    plt.figure()

    for index in np.arange(0, 19):
        print(index, index + 10)
        print(df[["mcs_" + str(index + 10)]].dropna().describe())
        plt.boxplot(df[["mcs_" + str(index + 10)]].dropna().values, positions=[index + 1])
    plt.ylim([0, 100])
    plt.xlim([0, 20])
    plt.xticks(np.arange(1, 20), ["MCS " + str(index + 10) for index in np.arange(0, 19)], rotation=45)
    plt.grid(True)
    plt.tight_layout()

    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)

    ntp.process_data(data,ntp.process_velocity)
    ntp.process_data(data,ntp.process_pdsch_mcs_qpsk)

    column_list = ['mcs_0','mcs_1','mcs_2','mcs_3','mcs_4','mcs_5','mcs_6','mcs_7','mcs_8','mcs_9']

    if args.select is None:
        df = tl.concat_pandas_data([df[column_list] for df in data ])
    else:
        df = data[column_list]

    plt.ion()
    plt.figure()

    for index in np.arange(0,10):
        print(index,index)
        print(df[['mcs_'+str(index)]].dropna().describe())
        plt.boxplot(df[['mcs_'+str(index)]].dropna().values,positions=[index+1])
    plt.ylim([0,100])
    plt.xlim([0,11])
    plt.xticks(np.arange(1,11),['MCS '+str(index) for index in np.arange(0,10)],rotation=45)
    plt.grid(True)
    plt.tight_layout()

    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_throughput)
    ntp.process_data(data, ntp.process_lte_pdcp_throughput)

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

    print(df['PDCP downlink throughput'].describe())
    print(df['Application throughput downlink'].describe())

    # Normalize
    f_norm = lambda x: x / 1e6

    plt.ion()
    plt.figure()
    plt.subplot2grid((2, 2), (0, 0), colspan=2)
    x = np.arange(0, 120, 1)
    dpl.plot_ecdf_pair(
        df['Application throughput downlink'].dropna().apply(f_norm),
        df['PDCP downlink throughput'].dropna().apply(f_norm), x,
        'Application th.', 'PDCP th.', 'Mbit/s')
    plt.legend(loc=0)
    plt.subplot2grid((2, 2), (1, 0), colspan=1)
    dpl.plot_density(
        df['Application throughput downlink'].dropna().apply(f_norm), x,
        'App. th.', 'Mbit/s')
    plt.subplot2grid((2, 2), (1, 1), colspan=1)
    dpl.plot_density(df['PDCP downlink throughput'].dropna().apply(f_norm), x,
                     'PDCP th.', '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_throughput)
    ntp.process_data(data, ntp.process_lte_pdcp_throughput)

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

    print(df["PDCP downlink throughput"].describe())
    print(df["Application throughput downlink"].describe())

    # Normalize
    f_norm = lambda x: x / 1e6

    plt.ion()
    plt.figure()
    plt.subplot2grid((2, 2), (0, 0), colspan=2)
    x = np.arange(0, 120, 1)
    dpl.plot_ecdf_pair(
        df["Application throughput downlink"].dropna().apply(f_norm),
        df["PDCP downlink throughput"].dropna().apply(f_norm),
        x,
        "Application th.",
        "PDCP th.",
        "Mbit/s",
    )
    plt.legend(loc=0)
    plt.subplot2grid((2, 2), (1, 0), colspan=1)
    dpl.plot_density(df["Application throughput downlink"].dropna().apply(f_norm), x, "App. th.", "Mbit/s")
    plt.subplot2grid((2, 2), (1, 1), colspan=1)
    dpl.plot_density(df["PDCP downlink throughput"].dropna().apply(f_norm), x, "PDCP th.", "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_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')
Example #9
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_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 #12
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)

    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, SNR, RSRP
    ntp.process_data(data,ntp.process_se_bw_norm)
    ntp.process_data(data,ntp.process_lte_rs_snr)
    ntp.process_data(data,ntp.process_lte_rsrp)

    column_list = ['Velocity',
                   'SE','SE norm',
                   'RS SNR/Antenna port - 1','RS SNR/Antenna port - 2',
                   'RSRP/Antenna port - 1','RSRP/Antenna port - 2']
    if args.select is None:
        df = tl.concat_pandas_data([df[column_list] for df in data ])
    else:
        df = data

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

    print(df['SE'].dropna().describe())
    print(df['Velocity'].dropna().describe())
    print(df['RS SNR/Antenna port - 1'].dropna().describe())

    velocity_pacf = pacf(df['Velocity'].dropna(), nlags=10, method='ywunbiased', alpha=None)
    se_pacf,se_conf = pacf(df['SE'].dropna(), nlags=10, method='ywunbiased', alpha=0.05)
    se_norm_pacf,se_norm_conf = pacf(df['SE norm'].dropna(), nlags=10, method='ywunbiased', alpha=0.05)
    rs_snr_ap1_pacf = pacf(df['RS SNR/Antenna port - 1'].dropna(), nlags=10, method='ywunbiased', alpha=None)
    rsrp_ap1_pacf = pacf(df['RSRP/Antenna port - 1'].dropna(), nlags=10, method='ywunbiased', alpha=None)

    # Apply diff to ensure zero-mean
    velocity_acf = acf(df['Velocity'].dropna().diff().dropna(), unbiased=False, nlags=40, confint=None, qstat=False, fft=True, alpha=None)
    se_acf = acf(df['SE'].dropna().diff().dropna(), unbiased=False, nlags=40, confint=None, qstat=False, fft=True, alpha=None)
    se_norm_acf = acf(df['SE norm'].dropna().diff().dropna(), unbiased=False, nlags=40, confint=None, qstat=False, fft=True, alpha=None)
    rs_snr_ap1_acf = acf(df['RS SNR/Antenna port - 1'].dropna().diff().dropna(), unbiased=False, nlags=40, confint=None, qstat=False, fft=True, alpha=None)
    rsrp_ap1_acf = acf(df['RSRP/Antenna port - 1'].dropna().diff().dropna(), unbiased=False, nlags=40, confint=None, qstat=False, fft=True, alpha=None)

    plt.ion()
    plt.figure()
    plt.subplot2grid((2,1), (0,0))
    plt.plot(se_pacf,lw=2.0,label='PACF SE')
    plt.plot(se_norm_pacf,lw=2.0,label='PACF SE norm')
    plt.plot(rs_snr_ap1_pacf,lw=2.0,label='PACF RS SNR AP1')
    plt.plot(rsrp_ap1_pacf,lw=2.0,label='PACF RSRP AP1')
    plt.plot(velocity_pacf,lw=2.0,label='PACF Velocity')
    plt.ylim([-0.2,1.1])
    plt.grid(True)
    plt.legend(loc=0)

    plt.subplot2grid((2,1), (1,0))
    plt.plot(se_acf,lw=2.0,label='ACF SE diff')
    plt.plot(se_norm_acf,lw=2.0,label='ACF SE norm diff')
    plt.plot(rs_snr_ap1_acf,lw=2.0,label='ACF RS SNR AP1 diff')
    plt.plot(rsrp_ap1_acf,lw=2.0,label='ACF RSRP AP1 diff')
    plt.plot(velocity_acf,lw=2.0,label='ACF Velocity diff')
    plt.ylim([-0.2,1.1])
    plt.grid(True)
    plt.legend(loc=0)

    plt.tight_layout()

    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", "SE", "SE norm"]
    if args.select is None:
        df = tl.concat_pandas_data([df[column_list] for df in data])
    else:
        df = data

    # Check that overall results make sense
    print(df[df["SE norm"] <= 8][["SE", "SE norm", "DL bandwidth full"]].dropna().describe())

    print("Percentage of each bandwidth:")
    print(df[df["SE norm"] <= 8]["DL bandwidth full"].dropna().value_counts(normalize=True))

    bandwidth_transitions_count = (
        df[df["SE norm"] <= 8]["DL bandwidth full"].dropna().diff().value_counts(normalize=True)
    )
    print(
        "Percentage of bandwidth transitions: ",
        bandwidth_transitions_count[bandwidth_transitions_count.index != 0].sum(),
    )
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)

    ntp.process_data(data,ntp.process_velocity)
    ntp.process_data(data,ntp.process_pdsch_rank)

    column_list = ['Velocity', 'Velocity full',
                   'valid_percentage',
                   'rank_1_per','rank_2_per',
                   'Requested rank - 1','Requested rank - 2']

    if args.select is None:
        df = tl.concat_pandas_data([df[column_list] for df in data ])
    else:
        df = data[column_list]

    rank_index = df[df['valid_percentage']>=99].index
    print(df['rank_1_per'][rank_index].describe())
    print(df['rank_2_per'][rank_index].describe())

    plt.ion()

    plt.subplot2grid((2,5), (0,0),rowspan=1,colspan=4)
    plt.title('Requested rank and effective rank percentages')
    req_rank = df[['Requested rank - 1','Requested rank - 2']].dropna()
    plt.plot(req_rank.index,req_rank.values[:,0],lw=0.2,color='LightBlue')
    plt.plot(req_rank.index,np.sum(req_rank.values[:],axis=1),c='Orange')
    plt.fill_between(req_rank.index,req_rank.values[:,0],0,color='LightBlue')
    plt.fill_between(req_rank.index,np.sum(req_rank.values[:],axis=1),req_rank.values[:,0],color='Orange')
    plt.ylim([0,102])
    plt.ylabel('Rank requested [%]')
    plt.subplot2grid((2,5), (0,4),rowspan=1)
    plt.boxplot((req_rank.values[:,0],req_rank.values[:,1]))
    plt.ylim([0,102])
    plt.grid(True)

    plt.subplot2grid((2,5), (1,0),rowspan=1,colspan=4)
    plt.plot(rank_index,df.rank_1_per[rank_index],lw=0.2,color='LightBlue')
    plt.plot(rank_index,df.rank_1_per[rank_index]+df.rank_2_per[rank_index],c='Orange')
    plt.fill_between(rank_index,
                     df.rank_1_per[rank_index].values,
                     0,
                     color='LightBlue')
    plt.fill_between(rank_index,
                     df.rank_1_per[rank_index].values+df.rank_2_per[rank_index].values,
                     df.rank_1_per[rank_index].values,
                     color='Orange')
    plt.ylim([0,102])
    plt.ylabel('Rank effective [%]')
    plt.subplot2grid((2,5), (1,4),rowspan=1)
    plt.boxplot((df.rank_1_per[rank_index],df.rank_2_per[rank_index]))
    plt.ylim([0,102])
    plt.grid(True)

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

    plt.figure()
    plt.subplot2grid((1,2), (0,0),colspan=1)
    plt.boxplot((req_rank.values[:,0],req_rank.values[:,1]),widths=0.5)
    plt.ylim([0,102])
    plt.xticks([1,2],['Rank 1','Rank 2'])
    plt.xlabel('Requested by UE')
    plt.grid(True)

    plt.subplot2grid((1,2), (0,1),colspan=1)
    plt.boxplot((df.rank_1_per[rank_index],df.rank_2_per[rank_index]),widths=0.5)
    plt.ylim([0,102])
    plt.xticks([1,2],['Rank 1','Rank 2'])
    plt.xlabel('Effective')
    plt.grid(True)
    plt.tight_layout()
    if args.print:
        plt.savefig(args.print[1],dpi=300,bbox_inches='tight')

    input('press any key')
Example #16
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 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)
    # RSRP and RS-SNR
    ntp.process_data(data, ntp.process_lte_rsrp_rs_snr)
    ntp.process_data(data, ntp.process_lte_rsrp_rs_snr_full)
    # Spectral efficiency
    ntp.process_data(data, ntp.process_lte_se_rb)

    column_list = [
        'DL bandwidth', 'DL bandwidth full', 'Application throughput downlink',
        'PRB utilization DL', 'PRB utilization DL full',
        'RSRP/Antenna port - 1 full', 'RSRP/Antenna port - 2 full',
        'RS SNR/Antenna port - 1 full', 'RS SNR/Antenna port - 2 full',
        'SE RB norm'
    ]
    if args.select is None:
        df = dl.concat_pandas_data([df[column_list] for df in data])
    else:
        df = data

    print(df['SE RB norm'].describe())
    print(df['Application throughput downlink'].describe())
    print(df['RS SNR/Antenna port - 1 full'].describe())
    print(df['RS SNR/Antenna port - 2 full'].describe())
    print(df['RSRP/Antenna port - 1 full'].describe())
    print(df['RSRP/Antenna port - 2 full'].describe())

    # Normalize
    f_norm = lambda x: x / 1e6

    plt.ion()
    index = df[['SE RB norm', 'RS SNR/Antenna port - 1 full']].dropna().index
    plt.subplot2grid((1, 2), (0, 0))
    dpl.plot_scatter(df['RS SNR/Antenna port - 1 full'][index],
                     df['SE RB norm'][index],
                     'RS SNR AP1',
                     'SE RB',
                     'dB',
                     'bit/s/Hz',
                     marker_size=20,
                     alpha=.3)
    plt.subplot2grid((1, 2), (0, 1))
    dpl.plot_scatter(df['RS SNR/Antenna port - 2 full'][index],
                     df['SE RB norm'][index],
                     'RS SNR AP2',
                     'SE RB',
                     'dB',
                     'bit/s/Hz',
                     marker_size=20,
                     alpha=.3)

    plt.figure()
    plt.subplot2grid((1, 2), (0, 0))
    dpl.plot_scatter(df['RSRP/Antenna port - 1 full'][index],
                     df['SE RB norm'][index],
                     'RSRP AP1',
                     'SE RB',
                     'dBm',
                     'bit/s/Hz',
                     marker_size=20,
                     alpha=.3)
    plt.subplot2grid((1, 2), (0, 1))
    dpl.plot_scatter(df['RSRP/Antenna port - 2 full'][index],
                     df['SE RB norm'][index],
                     'RSRP AP2',
                     'SE RB',
                     'dBm',
                     'bit/s/Hz',
                     marker_size=20,
                     alpha=.3)

    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)

    ntp.process_data(data,ntp.process_lte_app_bw_prb_util)
    ntp.process_data(data,ntp.process_lte_app_bw_prb_util_bw10)
    ntp.process_data(data,ntp.process_lte_app_bw_prb_util_bw15)
    ntp.process_data(data,ntp.process_lte_app_bw_prb_util_bw20)
    ntp.process_data(data,ntp.process_lte_rsrp_rs_snr)
    ntp.process_data(data,ntp.process_lte_rsrp_rs_snr_full)
    ntp.process_data(data,ntp.process_se_bw_norm)
    ntp.process_data(data,ntp.process_velocity)

    column_list = ['Velocity', 'Velocity full',
                   'DL bandwidth','DL bandwidth full',
                   'PRB utilization DL','PRB utilization DL full',
                   'Application throughput downlink',
                   'Application throughput downlink norm',
                   'Application throughput downlink 10 norm','Application throughput downlink 15 norm',
                   'RS SNR/Antenna port - 1','RS SNR/Antenna port - 2',
                   'RS SNR/Antenna port - 1 full','RS SNR/Antenna port - 2 full',
                   'RSRP/Antenna port - 1','RSRP/Antenna port - 2',
                   'RSRP/Antenna port - 1 full','RSRP/Antenna port - 2 full',
                   'SE norm']

    if args.select is None:
        df = tl.concat_pandas_data([df[column_list] for df in data ])
    else:
        df = data

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

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

    plt.ion()

    plt.figure()
    X = df[['RS SNR/Antenna port - 1 full','SE norm']].dropna()
    dpl.plot_scatter(X['RS SNR/Antenna port - 1 full'],
                     X['SE norm'],
                     'RS-SNR AP 1','Spectral efficiency',
                     'dB','bit/s/Hz')

    plt.figure()
    dpl.plot_hist2d(X['RS SNR/Antenna port - 1 full'],
                    X['SE norm'],
                    'RS-SNR AP 1','Spectral efficiency',
                    'dB','bit/s/Hz',
                    bins=50)
    if args.print:
        plt.savefig(args.print[0],dpi=300,bbox_inches='tight')

    plt.figure()
    X = df[['RS SNR/Antenna port - 2 full','SE norm']].dropna()
    dpl.plot_scatter(X['RS SNR/Antenna port - 2 full'],
                     X['SE norm'],
                     'RS-SNR AP 2','Spectral efficiency',
                     'dB','bit/s/Hz')

    plt.figure()
    dpl.plot_hist2d(X['RS SNR/Antenna port - 2 full'],
                    X['SE norm'],
                    'RS-SNR AP 2','Spectral efficiency',
                    'dB','bit/s/Hz',
                    bins=50)

    plt.figure()
    X = df[['Velocity','SE norm']].dropna()
    dpl.plot_scatter(X['Velocity'],
                     X['SE norm'],
                     'Velocity','Spectral efficiency',
                     'km/h','bit/s/Hz')

    plt.figure()
    dpl.plot_hist2d(X['Velocity'],
                     X['SE norm'],
                    'Velocity','Spectral efficiency',
                     'km/h','bit/s/Hz',bins=50)
    if args.print:
        plt.savefig(args.print[1],dpi=300,bbox_inches='tight')

    plt.figure()
    X = df[['Velocity','RS SNR/Antenna port - 1']].dropna()
    dpl.plot_hist2d(X['Velocity'],
                    X['RS SNR/Antenna port - 1'],
                    'Velocity','RS-SNR AP 1',
                    'km/h','dB',bins=50)

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

    plt.figure()
    X = df[['Velocity','RS SNR/Antenna port - 2']].dropna()
    dpl.plot_hist2d(X['Velocity'],
                    X['RS SNR/Antenna port - 2'],
                    'Velocity','RS-SNR AP 2',
                    'km/h','dB',bins=50)

    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)

    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')
Example #20
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 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)
    ntp.process_data(data,ntp.process_lte_se_rb)

    column_list = ['DL bandwidth','DL bandwidth full',
                   'Application throughput downlink',
                   'PRB utilization DL','PRB utilization DL full',
                   'SE norm','SE RB norm']
    if args.select is None:
        df = dl.concat_pandas_data([df[column_list] for df in data ])
    else:
        df = data

    print(df['SE RB norm'].describe())
    print(df['SE norm'].describe())
    print(df['Application throughput downlink'].describe())

    # Normalize
    f_norm = lambda x: x/1e6

    plt.ion()
    plt.figure()
    plt.subplot2grid((2,1), (0,0))
    dpl.plot_ts(df['Application throughput downlink'].dropna(),
                'MAC DL throughput' if args.ue == 'e398' else 'App. throughput',
                'Mbit/s',marker_size=10,ylim=None)
    plt.subplot2grid((2,1), (1,0))
    x = np.arange(0,155,1)
    dpl.plot_ecdf(df['Application throughput downlink'].dropna().apply(f_norm),x,
                  'App. throughput','Mbit/s')

    plt.figure()
    dpl.plot_ecdf_pair(df['SE norm'].dropna(),
                   df['SE RB norm'].dropna(),np.linspace(0,8.5,86),
                   'SE norm','SE 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)

    ntp.process_data(data, ntp.process_velocity)
    if args.rank is None:
        ntp.process_data(data, ntp.process_pdsch_mcs)
    elif args.rank == 1:
        ntp.process_data(data, ntp.process_pdsch_mcs_rank_1)
    elif args.rank == 2:
        ntp.process_data(data, ntp.process_pdsch_mcs_rank_2)
    else:
        assert ("You should not be here: rank must be equal to 1 or 2.")

    column_list = [
        'Velocity', 'Velocity full', 'valid_percentage', 'mcs_q_2', 'mcs_q_4',
        'mcs_q_6', 'mcs_reserved', 'mcs_na'
    ]

    if args.select is None:
        df = tl.concat_pandas_data([df[column_list] for df in data])
    else:
        df = data[column_list]

    mcs_index = df['valid_percentage'].dropna().index.values

    print(df[['mcs_q_2']].dropna().describe())
    print(df[['mcs_q_4']].dropna().describe())
    print(df[['mcs_q_6']].dropna().describe())
    print(df[['mcs_reserved']].dropna().describe())
    print(df[['mcs_na']].dropna().describe())
    print(df[['mcs_q_2', 'mcs_q_4', 'mcs_q_6', 'mcs_reserved',
              'mcs_na']].sum(axis=1).dropna().median())
    plt.ion()

    plt.figure()
    plt.subplot2grid((1, 5), (0, 0), colspan=1)
    plt.boxplot(df[['mcs_q_2']].dropna().values)
    plt.ylim([0, 100])
    plt.grid(True)
    plt.xticks([])
    plt.title('MCS 0-9,\nQ_m = 2')

    plt.subplot2grid((1, 5), (0, 1), colspan=1)
    plt.boxplot(df[['mcs_q_4']].dropna().values)
    plt.ylim([0, 100])
    plt.grid(True)
    plt.xticks([])
    plt.title('MCS 10-16,\nQ_m = 4')

    plt.subplot2grid((1, 5), (0, 2), colspan=1)
    plt.boxplot(df[['mcs_q_6']].dropna().values)
    plt.ylim([0, 100])
    plt.grid(True)
    plt.xticks([])
    plt.title('MCS 17-28,\nQ_m = 6')

    plt.subplot2grid((1, 5), (0, 3), colspan=1)
    plt.boxplot(df[['mcs_reserved']].dropna().values)
    plt.ylim([0, 100])
    plt.grid(True)
    plt.xticks([])
    plt.title('MCS 29-31,\nreserved')

    plt.subplot2grid((1, 5), (0, 4), colspan=1)
    plt.boxplot(df[['mcs_na']].dropna().values)
    plt.ylim([0, 100])
    plt.grid(True)
    plt.xticks([])
    plt.title('MCS n/a')

    plt.tight_layout()

    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 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)
    # RSRP and RS-SNR
    ntp.process_data(data,ntp.process_lte_rsrp_rs_snr)
    ntp.process_data(data,ntp.process_lte_rsrp_rs_snr_full)
    # Spectral efficiency
    ntp.process_data(data,ntp.process_lte_se_rb)

    column_list = ['DL bandwidth','DL bandwidth full',
                   'Application throughput downlink',
                   'PRB utilization DL','PRB utilization DL full',
                   'RSRP/Antenna port - 1 full', 'RSRP/Antenna port - 2 full',
                   'RS SNR/Antenna port - 1 full', 'RS SNR/Antenna port - 2 full',
                   'SE RB norm']
    if args.select is None:
        df = dl.concat_pandas_data([df[column_list] for df in data ])
    else:
        df = data

    print(df['SE RB norm'].describe())
    print(df['Application throughput downlink'].describe())
    print(df['RS SNR/Antenna port - 1 full'].describe())
    print(df['RS SNR/Antenna port - 2 full'].describe())
    print(df['RSRP/Antenna port - 1 full'].describe())
    print(df['RSRP/Antenna port - 2 full'].describe())

    # Normalize
    f_norm = lambda x: x/1e6

    plt.ion()
    index = df[['SE RB norm','RS SNR/Antenna port - 1 full']].dropna().index
    plt.subplot2grid((1,2), (0,0))
    dpl.plot_scatter(df['RS SNR/Antenna port - 1 full'][index],df['SE RB norm'][index],
                     'RS SNR AP1','SE RB',
                     'dB','bit/s/Hz',marker_size=20,alpha=.3)
    plt.subplot2grid((1,2), (0,1))
    dpl.plot_scatter(df['RS SNR/Antenna port - 2 full'][index],df['SE RB norm'][index],
                     'RS SNR AP2','SE RB',
                     'dB','bit/s/Hz',marker_size=20,alpha=.3)

    plt.figure()
    plt.subplot2grid((1,2), (0,0))
    dpl.plot_scatter(df['RSRP/Antenna port - 1 full'][index],df['SE RB norm'][index],
                     'RSRP AP1','SE RB',
                     'dBm','bit/s/Hz',marker_size=20,alpha=.3)
    plt.subplot2grid((1,2), (0,1))
    dpl.plot_scatter(df['RSRP/Antenna port - 2 full'][index],df['SE RB norm'][index],
                     'RSRP AP2','SE RB',
                     'dBm','bit/s/Hz',marker_size=20,alpha=.3)

    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')
Example #24
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)

    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)

    ntp.process_data(data, ntp.process_lte_app_bw_prb_util)
    ntp.process_data(data, ntp.process_lte_app_bw_prb_util_bw10)
    ntp.process_data(data, ntp.process_lte_app_bw_prb_util_bw15)
    ntp.process_data(data, ntp.process_lte_app_bw_prb_util_bw20)
    ntp.process_data(data, ntp.process_lte_rsrp_rs_snr)
    ntp.process_data(data, ntp.process_lte_rsrp_rs_snr_full)
    ntp.process_data(data, ntp.process_se_bw_norm)
    ntp.process_data(data, ntp.process_velocity)

    column_list = [
        'Velocity', 'Velocity full', 'DL bandwidth', 'DL bandwidth full',
        'PRB utilization DL', 'PRB utilization DL full',
        'Application throughput downlink',
        'Application throughput downlink norm',
        'Application throughput downlink 10 norm',
        'Application throughput downlink 15 norm', 'RS SNR/Antenna port - 1',
        'RS SNR/Antenna port - 2', 'RS SNR/Antenna port - 1 full',
        'RS SNR/Antenna port - 2 full', 'RSRP/Antenna port - 1',
        'RSRP/Antenna port - 2', 'RSRP/Antenna port - 1 full',
        'RSRP/Antenna port - 2 full', 'SE norm'
    ]

    if args.select is None:
        df = tl.concat_pandas_data([df[column_list] for df in data])
    else:
        df = data

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

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

    plt.ion()

    plt.figure()
    X = df[['RS SNR/Antenna port - 1 full', 'SE norm']].dropna()
    dpl.plot_scatter(X['RS SNR/Antenna port - 1 full'], X['SE norm'],
                     'RS-SNR AP 1', 'Spectral efficiency', 'dB', 'bit/s/Hz')

    plt.figure()
    dpl.plot_hist2d(X['RS SNR/Antenna port - 1 full'],
                    X['SE norm'],
                    'RS-SNR AP 1',
                    'Spectral efficiency',
                    'dB',
                    'bit/s/Hz',
                    bins=50)
    if args.print:
        plt.savefig(args.print[0], dpi=300, bbox_inches='tight')

    plt.figure()
    X = df[['RS SNR/Antenna port - 2 full', 'SE norm']].dropna()
    dpl.plot_scatter(X['RS SNR/Antenna port - 2 full'], X['SE norm'],
                     'RS-SNR AP 2', 'Spectral efficiency', 'dB', 'bit/s/Hz')

    plt.figure()
    dpl.plot_hist2d(X['RS SNR/Antenna port - 2 full'],
                    X['SE norm'],
                    'RS-SNR AP 2',
                    'Spectral efficiency',
                    'dB',
                    'bit/s/Hz',
                    bins=50)

    plt.figure()
    X = df[['Velocity', 'SE norm']].dropna()
    dpl.plot_scatter(X['Velocity'], X['SE norm'], 'Velocity',
                     'Spectral efficiency', 'km/h', 'bit/s/Hz')

    plt.figure()
    dpl.plot_hist2d(X['Velocity'],
                    X['SE norm'],
                    'Velocity',
                    'Spectral efficiency',
                    'km/h',
                    'bit/s/Hz',
                    bins=50)
    if args.print:
        plt.savefig(args.print[1], dpi=300, bbox_inches='tight')

    plt.figure()
    X = df[['Velocity', 'RS SNR/Antenna port - 1']].dropna()
    dpl.plot_hist2d(X['Velocity'],
                    X['RS SNR/Antenna port - 1'],
                    'Velocity',
                    'RS-SNR AP 1',
                    'km/h',
                    'dB',
                    bins=50)

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

    plt.figure()
    X = df[['Velocity', 'RS SNR/Antenna port - 2']].dropna()
    dpl.plot_hist2d(X['Velocity'],
                    X['RS SNR/Antenna port - 2'],
                    'Velocity',
                    'RS-SNR AP 2',
                    'km/h',
                    'dB',
                    bins=50)

    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)

    ntp.process_data(data, ntp.process_velocity)
    if args.rank is None:
        ntp.process_data(data, ntp.process_pdsch_mcs)
    elif args.rank == 1:
        ntp.process_data(data, ntp.process_pdsch_mcs_rank_1)
    elif args.rank == 2:
        ntp.process_data(data, ntp.process_pdsch_mcs_rank_2)
    else:
        assert "You should not be here: rank must be equal to 1 or 2."

    column_list = [
        "Velocity",
        "Velocity full",
        "valid_percentage",
        "mcs_q_2",
        "mcs_q_4",
        "mcs_q_6",
        "mcs_reserved",
        "mcs_na",
    ]

    if args.select is None:
        df = tl.concat_pandas_data([df[column_list] for df in data])
    else:
        df = data[column_list]

    mcs_index = df["valid_percentage"].dropna().index.values

    print(df[["mcs_q_2"]].dropna().describe())
    print(df[["mcs_q_4"]].dropna().describe())
    print(df[["mcs_q_6"]].dropna().describe())
    print(df[["mcs_reserved"]].dropna().describe())
    print(df[["mcs_na"]].dropna().describe())
    print(df[["mcs_q_2", "mcs_q_4", "mcs_q_6", "mcs_reserved", "mcs_na"]].sum(axis=1).dropna().median())
    plt.ion()

    plt.figure()
    plt.subplot2grid((1, 5), (0, 0), colspan=1)
    plt.boxplot(df[["mcs_q_2"]].dropna().values)
    plt.ylim([0, 100])
    plt.grid(True)
    plt.xticks([])
    plt.title("MCS 0-9,\nQ_m = 2")

    plt.subplot2grid((1, 5), (0, 1), colspan=1)
    plt.boxplot(df[["mcs_q_4"]].dropna().values)
    plt.ylim([0, 100])
    plt.grid(True)
    plt.xticks([])
    plt.title("MCS 10-16,\nQ_m = 4")

    plt.subplot2grid((1, 5), (0, 2), colspan=1)
    plt.boxplot(df[["mcs_q_6"]].dropna().values)
    plt.ylim([0, 100])
    plt.grid(True)
    plt.xticks([])
    plt.title("MCS 17-28,\nQ_m = 6")

    plt.subplot2grid((1, 5), (0, 3), colspan=1)
    plt.boxplot(df[["mcs_reserved"]].dropna().values)
    plt.ylim([0, 100])
    plt.grid(True)
    plt.xticks([])
    plt.title("MCS 29-31,\nreserved")

    plt.subplot2grid((1, 5), (0, 4), colspan=1)
    plt.boxplot(df[["mcs_na"]].dropna().values)
    plt.ylim([0, 100])
    plt.grid(True)
    plt.xticks([])
    plt.title("MCS n/a")

    plt.tight_layout()

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

    input("press any key")
Example #27
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)

    ntp.process_data(data, ntp.process_velocity)
    ntp.process_data(data, ntp.process_pdsch_rank)

    column_list = [
        'Velocity', 'Velocity full', 'valid_percentage', 'rank_1_per',
        'rank_2_per', 'Requested rank - 1', 'Requested rank - 2'
    ]

    if args.select is None:
        df = tl.concat_pandas_data([df[column_list] for df in data])
    else:
        df = data[column_list]

    rank_index = df[df['valid_percentage'] >= 99].index
    print(df['rank_1_per'][rank_index].describe())
    print(df['rank_2_per'][rank_index].describe())

    plt.ion()

    plt.subplot2grid((2, 5), (0, 0), rowspan=1, colspan=4)
    plt.title('Requested rank and effective rank percentages')
    req_rank = df[['Requested rank - 1', 'Requested rank - 2']].dropna()
    plt.plot(req_rank.index, req_rank.values[:, 0], lw=0.2, color='LightBlue')
    plt.plot(req_rank.index, np.sum(req_rank.values[:], axis=1), c='Orange')
    plt.fill_between(req_rank.index,
                     req_rank.values[:, 0],
                     0,
                     color='LightBlue')
    plt.fill_between(req_rank.index,
                     np.sum(req_rank.values[:], axis=1),
                     req_rank.values[:, 0],
                     color='Orange')
    plt.ylim([0, 102])
    plt.ylabel('Rank requested [%]')
    plt.subplot2grid((2, 5), (0, 4), rowspan=1)
    plt.boxplot((req_rank.values[:, 0], req_rank.values[:, 1]))
    plt.ylim([0, 102])
    plt.grid(True)

    plt.subplot2grid((2, 5), (1, 0), rowspan=1, colspan=4)
    plt.plot(rank_index, df.rank_1_per[rank_index], lw=0.2, color='LightBlue')
    plt.plot(rank_index,
             df.rank_1_per[rank_index] + df.rank_2_per[rank_index],
             c='Orange')
    plt.fill_between(rank_index,
                     df.rank_1_per[rank_index].values,
                     0,
                     color='LightBlue')
    plt.fill_between(rank_index,
                     df.rank_1_per[rank_index].values +
                     df.rank_2_per[rank_index].values,
                     df.rank_1_per[rank_index].values,
                     color='Orange')
    plt.ylim([0, 102])
    plt.ylabel('Rank effective [%]')
    plt.subplot2grid((2, 5), (1, 4), rowspan=1)
    plt.boxplot((df.rank_1_per[rank_index], df.rank_2_per[rank_index]))
    plt.ylim([0, 102])
    plt.grid(True)

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

    plt.figure()
    plt.subplot2grid((1, 2), (0, 0), colspan=1)
    plt.boxplot((req_rank.values[:, 0], req_rank.values[:, 1]), widths=0.5)
    plt.ylim([0, 102])
    plt.xticks([1, 2], ['Rank 1', 'Rank 2'])
    plt.xlabel('Requested by UE')
    plt.grid(True)

    plt.subplot2grid((1, 2), (0, 1), colspan=1)
    plt.boxplot((df.rank_1_per[rank_index], df.rank_2_per[rank_index]),
                widths=0.5)
    plt.ylim([0, 102])
    plt.xticks([1, 2], ['Rank 1', 'Rank 2'])
    plt.xlabel('Effective')
    plt.grid(True)
    plt.tight_layout()
    if args.print:
        plt.savefig(args.print[1], dpi=300, bbox_inches='tight')

    input('press any key')
Example #28
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)

    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','SE','SE norm']
    if args.select is None:
        df = tl.concat_pandas_data([df[column_list] for df in data ])
    else:
        df = data

    # Check that overall results make sense
    print(df[df['SE norm'] <= 8][['SE','SE norm','DL bandwidth full']].dropna().describe())

    print('Percentage of each bandwidth:')
    print(df[df['SE norm'] <= 8]['DL bandwidth full'].dropna().value_counts(normalize=True))

    bandwidth_transitions_count = df[df['SE norm'] <= 8]['DL bandwidth full'].dropna().diff().value_counts(normalize=True)
    print('Percentage of bandwidth transitions: ',bandwidth_transitions_count[bandwidth_transitions_count.index != 0].sum())
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')