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')
Exemple #2
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)

    # 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 non-positive velocity samples')
        data = ntp.remove_non_positive_velocity_samples(data)

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

    print(df.describe())

    plt.ion()
    plt.figure()
    dpl.plot_ts(df, 'Velocity', 'km/h', marker_size=2, ylim=None)
    if args.print:
        plt.savefig(args.print[0], dpi=300, bbox_inches='tight')

    plt.figure()
    x = np.arange(0, 210, 1)
    plt.subplot2grid((2, 1), (0, 0))
    dpl.plot_hist(df.dropna().astype(float),
                  'Velocity',
                  'km/h',
                  bins=20,
                  normed=False)
    plt.xlim([np.min(x), np.max(x)])

    plt.subplot2grid((2, 1), (1, 0))
    dpl.plot_ecdf(df.dropna().astype(float), x, 'Velocity', 'km/h')
    plt.xlim([np.min(x), np.max(x)])
    if args.print:
        plt.savefig(args.print[1], dpi=300, bbox_inches='tight')

    plt.figure()
    x = np.arange(-5, 220, 10)
    dpl.plot_hist(df.dropna().astype(float),
                  'Velocity',
                  'km/h',
                  bins=x,
                  normed=False)
    plt.xlim([np.min(x), np.max(x)])
    if args.print:
        plt.savefig(args.print[2], dpi=600, 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 non-positive velocity samples')
        data = ntp.remove_non_positive_velocity_samples(data)

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

    print(df.describe())

    plt.ion()
    plt.figure()
    dpl.plot_ts(df,'Velocity','km/h',marker_size=2,ylim=None)
    if args.print:
        plt.savefig(args.print[0],dpi=300,bbox_inches='tight')

    plt.figure()
    x = np.arange(0,210,1)
    plt.subplot2grid((2,1),(0,0))
    dpl.plot_hist(df.dropna().astype(float),'Velocity','km/h',bins=20,normed=False)
    plt.xlim([np.min(x),np.max(x)])

    plt.subplot2grid((2,1),(1,0))
    dpl.plot_ecdf(df.dropna().astype(float),x,'Velocity','km/h')
    plt.xlim([np.min(x),np.max(x)])
    if args.print:
        plt.savefig(args.print[1],dpi=300,bbox_inches='tight')

    plt.figure()
    x = np.arange(-5,220,10)
    dpl.plot_hist(df.dropna().astype(float),'Velocity','km/h',bins=x,normed=False)
    plt.xlim([np.min(x),np.max(x)])
    if args.print:
        plt.savefig(args.print[2],dpi=600,bbox_inches='tight')

    input('Press any key')