Bläddra i källkod

Adds a filter for uplink bandwidth.

master
langspielplatte 2 år sedan
förälder
incheckning
7f1e2699c9
2 ändrade filer med 37 tillägg och 5 borttagningar
  1. +9
    -4
      plot_single_transmission_EM9190.py
  2. +28
    -1
      plot_stacked_bandwidth.py

+ 9
- 4
plot_single_transmission_EM9190.py Visa fil

0, np.NaN 0, np.NaN
) )
transmission_df["RSRQ_(dB)"] = transmission_df["RSRQ_(dB)"].replace(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): for i in range(1, 5):
transmission_df["LTE_SCC{}_effective_bw".format(i)] = transmission_df[ transmission_df["LTE_SCC{}_effective_bw".format(i)] = transmission_df[
"LTE_SCC{}_bw".format(i) "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)


# 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[ transmission_df["SCC1_NR5G_effective_bw"] = transmission_df[
"SCC1_NR5G_bw" "SCC1_NR5G_bw"
].fillna(0) ].fillna(0)

+ 28
- 1
plot_stacked_bandwidth.py Visa fil

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")

Laddar…
Avbryt
Spara