From e4360a48435cc762855d356b208b5544e6f40c4b Mon Sep 17 00:00:00 2001 From: Eugeniy Mikhailov Date: Thu, 28 Feb 2013 14:59:55 -0500 Subject: Added python version of mode-matching code by Bain Bronner --- beam_tracing/python/classes.py | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 beam_tracing/python/classes.py (limited to 'beam_tracing/python/classes.py') diff --git a/beam_tracing/python/classes.py b/beam_tracing/python/classes.py new file mode 100644 index 0000000..d4ee631 --- /dev/null +++ b/beam_tracing/python/classes.py @@ -0,0 +1,37 @@ +import numpy as np + +class beam: + def __init__(self): + '''light beam class''' + # source of light beam; default (0,0) + beam.origin = np.array([]) + # k-vector or direction of light beam; default (1,1) + beam.k = np.array([]) + # intensity of light beam; default max + beam.intensity = 1.0 + # if beam starts at a face, the face index; default none + beam.face = None + # 0 for s-polarization 1 for p-polarization; default s + beam.polarization = 0 + # status: incoming, reflected, or refracted; default incoming + beam.status = 'incoming' + +class face: + def __init__(self): + '''prism face class''' + # first vertex point + face.vertex1 = np.array([]) + # second vertex point + face.vertex2 = np.array([]) + # left (right) side is left (right) of line from vertex 1 to 2 + # index of refraction for the left side + face.nLeft = np.array([]) + # index of refraction for the right side + face.nRight = np.array([]) + +class border: + def __init__(self): + border.vertex1 = np.array([]) + border.vertex2 = np.array([]) + border.nLeft = np.array([]) + border.nRight = np.array([]) \ No newline at end of file -- cgit v1.2.3