From 45b8c74b02e277affbed530eed19ecca4a9af865 Mon Sep 17 00:00:00 2001 From: Lukas Prause Date: Mon, 12 Dec 2022 13:21:43 +0100 Subject: [PATCH] Adds pdf export. --- plot_transmission_timeline.py | 29 ++++------------------------- 1 file changed, 4 insertions(+), 25 deletions(-) diff --git a/plot_transmission_timeline.py b/plot_transmission_timeline.py index 21106fd..d360374 100755 --- a/plot_transmission_timeline.py +++ b/plot_transmission_timeline.py @@ -134,24 +134,6 @@ if __name__ == "__main__": 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 serial_df = pd.read_csv(args.serial_file) @@ -159,17 +141,14 @@ if __name__ == "__main__": serial_df = serial_df.set_index("datetime") serial_df.index = pd.to_datetime(serial_df.index) - gdf = pd.merge_asof( - gdf, + transmission_df = pd.merge_asof( + transmission_df, serial_df, tolerance=pd.Timedelta("1s"), right_index=True, left_index=True, ) - # format to needed format and add basemap as background - df_wm = gdf.to_crs(epsg=3857) - scaley = 1.5 scalex = 1.0 plt.figure(figsize=[6.4 * scaley, 4.8 * scalex]) @@ -190,7 +169,7 @@ if __name__ == "__main__": par12.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_ylabel("goodput [Mbps]") #host.set_ylim([0, 13]) @@ -199,7 +178,7 @@ if __name__ == "__main__": #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_ylim([0, 15])