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

Cleaned up ipy

parent e7e36f4d
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:code id: tags:
``` python
# Read the file
timestamps = pandas.read_csv("./timestamps.csv")
timestamps["Latency"] = (timestamps["ts_client"]-timestamps["ts_relay"])*1000
print(timestamps)
```
%% Output
Location Technology ts_relay ts_client Latency
0 University Ethernet 1.612947e+09 1.612947e+09 3.827095
1 University Ethernet 1.612947e+09 1.612947e+09 3.447056
2 University Ethernet 1.612947e+09 1.612947e+09 3.516912
3 University Ethernet 1.612947e+09 1.612947e+09 3.500938
4 University Ethernet 1.612947e+09 1.612947e+09 3.642082
... ... ... ... ... ...
6490 University 5G 1.612960e+09 1.612960e+09 16.270876
6491 University 5G 1.612960e+09 1.612960e+09 16.198874
6492 University 5G 1.612960e+09 1.612960e+09 4.643917
6493 University 5G 1.612960e+09 1.612960e+09 15.842915
6494 University 5G 1.612960e+09 1.612960e+09 21.540880
[6495 rows x 5 columns]
%% 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')
```
%% Output
%% Cell type:code id: tags:
``` python
ping = pandas.read_csv("./ping.csv")
print(ping)
ping['Latency'] = ping['rtt']/2.0
```
%% Output
Location Technology rtt
0 University Ethernet 1.49
1 University Ethernet 2.00
2 University Ethernet 1.57
3 University Ethernet 1.68
4 University Ethernet 1.98
... ... ... ...
5418 University 5G 25.60
5419 University 5G 24.00
5420 University 5G 20.60
5421 University 5G 18.70
5422 University 5G 30.60
[5423 rows x 3 columns]
%% 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("Scenario")
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')
```
%% Output
%% 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