Ejemplo n.º 1
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 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')