pyoptools.raytrace.surface.plane_mask module

Module that defines a reflective plane phase mask surface class

class pyoptools.raytrace.surface.plane_mask.RPPMask

Bases: Plane

Reflective plane phase mask surface.

A class to define diffractive plane surfaces that can be either reflective, transmissive, or both. The surface’s behavior is controlled by its reflectivity: 1 for purely reflective, 0 for purely transmissive, or a value between 0 and 1 for both behaviors.

Parameters:
  • phm (Poly2D, optional) – Polynomial describing the phase modulation of the grating. The X and Y input values of the polynomial are in microns. Default is a zero polynomial.

  • M (list, optional) – List of diffraction orders to consider. Default is [1].

  • *args – Additional arguments passed to the parent Plane class.

  • **kwargs – Additional arguments passed to the parent Plane class.

phm

Phase modulation polynomial

Type:

Poly2D

phx

X derivative of the phase modulation polynomial

Type:

Poly2D

phy

Y derivative of the phase modulation polynomial

Type:

Poly2D

M

Diffraction orders

Type:

list

Notes

The surface shape is given by the shape attribute inherited from the parent class.

Examples

Create a 10mm x 10mm linear grating with a fringe every 15 microns:

>>> g = RPPMask(shape=Rectangular(size=(10,10)),
...             phm=Poly2D([0,2*pi/15.,0]),
...             M=[1])
M
phm
phx
phy
propagate(incident_ray, ni, nr)

Calculate the propagation of a ray through a diffraction grating.

This method implements the physical behavior of light when it encounters a reflective plane phase mask, considering both transmitted and reflected diffracted rays based on the surface’s reflectivity. :param incident_ray: The incoming ray to be propagated :type incident_ray: Ray :param ni: Index of refraction of the incident medium :type ni: float :param nr: Index of refraction of the refractive medium :type nr: float

Returns:

List of Ray objects representing the propagated rays (transmitted and/or reflected) after interaction with the grating

Return type:

list

Notes

  • All units are in millimeters

  • The intensity of the output rays is divided equally among the diffraction orders

  • Physically impossible rays (where oz2 < 0) are handled by returning the incident ray direction with zero intensity