rayoptics.oprops.doe module

Module for diffractive/holographic optical elements

Classes that implement diffractive optics capabilities must implement the function phase() for use by the ray trace engine.

The DiffractiveElement and HolographicElement implementations are patterned after Wang, et al, Ray tracing and wave aberration calculation for diffractive optical elements

radial_phase_fct(pt, coefficients)[source]

Evaluate the phase and slopes at pt

Parameters:
  • pt – 3d point of incidence in Interface coordinates

  • coefficients – list of even power radial phase coefficients, e.g. r**2, r**4, …

Returns:

(dW, dWdX, dWdY)

  • dW: phase added by diffractive interaction

  • dWdX: slope in x direction

  • dWdY: slope in y direction

class DiffractionGrating(label='', order=1, grating_normal=None, grating_freq_um=1.0, grating_lpmm=None, interact_mode='transmit')[source]

Bases: object

Linear (ruled) diffraction grating.

The phase calculation is patterned after Ludwig, Generalized grating ray-tracing equations.

grating_normal

grating generation surface normal (G)

grating_lpmm

the grating frequency in lines/mm

grating_freq_um

grating frequency in lines per micrometer

order

integer diffraction order used in phase calculation

interact_mode

‘transmit’|’reflect’

label

string description

property grating_lpmm

the grating spacing in lines/mm.

property grating_freq_um
listobj_str()[source]
phase(pt: ndarray[tuple[Any, ...], dtype[float64]], in_dir: ndarray[tuple[Any, ...], dtype[float64]], srf_nrml: ndarray[tuple[Any, ...], dtype[float64]], ifc_cntxt) tuple[ndarray[tuple[Any, ...], dtype[float64]], float][source]
phase_ludwig(pt: ndarray[tuple[Any, ...], dtype[float64]], in_dir: ndarray[tuple[Any, ...], dtype[float64]], srf_nrml: ndarray[tuple[Any, ...], dtype[float64]], ifc_cntxt) tuple[ndarray[tuple[Any, ...], dtype[float64]], float][source]
phase_welford(pt: ndarray[tuple[Any, ...], dtype[float64]], in_dir: ndarray[tuple[Any, ...], dtype[float64]], srf_nrml: ndarray[tuple[Any, ...], dtype[float64]], ifc_cntxt) tuple[ndarray[tuple[Any, ...], dtype[float64]], float][source]
class DiffractiveElement(label='', coefficients=None, ref_wl=550.0, order=1, phase_fct=None)[source]

Bases: object

Container class for a phase fct driven diffractive optical element

phase_fct

fct the takes an input pt and returns phase and slope

coefficients

list of coeficients for phase function

ref_wl

wavelength in nm for phase measurement

order

which diffracted order to calculate the phase for

label

optical labeling for listing

listobj_str()[source]
phase(pt: ndarray[tuple[Any, ...], dtype[float64]], in_dir: ndarray[tuple[Any, ...], dtype[float64]], srf_nrml: ndarray[tuple[Any, ...], dtype[float64]], ifc_cntxt) tuple[ndarray[tuple[Any, ...], dtype[float64]], float][source]

Returns a diffracted ray and phase increment.

Parameters:
  • pt – point of incidence in Interface coordinates

  • in_dir – incoming direction cosine of incident ray

  • srf_nrmlInterface surface normal at pt

  • ifc_cntxt – tuple containing 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 interact_mode: ‘transmit’ or ‘reflect’

Returns:

(out_dir, dW)

  • out_dir: direction cosine of the out going ray

  • dW: phase added by diffractive interaction

class HolographicElement(label: str = '', ref_pt: ndarray[tuple[Any, ...], dtype[float64]] | None = None, ref_virtual: bool = False, obj_pt: ndarray[tuple[Any, ...], dtype[float64]] | None = None, obj_virtual: bool = False, ref_wl: float = 550.0)[source]

Bases: object

Two point hologram element.

A two point hologram is formed by the interference of two wavefronts, an object wavefront and a reference wavefront. The locations of the point sources producing the wavefronts define the focal length of the element. For the case of volume holograms, the fringe orientation in the volume determines whether the primary diffracted wave is transmitted or reflected. The virtual flags for each wavefront can be used produced the desired outcome.

label

str optional label for HOE

ref_pt

location of the reference wave source

ref_virtual

if False, diverges from the source

obj_pt

location of the object wave source

obj_virtual

if False, diverges from the source

ref_wl

the construction/exposure wavelength (nm) for the HOE

The virtual flags are used to indicate whether a wavefront is diverging from the source (False) or, if True, converging towards the [virtual] source.

listobj_str()[source]
phase(pt: ndarray[tuple[Any, ...], dtype[float64]], in_dir: ndarray[tuple[Any, ...], dtype[float64]], srf_nrml: ndarray[tuple[Any, ...], dtype[float64]], ifc_cntxt) tuple[ndarray[tuple[Any, ...], dtype[float64]], float][source]