示例#1
0
R1 = 1/((1/r_m)*cos(pi/2-theta_m)/2)
rho1 = 1/((1/r_m)*1/(2*cos(pi/2-theta_m)))
C1 = -1/R1
Cx1 = -1/rho1
asph1=None

#paraboloid
a1p = r_m*sin(2*theta_m)/(2*tan(theta_m)) - r_m*cos(2*theta_m)
A1p = 1/(2*r_m*sin(2*theta_m)*tan(theta_m))
C1p=-A1p
Cx1p=None
asph1p=-1

E = 38.75
E2 = 35.63
wavel1 = float(wl(E))*1e-9
alt = radians(3.5)
m = 1
ldensity = 1200.e3
theta = degrees(asin(m*wavel1*ldensity/(2*sin(radians(3.5)))))

# Define a starting ray as optical axis, along Z direction
r = phoray.Ray(Vector(0,0,0), Vector(0,0,1))

# A simple plane to serve as mirrors
p = phoray.Plane()

# -------------------- M1
d_m1 = 0.4
theta_m1 = radians(3)
angle_m1 = pi/2 - theta_m1
示例#2
0
s2 = beam4.gaussian_source((0, 0, 0), (fwhm/2.35, fwhm/2.35, 0.01),
                           (0, 0, 1), (4e-3/2.35, 4e-3/2.35, 0.01),
                           E2, 0.0,
                           n)

s1 = zip(s1[0], s1[1], s1[2])
s2 = zip(s2[0], s2[1], s2[2])

p1 = []
p2 = []

for a in s1:
    line = []
    line.extend(a[0])
    line.extend(a[1])
    line.extend(((float(wl(a[2][0]).rescale(m)), "r"), 1, None, None, None))
    p1.append(line)

for a in s2:
    line = []
    line.extend(a[0])
    line.extend(a[1])
    line.extend(((float(wl(a[2][0]).rescale(m)), "b"), 1, None, None, None))
    p2.append(line)

r = beam4.make_beam4_table(
("X0", "Y0", "Z0", "U0", "V0", "W0", "@wavel", "Order", "Xfinal", "Yfinal", "Notes"),
p1+p2, 15
)
#print p1