|
|
|
|
|
|
|
|
import pandas as pd |
|
|
import pandas as pd |
|
|
import matplotlib.pyplot as plt |
|
|
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__": |
|
|
if __name__ == "__main__": |
|
|
parser = ArgumentParser() |
|
|
parser = ArgumentParser() |
|
|
parser.add_argument("-f", "--file", required=True, help="Serial CSV") |
|
|
parser.add_argument("-f", "--file", required=True, help="Serial CSV") |
|
|
|
|
|
|
|
|
df["time_rel"] = df["time"] - df["time"].iloc[0] |
|
|
df["time_rel"] = df["time"] - df["time"].iloc[0] |
|
|
df.index = df["time_rel"] / 60 |
|
|
df.index = df["time_rel"] / 60 |
|
|
|
|
|
|
|
|
|
|
|
# filter active state |
|
|
for i in range(1, 5): |
|
|
for i in range(1, 5): |
|
|
df["LTE_SCC{}_effective_bw".format(i)] = df["LTE_SCC{}_bw".format(i)] |
|
|
df["LTE_SCC{}_effective_bw".format(i)] = df["LTE_SCC{}_bw".format(i)] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"LTE_SCC{}_effective_bw".format(i) |
|
|
"LTE_SCC{}_effective_bw".format(i) |
|
|
].where(mask, other=0) |
|
|
].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["SCC1_NR5G_effective_bw"] = df["SCC1_NR5G_bw"].fillna(0) |
|
|
df["effective_bw_sum"] = ( |
|
|
df["effective_bw_sum"] = ( |
|
|
df["SCC1_NR5G_effective_bw"] |
|
|
df["SCC1_NR5G_effective_bw"] |
|
|
|
|
|
|
|
|
"LTE_SCC4_effective_bw", |
|
|
"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_ylabel("bandwidth [MHz]") |
|
|
ax.set_xlabel("time [minutes]") |
|
|
ax.set_xlabel("time [minutes]") |
|
|
|
|
|
ax.set_xlim([0,df.index[-1]]) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
L = plt.legend() |
|
|
L = plt.legend() |
|
|
L.get_texts()[0].set_text("5G main") |
|
|
L.get_texts()[0].set_text("5G main") |