Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 020d527

Browse files
committed
DBR generation
1 parent 1b5c0e6 commit 020d527

File tree

2 files changed

+32
-15
lines changed

2 files changed

+32
-15
lines changed

‎dbr.py

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from numpy import *
22
from pylab import *
33
import timeit
4-
4+
importdbrprop
55

66
class DBRMirror:
77
def __init__(self, data):
@@ -34,20 +34,21 @@ def reflection_coeff(self, incidentwavelength):
3434

3535
start = timeit.default_timer()
3636

37-
data = array([
38-
[1.0, inf],
39-
[3.5, 74.0],
40-
[3.0, 92.5],
41-
[3.5, 74.0],
42-
[3.0, 92.5],
43-
[3.5, 74.0],
44-
[3.0, 92.5],
45-
[3.5, inf]
46-
])
47-
48-
NewMirror = DBRMirror(data)
49-
50-
wavelength = array(linspace(600, 2000, 10000))
37+
# data = array([
38+
# [1.0, inf],
39+
# [3.5, 74.0],
40+
# [3.0, 92.5],
41+
# [3.5, 74.0],
42+
# [3.0, 92.5],
43+
# [3.5, 74.0],
44+
# [3.0, 92.5],
45+
# [3.5, inf]
46+
# ])
47+
48+
New = dbrprop.DBRprop()
49+
NewMirror = DBRMirror(New.data)
50+
51+
wavelength = array(linspace(400, 4000, 1000))
5152

5253
gdd = NewMirror.reflection_coeff(wavelength)
5354

‎dbrprop.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import numpy as np
2+
3+
class DBRprop:
4+
def __init__(self):
5+
self.nbr = np.random.randint(15,5000)
6+
self.n = np.random.rand(2)*5 + 0.00000001
7+
self.d = np.random.rand(2)*10000+ 3
8+
# creation of array of data representing the mirror
9+
self.data = np.array([[self.n[0], 0]])
10+
self.data = np.vstack((self.data, [self.n[1], self.d[1]]))
11+
for k in range(self.nbr - 4):
12+
self.data = np.vstack((self.data, [self.n[0], self.d[0]]))
13+
self.data = np.vstack((self.data, [self.n[1], self.d[1]]))
14+
self.data = np.vstack((self.data, [self.n[0], self.d[0]]))
15+
self.data = np.vstack((self.data, [self.n[1],0]))
16+

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /