diff --git a/plot_single_transmission_EM9190.py b/plot_single_transmission_EM9190.py index d316d4d..d5b4d5e 100755 --- a/plot_single_transmission_EM9190.py +++ b/plot_single_transmission_EM9190.py @@ -145,10 +145,8 @@ if __name__ == "__main__": 0, np.NaN ) transmission_df["RSRQ_(dB)"] = transmission_df["RSRQ_(dB)"].replace(0, np.NaN) - # stacked plot for bandwidth - # transmission_df["lte_bw_sum"] = transmission_df["bw_sum"] - transmission_df["NR5G_dl_bw"] - # transmission_df["nr_bw_sum"] = transmission_df["NR5G_dl_bw"] + # filter active state for i in range(1, 5): transmission_df["LTE_SCC{}_effective_bw".format(i)] = transmission_df[ "LTE_SCC{}_bw".format(i) @@ -159,7 +157,14 @@ if __name__ == "__main__": "LTE_SCC{}_effective_bw".format(i) ].where(mask, other=0) - # df = df.filter(["LTE_SCC1_state", "LTE_SCC1_bw", "LTE_SCC1_effective_bw"]) + # filter if sc is usesd for uplink + for i in range(1, 5): + mask = transmission_df["LTE_SCC{}_UL_Configured".format(i)].isin([False]) + transmission_df["LTE_SCC{}_effective_bw".format(i)] = transmission_df[ + "LTE_SCC{}_effective_bw".format(i) + ].where(mask, other=0) + + # sum all effective bandwidth for 5G and 4G transmission_df["SCC1_NR5G_effective_bw"] = transmission_df[ "SCC1_NR5G_bw" ].fillna(0) diff --git a/plot_stacked_bandwidth.py b/plot_stacked_bandwidth.py index 35d16cb..f3bb376 100755 --- a/plot_stacked_bandwidth.py +++ b/plot_stacked_bandwidth.py @@ -6,6 +6,22 @@ from argparse import ArgumentParser import pandas as pd import matplotlib.pyplot as plt + +plt_params = { + "pgf.texsystem": "lualatex", + "legend.fontsize": "x-large", + "figure.figsize": (15, 5), + "axes.labelsize": 15, # "small", + "axes.titlesize": "x-large", + "xtick.labelsize": 15, # "small", + "ytick.labelsize": 15, # "small", + "legend.fontsize": 15, + "axes.formatter.use_mathtext": True, + "mathtext.fontset": "dejavusans", +} + +plt.rcParams.update(plt_params) + if __name__ == "__main__": parser = ArgumentParser() parser.add_argument("-f", "--file", required=True, help="Serial CSV") @@ -17,6 +33,7 @@ if __name__ == "__main__": df["time_rel"] = df["time"] - df["time"].iloc[0] df.index = df["time_rel"] / 60 + # filter active state for i in range(1, 5): df["LTE_SCC{}_effective_bw".format(i)] = df["LTE_SCC{}_bw".format(i)] @@ -25,6 +42,14 @@ if __name__ == "__main__": "LTE_SCC{}_effective_bw".format(i) ].where(mask, other=0) + # filter if sc is usesd for uplink + for i in range(1, 5): + mask = df["LTE_SCC{}_UL_Configured".format(i)].isin([False]) + df["LTE_SCC{}_effective_bw".format(i)] = df[ + "LTE_SCC{}_effective_bw".format(i) + ].where(mask, other=0) + + # sum all effective bandwidth for 5G and 4G df["SCC1_NR5G_effective_bw"] = df["SCC1_NR5G_bw"].fillna(0) df["effective_bw_sum"] = ( df["SCC1_NR5G_effective_bw"] @@ -43,9 +68,11 @@ if __name__ == "__main__": "LTE_SCC4_effective_bw", ] - ax = df[bw_cols].plot.area(stacked=True) + ax = df[bw_cols].plot.area(stacked=True, linewidth=0) ax.set_ylabel("bandwidth [MHz]") ax.set_xlabel("time [minutes]") + ax.set_xlim([0,df.index[-1]]) + L = plt.legend() L.get_texts()[0].set_text("5G main")