notebook.ipynb 2.81 KB
Newer Older
1
2
{
 "cells": [
3
4
  {
   "cell_type": "markdown",
Andreas Schmidt's avatar
Andreas Schmidt committed
5
   "metadata": {},
6
7
8
9
10
11
   "source": [
    "# X-Lap in Action"
   ]
  },
  {
   "cell_type": "markdown",
Andreas Schmidt's avatar
Andreas Schmidt committed
12
   "metadata": {},
13
14
15
16
   "source": [
    "## Imports"
   ]
  },
17
18
  {
   "cell_type": "code",
Andreas Schmidt's avatar
Andreas Schmidt committed
19
   "execution_count": null,
20
   "metadata": {
Andreas Schmidt's avatar
Andreas Schmidt committed
21
    "collapsed": true
22
23
24
   },
   "outputs": [],
   "source": [
Andreas Schmidt's avatar
Andreas Schmidt committed
25
26
27
    "import logging\n",
    "logger = logging.getLogger()\n",
    "logger.setLevel(logging.DEBUG)\n",
28
29
    "from ipywidgets import interact, interactive, fixed, interact_manual\n",
    "import ipywidgets as widgets\n",
Andreas Schmidt's avatar
Andreas Schmidt committed
30
    "from xlap.parse import evaluate, evaluate_side, parse_config\n",
31
    "import xlap.analyse.jitter as jitter\n",
32
    "from xlap.analyse.regress import linear as linear_regression\n",
33
    "from xlap.analyse.trace import traces\n",
Andreas Schmidt's avatar
Andreas Schmidt committed
34
35
36
    "from xlap.analyse.correlation import correlation\n",
    "import pandas as pd\n",
    "%matplotlib inline"
37
38
39
40
   ]
  },
  {
   "cell_type": "markdown",
Andreas Schmidt's avatar
Andreas Schmidt committed
41
   "metadata": {},
42
43
   "source": [
    "## Data Retrieval"
44
45
46
47
   ]
  },
  {
   "cell_type": "code",
Andreas Schmidt's avatar
Andreas Schmidt committed
48
   "execution_count": null,
49
   "metadata": {},
50
51
52
53
   "outputs": [],
   "source": [
    "config = parse_config()\n",
    "data_files = config[\"data_files\"]\n",
Andreas Schmidt's avatar
Andreas Schmidt committed
54
    "original = evaluate(data_files[\"sender\"], data_files[\"receiver\"], config=config, kind=0)[:4094]"
55
56
57
   ]
  },
  {
58
   "cell_type": "markdown",
Andreas Schmidt's avatar
Andreas Schmidt committed
59
   "metadata": {},
60
   "source": [
61
    "## Traces"
62
63
64
65
   ]
  },
  {
   "cell_type": "code",
Andreas Schmidt's avatar
Andreas Schmidt committed
66
   "execution_count": null,
Andreas Schmidt's avatar
Andreas Schmidt committed
67
   "metadata": {},
Andreas Schmidt's avatar
Andreas Schmidt committed
68
   "outputs": [],
69
   "source": [
70
71
72
73
74
    "traces(original, config)"
   ]
  },
  {
   "cell_type": "markdown",
Andreas Schmidt's avatar
Andreas Schmidt committed
75
   "metadata": {},
76
77
   "source": [
    "## Jitter Analysis"
78
79
80
81
   ]
  },
  {
   "cell_type": "code",
Andreas Schmidt's avatar
Andreas Schmidt committed
82
   "execution_count": null,
Andreas Schmidt's avatar
Andreas Schmidt committed
83
   "metadata": {},
Andreas Schmidt's avatar
Andreas Schmidt committed
84
   "outputs": [],
85
   "source": [
86
    "df = jitter.prep(original, config=config)\n",
Andreas Schmidt's avatar
Andreas Schmidt committed
87
    "jitter.trace_jitter(df, threshold=500)"
88
89
   ]
  },
90
91
92
93
94
95
96
97
98
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Correlation"
   ]
  },
  {
   "cell_type": "code",
Andreas Schmidt's avatar
Andreas Schmidt committed
99
   "execution_count": null,
Andreas Schmidt's avatar
Andreas Schmidt committed
100
   "metadata": {},
Andreas Schmidt's avatar
Andreas Schmidt committed
101
   "outputs": [],
102
   "source": [
Andreas Schmidt's avatar
Andreas Schmidt committed
103
    "correlation(df[df[\"EndToEnd_D\"] < 500], config)"
104
105
106
107
108
109
110
111
112
113
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.5.2"
133
134
135
  },
  "widgets": {
   "state": {
136
    "df95aa8c42974dfeaf8e0a2c05100645": {
137
138
139
140
141
142
143
144
     "views": [
      {
       "cell_index": 6
      }
     ]
    }
   },
   "version": "1.2.0"
145
146
147
148
149
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}