ABCD.py 1.08 KB
Newer Older
1
import numpy as np
2
from pykat.optics.gaussian_beams import BeamParam
3
4

def apply(ABCD, q1, n1, n2):
5
    return BeamParam(nr=n2, q=n2 * (ABCD[0,0] * q1/float(n1) + ABCD[0,1]) / (ABCD[1,0] * q1/float(n1) + ABCD[1,1]))
6
7

def mirror_trans(n1, n2, Rc):
8
    return np.matrix([[1.0,0.0],[(n2-n1)/float(Rc),1.0]])
9

10
def mirror_refl(n, Rc):
11
    return np.matrix([[1.0,0.0],[-2.0*n/float(Rc),1.0]])
12

13
def bs_trans(n1, n2, Rcx, Rcy, alpha):
14
    alpha2=math.asin(n1/float(n2)*math.sin(alpha))
15
16
17
18
    c1=math.cos(alpha)
    c2=math.cos(alpha2)
    delta_n_t=(n2*c2-n1*c1)/(c1*c2)
    delta_n_s=n2*c2-n1*c1
19
20
    Mt= np.matrix([[c2/c1, 0.0],[delta_n_t/float(Rcx),c1/c2]])
    Ms= np.matrix([[1.0, 0.0],[delta_n_s/float(Rcy),1.0]])
21
22
    return(Mt, Ms)

23
def bs_refl(n1, n2, Rcx, Rcy, alpha):
24
25
    Mt= np.matrix([[1.0, 0.0],[-2.0*n1/(float(Rcx)*math.cos(alpha)),1.0]])
    Ms= np.matrix([[1.0, 0.0],[-2.0*n1*math.cos(alpha)/float(Rcy),1.0]])
26
    return(Mt, Ms)
27
28
    
def space(n,L):
29
    return np.matrix([[1.0, L/float(n)],[0.0,1.0]])
30
31
    
def lens(f):
32
    return np.matrix([[1.0, 0.0],[-1.0/f,1.0]])