Skip to content
Snippets Groups Projects
Commit e520df1e authored by Ashwin Rao's avatar Ashwin Rao
Browse files

cleanup parse notebook

parent 7c722128
No related branches found
No related tags found
No related merge requests found
%% Cell type:code id: tags:
``` python
# Parse the RTCM3 Logs
import seaborn as sns
import pandas
import matplotlib.pyplot as plt
```
%% Cell type:markdown id: tags:
# Read the files and pre process them for plotting.
%% Cell type:code id: tags:
``` python
# Read the file
timestamps = pandas.read_csv("./timestamps.csv")
# Compute the latency in ms
timestamps["Latency"] = (timestamps["ts_client"]-timestamps["ts_relay"])*1000
# Inter-arrival time between messages. The diff is in microsec
timestamps['relay_iat'] = timestamps['ts_relay'].diff()
timestamps['client_iat'] = timestamps['ts_client'].diff()
timestamps['iat_diff'] = (timestamps['relay_iat']-timestamps['client_iat'])*1000
print(timestamps)
ping = pandas.read_csv("./ping.csv")
print(ping)
ping['Latency'] = ping['rtt']/2.0
```
%% Cell type:code id: tags:
``` python
fig, ax = plt.subplots(figsize=(10,5))
sns.set_context("poster"),
sns.set_style("white")
sns.boxplot(data=timestamps, x="Location", y="Latency",hue="Technology", whis=[5,95], showfliers=False)
#handles, labels = ax.get_legend_handles_labels()
#ax.set_xticklabels(labels=['Ethernet', 'Wi-Fi', '5G'])
ax.set_ylim(0,50)
ax.set_xlabel("Location")
ax.set_ylabel("Latency (ms)")
ax.grid(True, which='major', axis='y')
plt.savefig("timestamps.pdf", dpi=1200, bbox_inches='tight')
```
%% Cell type:markdown id: tags:
# Plot the one way latency between the client and the relay
%% Cell type:code id: tags:
``` python
```
%% Cell type:code id: tags:
``` python
fig, ax = plt.subplots(figsize=(10,5))
sns.set_context("poster"),
sns.set_style("white")
sns.boxplot(data=ping, x="Location", y="Latency",hue="Technology", whis=[5,95], showfliers=False)
ax.set_xlabel("Location")
ax.set_ylabel("Latency (ms)")
ax.set_ylim(0,50)
ax.grid(True, which='major', axis='y')
plt.savefig("ping.pdf", dpi=1200, bbox_inches='tight')
```
%% Cell type:markdown id: tags:
# Plot the difference in the inter-arrival time of the messages.
%% Cell type:code id: tags:
``` python
fig, ax = plt.subplots(figsize=(10,5))
sns.set_context("poster"),
sns.set_style("white")
sns.boxplot(data=timestamps, x="Location", y="iat_diff",hue="Technology", whis=[5,95], showfliers=False)
ax.set_xlabel("Location")
ax.set_ylabel("Inter-arrival Time \n Difference (μs)")
```
%% Cell type:code id: tags:
``` python
```
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment