rayoptics.seq.interface module

Base class for Interfaces

class InteractionMode[source]

Bases: enum.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

listobj_str()[source]
update()[source]
interface_type()[source]
sync_to_restore(opt_model)[source]
profile_cv
set_optical_power(pwr, n_before, n_after)[source]
surface_od()[source]
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
set_max_aperture(max_ap)[source]

max_ap is the max aperture radius

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:

tuple

Raises:

TraceMissedSurfaceError

normal(p)[source]

Returns the unit normal of the interface at point p.

phase(pt, in_dir, srf_nrml, z_dir, wl, n_in, n_out)[source]

Returns a diffracted ray direction and phase increment.

Parameters:
  • pt – point of incidence in Interface coordinates
  • in_dir – direction cosine of incident ray
  • srf_nrmlInterface surface normal at pt
  • z_dir – -1 if after an odd # of reflections, +1 otherwise
  • wl – wavelength in nm for ray, defaults to ref_wl
  • n_in – refractive index preceding the interface
  • n_out – refractive index following the interface
Returns:

(out_dir, dW)

  • out_dir: direction cosine of the out going ray
  • dW: phase added by diffractive interaction

apply_scale_factor(scale_factor)[source]