rayoptics.elem.surface module

Module for optical surface related classes

Surface

Container of profile, extent, position and orientation information of the surface

DecenterData

Maintains data and actions to support 4 types of position and orientation changes.

  • DEC: pos and orientation applied prior to surface

  • REV: pos and orientation applied following surface in reverse

  • DAR: pos and orientation applied prior to surface and then returned to initial frame

  • BEN: used for fold mirrors, orientation applied before and after surface

Aperture
  • Circular

  • Rectangular

  • Elliptical

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 Surface(lbl='', profile=None, clear_apertures=None, edge_apertures=None, **kwargs)[source]

Bases: Interface

Container of profile, extent, position and orientation.

label

optional label

profile

SurfaceProfile

clear_apertures

list of Aperture

edge_apertures

list of Aperture

interface_type()[source]
listobj_str()[source]
update()[source]
sync_to_restore(opt_model)[source]
property profile_cv
property optical_power
set_optical_power(pwr, n_before, n_after)[source]
apply_scale_factor(scale_factor)[source]
from_first_order(nu_before, nu_after, y)[source]
z_sag(pt)[source]
set_z_sag(pt)[source]
calc_cv_from_zsag(pt)[source]
flip()[source]
surface_od()[source]
point_inside(x, y)[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

get_y_aperture_extent()[source]

returns [y_min, y_max] for the union of apertures

full_profile(edge_extent, flat_id=None, dir=1, steps=6)[source]
intersect(p0, d, eps=1e-12, z_dir=1.0)[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.

class DecenterData(dtype, x=0.0, y=0.0, alpha=0.0, beta=0.0, gamma=0.0)[source]

Bases: object

Maintains data and actions for position and orientation changes.

  • ‘decenter’: pos and orientation applied prior to surface

  • ‘reverse’: pos and orientation applied following surface in reverse

  • ‘dec and return’: pos and orientation applied prior to surface and then returned to initial frame

  • ‘bend’: used for fold mirrors, orientation applied before and after surface

listobj_str()[source]
property dtype
update()[source]
apply_scale_factor(scale_factor)[source]
tform_before_surf()[source]
tform_after_surf()[source]
class Aperture(x_offset=0.0, y_offset=0.0, rotation=0.0)[source]

Bases: object

sync_to_restore(opt_model)[source]
listobj_str()[source]
dimension()[source]
set_dimension(x, y)[source]
max_dimension()[source]
point_inside(x, y)[source]
bounding_box()[source]
apply_scale_factor(scale_factor)[source]
tform(x, y)[source]
class Circular(radius=1.0, **kwargs)[source]

Bases: Aperture

listobj_str()[source]
dimension()[source]
set_dimension(x, y)[source]
max_dimension()[source]
point_inside(x, y)[source]
apply_scale_factor(scale_factor)[source]
class Rectangular(x_half_width=1.0, y_half_width=1.0, **kwargs)[source]

Bases: Aperture

listobj_str()[source]
dimension()[source]
set_dimension(x, y)[source]
point_inside(x, y)[source]
apply_scale_factor(scale_factor)[source]
class Elliptical(x_half_width=1.0, y_half_width=1.0, **kwargs)[source]

Bases: Aperture

listobj_str()[source]
dimension()[source]
set_dimension(x, y)[source]
apply_scale_factor(scale_factor)[source]