rayoptics.raytr.waveabr module

Wavefront aberration calculations

Functions for setting up and calculating wavefront aberrations for (fld, wvl, foc), including focus and image shift.

calculate_reference_sphere(opt_model, fld, wvl, foc, chief_ray_pkg, image_pt_2d=None, image_delta=None)[source]

Compute the reference sphere for a defocussed image point at fld.

Parameters:
  • opt_modelOpticalModel instance

  • fldField point for wave aberration calculation

  • wvl – wavelength of ray (nm)

  • foc – defocus amount

  • chief_ray_pkg – input tuple of chief_ray, cr_exp_seg

  • image_pt_2d – x, y image point in (defocussed) image plane, if None, use the chief ray coordinate.

  • image_delta – x, y displacements from image_pt_2d in (defocussed) image plane, if not None.

Returns:

tuple of image_pt, ref_dir, ref_sphere_radius

Return type:

ref_sphere

transfer_to_exit_pupil(interface, ray_seg, exp_dst_parax)[source]

Given the exiting interface and chief ray data, return exit pupil ray coords.

Parameters:
  • interface – the exiting :class:’~.Interface’ for the path sequence

  • ray_seg – ray segment exiting from interface

  • exp_dst_parax – z distance to the paraxial exit pupil

Returns:

(exp_pt, exp_dir, exp_dst)

  • exp_pt - ray intersection with exit pupil plane

  • exp_dir - direction cosine of the ray in exit pupil space

  • exp_dst - distance from interface to exit pupil pt

eic_distance(r, r0)[source]

calculate equally inclined chord distance between 2 rays

Parameters:
  • r – (p, d), where p is a point on the ray r and d is the direction cosine of r

  • r0 – (p0, d0), where p0 is a point on the ray r0 and d0 is the direction cosine of r0

Returns:

distance along r from equally inclined chord point to p

Return type:

float

wave_abr_full_calc(fod, fld, wvl, foc, ray_pkg, chief_ray_pkg, ref_sphere)[source]

Given a ray, a chief ray and an image pt, evaluate the OPD.

The main references for the calculations are in the H. H. Hopkins paper Calculation of the Aberrations and Image Assessment for a General Optical System

Parameters:
  • fodFirstOrderData for object and image space refractive indices

  • fldField point for wave aberration calculation

  • wvl – wavelength of ray (nm)

  • foc – defocus amount

  • ray_pkg – input tuple of ray, ray_op, wvl

  • chief_ray_pkg – input tuple of chief_ray, cr_exp_seg

  • ref_sphere – input tuple of image_pt, ref_dir, ref_sphere_radius

Returns:

OPD of ray wrt chief ray at fld

Return type:

opd

wave_abr_pre_calc(fod, fld, wvl, foc, ray_pkg, chief_ray_pkg)[source]

Pre-calculate the part of the OPD calc independent of focus.

wave_abr_calc(fod, fld, wvl, foc, ray_pkg, chief_ray_pkg, pre_opd_pkg, ref_sphere)[source]

Given pre-calculated info and a ref. sphere, return the ray’s OPD.