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, in_dir, srf_nrml, ifc_cntxt)[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, in_dir, srf_nrml, ifc_cntxt)[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

  • 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

class HolographicElement(label='')[source]

Bases: object

Two point hologram element.

listobj_str()[source]
phase(pt, in_dir, srf_nrml, ifc_cntxt)[source]