Adds pdf export.
This commit is contained in:
@@ -134,24 +134,6 @@ if __name__ == "__main__":
|
|||||||
lambda x: ((x * 8) / args.interval) / 10**6
|
lambda x: ((x * 8) / args.interval) / 10**6
|
||||||
)
|
)
|
||||||
|
|
||||||
# load dataframe an put it into geopandas
|
|
||||||
df = pd.read_csv(args.gps_file)
|
|
||||||
df["kmh"] = df["speed (knots)"].apply(lambda x: x * 1.852)
|
|
||||||
df = df.set_index("datetime")
|
|
||||||
df.index = pd.to_datetime(df.index)
|
|
||||||
|
|
||||||
gdf = gpd.GeoDataFrame(
|
|
||||||
df,
|
|
||||||
geometry=gpd.points_from_xy(df["longitude"], df["latitude"]),
|
|
||||||
crs="EPSG:4326",
|
|
||||||
)
|
|
||||||
gdf = pd.merge_asof(
|
|
||||||
gdf,
|
|
||||||
transmission_df,
|
|
||||||
tolerance=pd.Timedelta("10s"),
|
|
||||||
right_index=True,
|
|
||||||
left_index=True,
|
|
||||||
)
|
|
||||||
|
|
||||||
# read serial csv
|
# read serial csv
|
||||||
serial_df = pd.read_csv(args.serial_file)
|
serial_df = pd.read_csv(args.serial_file)
|
||||||
@@ -159,17 +141,14 @@ if __name__ == "__main__":
|
|||||||
serial_df = serial_df.set_index("datetime")
|
serial_df = serial_df.set_index("datetime")
|
||||||
serial_df.index = pd.to_datetime(serial_df.index)
|
serial_df.index = pd.to_datetime(serial_df.index)
|
||||||
|
|
||||||
gdf = pd.merge_asof(
|
transmission_df = pd.merge_asof(
|
||||||
gdf,
|
transmission_df,
|
||||||
serial_df,
|
serial_df,
|
||||||
tolerance=pd.Timedelta("1s"),
|
tolerance=pd.Timedelta("1s"),
|
||||||
right_index=True,
|
right_index=True,
|
||||||
left_index=True,
|
left_index=True,
|
||||||
)
|
)
|
||||||
|
|
||||||
# format to needed format and add basemap as background
|
|
||||||
df_wm = gdf.to_crs(epsg=3857)
|
|
||||||
|
|
||||||
scaley = 1.5
|
scaley = 1.5
|
||||||
scalex = 1.0
|
scalex = 1.0
|
||||||
plt.figure(figsize=[6.4 * scaley, 4.8 * scalex])
|
plt.figure(figsize=[6.4 * scaley, 4.8 * scalex])
|
||||||
@@ -190,7 +169,7 @@ if __name__ == "__main__":
|
|||||||
par12.axis["right"].toggle(all=True)
|
par12.axis["right"].toggle(all=True)
|
||||||
# par13.axis["right"].toggle(all=True)
|
# par13.axis["right"].toggle(all=True)
|
||||||
|
|
||||||
host.plot(gdf["goodput"], "-", color="blue", label="goodput" )
|
host.plot(transmission_df["goodput"], "-", color="blue", label="goodput" )
|
||||||
host.set_xlabel("datetime")
|
host.set_xlabel("datetime")
|
||||||
host.set_ylabel("goodput [Mbps]")
|
host.set_ylabel("goodput [Mbps]")
|
||||||
#host.set_ylim([0, 13])
|
#host.set_ylim([0, 13])
|
||||||
@@ -199,7 +178,7 @@ if __name__ == "__main__":
|
|||||||
#host.set_yscale("log")
|
#host.set_yscale("log")
|
||||||
#host.set_yscale("log")
|
#host.set_yscale("log")
|
||||||
|
|
||||||
par11.plot(gdf["downlink_cqi"], "--", color="green", label="CQI")
|
par11.plot(transmission_df["downlink_cqi"], "--", color="green", label="CQI")
|
||||||
par11.set_ylabel("CQI")
|
par11.set_ylabel("CQI")
|
||||||
par11.set_ylim([0, 15])
|
par11.set_ylim([0, 15])
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user