rayoptics.seq.interface module
Base class for Interfaces
- class InteractionMode(value)[source]
Bases:
Enum
enum for different interact_mode specifications
Retained to restore old files
Deprecated since version 0.4.5.
- Transmit = 1
propagate in transmission at this interface
- Reflect = 2
propagate in reflection at this interface
- class Interface(interact_mode='transmit', delta_n=0.0, max_ap=1.0, decenter=None, phase_element=None, **kwargs)[source]
Bases:
object
Basic part of a sequential model
The
SequentialModel
is a sequence of Interfaces and Gaps. The Interface class is a boundary between two adjacent Gaps and their associated media. It specifies several methods that must be implemented to model the optical behavior of the interface.The Interface class addresses the following use cases:
- support for ray intersection calculation during ray tracing
interfaces can be tilted and decentered wrt the adjacent gaps
support for getting and setting the optical power of the interface
support for various optical properties, i.e. does it reflect or transmit
supports a basic idea of size, the max_aperture
- interact_mode
‘transmit’ | ‘reflect’ | ‘dummy’
- delta_n
refractive index difference across the interface
- decenter
DecenterData
for the interface, if specified
- max_aperture
the maximum aperture radius on the interface
- property profile_cv
- edge_pt_target(rel_dir)[source]
Get a target for ray aiming to aperture boundaries.
The main use case for this function is iterating a ray to the internal edge of a surface.
Although rel_dir is given as a 2d vector, in practice only the 4 quadrant axes are handled in the implementation, a 1D directional search along a coordinate axis.
- Parameters:
rel_dir – 2d vector encoding coord axis and direction for edge sample
- Returns:
intersection point of rel_dir with the aperture boundary
- Return type:
edge_pt
- point_inside(x: float, y: float, fuzz: float = 1e-05) bool [source]
Returns True if the point (x, y) is inside the clear aperture.
- Parameters:
x – x coodinate of the test point
y – y coodinate of the test point
fuzz – tolerance on test pt/aperture comparison, i.e. pt fuzzy <= surface_od
- intersect(p0, d, eps=1e-12, z_dir=1)[source]
Intersect an
Interface
, starting from an arbitrary point.- Parameters:
p0 – start point of the ray in the interface’s coordinate system
d – direction cosine of the ray in the interface’s coordinate system
z_dir – +1 if propagation positive direction, -1 if otherwise
eps – numeric tolerance for convergence of any iterative procedure
- Returns:
distance to intersection point s1, intersection point p
- Return type:
- Raises: