-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.html
77 lines (71 loc) · 2.51 KB
/
main.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<h1>A Simple Oriole</h1>
<p>A really simple example:</p>
<p>You can write paragraphs like this.</p>
<pre data-code-language="python" data-executable="true" data-type="programlisting">hey = "hello world", 38+4
print(hey hello. This is an executable code block )!
</pre>
<div id="the-id">
<p>This is a block inside a div with an id the-id.
Very cool. Yes.</p>
</div>
<pre data-code-language="" >hey = "hello world", 38+4
print(hey hello. This is a non executable block )!
</pre>
<div id="another-id">
<h2>More complicated example</h2>
</div>
<pre data-code-language="python" data-executable="true" data-type="programlisting">x = [1,1]
for i in range(12):
x.append(x[-1] + x[-2])
print(', '.join(str(y) for y in x))
</pre>
<h2>A Chart</h2>
<div id="this-example">
</div>
<pre data-code-language="python" data-executable="true" data-type="programlisting">%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
x = np.linspace(0, 3*np.pi, 500)
plt.plot(x, np.sin(x**2))
plt.title('A simple chirp');
</pre>
<h2>Seaborn Example</h2>
<pre data-code-language="python" data-executable="true" data-type="programlisting">from __future__ import print_function, division
%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
x = np.linspace(0, 10, 1000)
plt.plot(x, np.sin(x), x, np.cos(x));
import seaborn as sns
sns.set()
plt.plot(x, np.sin(x), x, np.cos(x));
</pre>
<h2>Interactive widgets</h2>
<pre data-code-language="python" data-executable="true" data-type="programlisting">%matplotlib inline
from IPython.display import Image
from IPython.html.widgets import interact
from numpy import pi, cos, sin
import numpy as np
import pylab as plt
import seaborn as sns
sns.set()
</pre>
<pre data-code-language="pyt" data-executable="true" data-type="programlisting">def plot_fringe(bl_length, wavelength):
""" Plot the fringe function for a baseline (see Fig 1)
bl_length: distance between antennas, in m
wavelength: wavelength, in m
"""
theta = np.linspace(-np.pi, np.pi, 401)
l = sin(theta)
F = cos(2 * pi * bl_length * l / wavelength)
F2 = cos(2 * pi * 2 * bl_length * l / wavelength)
plt.plot(l, F, c='#cc0000', label="Baseline 1-2")
plt.plot(l, F2, c='#0000cc', label="Baseline 1-3")
plt.xlabel("$sin(\\theta)$")
plt.ylabel("Fringe amplitude")
plt.ylim(-2, 2)
plt.legend()
f = interact(plot_fringe, bl_length=(1, 100), wavelength=(1, 100))
</pre>
</pre>