prysm.thinlens#

First-order optics equations for system modeling.

prysm.thinlens.object_to_image_dist(efl, object_distance)#

Compute the image distance from the object distance.

Parameters:
  • efl (float) – focal length of the lens

  • object_distance (float or ndarray) – distance from the object to the front principal plane of the lens, negative for an object to the left of the lens

Returns:

image distance. Distance from rear principal plane (assumed to be in contact with front principal plane) to image.

Return type:

float

Notes

efl and object distance should be in the same units. Return value will be in the same units as the inputs.

prysm.thinlens.image_to_object_dist(efl, image_distance)#

Compute the object distance from the image distance.

Parameters:
  • efl (float) – focal length of the lens

  • image_distance (float or ndarray) – distance from the object to the front principal plane of the lens, positive for an object in front of a lens of positive focal length.

Notes

efl and image distance should be in the same units. Return value will be in the same units as the input.

prysm.thinlens.object_image_to_efl(object_distance, image_distance)#

Compute focal length from a pair of conjugate distances.

Parameters:
  • object_distance (float or ndarray) – signed object distance from the front principal plane

  • image_distance (float or ndarray) – signed image distance from the rear principal plane

Returns:

focal length, in the same units as the inputs

Return type:

float or ndarray

prysm.thinlens.efl_to_power(efl, n=1)#

Convert effective focal length to optical power.

Parameters:
  • efl (float or ndarray) – effective focal length

  • n (float, optional) – refractive index of the surrounding medium

Returns:

optical power, in inverse units of efl

Return type:

float or ndarray

prysm.thinlens.power_to_efl(power, n=1)#

Convert optical power to effective focal length.

Parameters:
  • power (float or ndarray) – optical power

  • n (float, optional) – refractive index of the surrounding medium

Returns:

effective focal length

Return type:

float or ndarray

prysm.thinlens.efl_to_fno(efl, epd)#

Compute f/# from effective focal length and entrance pupil diameter.

Parameters:
  • efl (float or ndarray) – effective focal length

  • epd (float) – entrance pupil diameter

Returns:

f/number

Return type:

float or ndarray

prysm.thinlens.fno_to_efl(fno, epd)#

Compute effective focal length from f/# and entrance pupil diameter.

Parameters:
  • fno (float or ndarray) – f/number

  • epd (float) – entrance pupil diameter

Returns:

effective focal length

Return type:

float or ndarray

prysm.thinlens.fno_to_epd(fno, efl)#

Compute entrance pupil diameter from f/# and effective focal length.

Parameters:
  • fno (float or ndarray) – f/number

  • efl (float) – effective focal length

Returns:

entrance pupil diameter

Return type:

float or ndarray

prysm.thinlens.image_dist_epd_to_na(image_distance, epd)#

Compute the NA from an image distance and entrance pupil diameter.

Parameters:
  • image_distance (float) – distance from the image to the entrance pupil

  • epd (float) – diameter of the entrance pupil

Returns:

numerical aperture. The NA of the system.

Return type:

float

prysm.thinlens.image_dist_epd_to_fno(image_distance, epd)#

Compute the f/# from an image distance and entrance pupil diameter.

Parameters:
  • image_distance (float) – distance from the image to the entrance pupil

  • epd (float) – diameter of the entrance pupil

Returns:

fno. The working f/# of the system.

Return type:

float

prysm.thinlens.fno_to_na(fno)#

Convert an fno to an NA.

Parameters:

fno (float) – focal ratio

Returns:

NA. The NA of the system.

Return type:

float

prysm.thinlens.na_to_fno(na)#

Convert an NA to an f/#.

Parameters:

na (float) – numerical aperture

Returns:

fno. The f/# of the system.

Return type:

float

prysm.thinlens.object_dist_to_mag(efl, object_dist)#

Compute the linear magnification from the object distance and focal length.

Parameters:
  • efl (float) – focal length of the lens

  • object_dist (float) – object distance

Returns:

linear magnification. Also known as the lateral magnification

Return type:

float

prysm.thinlens.mag_to_object_dist(efl, mag)#

Compute the object distance for a given focal length and magnification.

Parameters:
  • efl (float) – focal length of the lens

  • mag (float) – signed magnification

Returns:

object distance

Return type:

float

prysm.thinlens.mag_to_image_dist(efl, mag)#

Compute the image distance for a given focal length and magnification.

Parameters:
  • efl (float) – focal length of the lens

  • mag (float) – signed magnification

Returns:

image distance

Return type:

float

prysm.thinlens.linear_to_long_mag(lateral_mag)#

Compute the longitudinal (along optical axis) magnification from the lateral mag.

Parameters:

lateral_mag (float) – linear magnification, from thin lens formulas

Returns:

longitudinal magnification

Return type:

float

prysm.thinlens.mag_to_fno(mag, infinite_fno, pupil_mag=1)#

Compute the working f/# from the magnification and infinite f/#.

Parameters:
  • mag (float or ndarray) – linear or lateral magnification

  • infinite_fno (float) – f/# as defined by EFL/EPD

  • pupil_mag (float) – pupil magnification

Returns:

working f/number

Return type:

float

prysm.thinlens.defocus_to_image_displacement(W020, fno, wavelength=None)#

Compute image displacment from wavefront defocus expressed in waves 0-P to.

Parameters:
  • W020 (float or ndarray) – wavefront defocus, units of waves if wavelength != None, else units of length

  • fno (float) – f/# of the lens or system

  • wavelength (float, optional) – wavelength of light, if None W020 takes units of length

Returns:

image displacement. Motion of image in um caused by defocus OPD

Return type:

float

prysm.thinlens.image_displacement_to_defocus(dz, fno, wavelength=None)#

Compute the wavefront defocus from image shift, expressed in the same units as the shift.

Parameters:
  • dz (float or ndarray) – displacement of the image

  • fno (float) – f/# of the lens or system

  • wavelength (float, optional) – wavelength of light, if None return has units the same as dz, else waves

Returns:

wavefront defocus, waves if Wavelength != None, else same units as dz

Return type:

float

prysm.thinlens.image_shift_to_tilt(dx, fno)#

Compute the wavefront tilt associated with an image shift.

Parameters:
  • dx (float or ndarray) – translation of the image

  • fno (float) – f/# of the lens or system

Returns:

wavefront tilt W111, same units as dx W111 has a peak-to-valley of 2, and “amplitude” of 1 to convert to Z2 or Z3, those have a peak-to-valley of 4, so divide by two for amplitude coefficients, or 4 for RMS coefficients

Return type:

float

prysm.thinlens.tilt_to_image_shift(W111, fno)#

Compute image shift from wavefront tilt.

Parameters:
  • W111 (float or ndarray) – wavefront tilt, unit amplitude (peak-to-valley of 2)

  • fno (float) – f/# of the lens or system

Returns:

image translation, in same units as W111 (e.g., um)

Return type:

float

prysm.thinlens.singlet_power(c1, c2, t, n, n_ambient=1.0)#

Optical power of a thick singlet.

Parameters:
  • c1 (float) – curvature of S1

  • c2 (float) – curvature of S2

  • t (float) – vertex-to-vertex thickness

  • n (float) – refractive index

  • n_ambient (float) – refractive index of the ambient medium (“air”)

Returns:

optical power in the ambient medium

Return type:

float

prysm.thinlens.singlet_efl(c1, c2, t, n, n_ambient=1.0)#

EFL of a singlet.

Parameters:
  • c1 (float) – curvature of S1

  • c2 (float) – curvature of S2

  • t (float) – vertex-to-vertex thickness

  • n (float) – refractive index

  • n_ambient (float) – refractive index of the ambient medium (“air”)

Returns:

EFL

Return type:

float

prysm.thinlens.singlet_bfl(c1, c2, t, n, n_ambient=1.0)#

Back focal length of a thick singlet.

Parameters:
  • c1 (float) – curvature of S1

  • c2 (float) – curvature of S2

  • t (float) – vertex-to-vertex thickness

  • n (float) – refractive index

  • n_ambient (float) – refractive index of the ambient medium (“air”)

Returns:

signed distance from S2 to the rear focal point

Return type:

float

prysm.thinlens.singlet_ffl(c1, c2, t, n, n_ambient=1.0)#

Front focal length of a thick singlet.

Parameters:
  • c1 (float) – curvature of S1

  • c2 (float) – curvature of S2

  • t (float) – vertex-to-vertex thickness

  • n (float) – refractive index

  • n_ambient (float) – refractive index of the ambient medium (“air”)

Returns:

signed distance from S1 to the front focal point

Return type:

float

prysm.thinlens.twolens_efl(efl1, efl2, separation)#

Use thick lens equations to compute the focal length for two elements separated by some distance.

Parameters:
  • efl1 (float) – EFL of the first lens

  • efl2 (float) – EFL of the second lens

  • separation (float) – separation of the two lenses

Returns:

focal length of the two lens system

Return type:

float

prysm.thinlens.twolens_power(efl1, efl2, separation)#

Compute the optical power for two thin lenses in air.

Parameters:
  • efl1 (float) – EFL of the first lens

  • efl2 (float) – EFL of the second lens

  • separation (float) – separation of the two lenses

Returns:

optical power of the two lens system

Return type:

float

prysm.thinlens.twolens_bfl(efl1, efl2, separation)#

Use thick lens equations to compute the back focal length for two elements separated by some distance.

Parameters:
  • efl1 (float) – EFL of the first lens

  • efl2 (float) – EFL of the second lens

  • separation (float) – separation of the two lenses.

Returns:

back focal length of the two lens system.

Return type:

float

prysm.thinlens.twolens_ffl(efl1, efl2, separation)#

Compute the front focal length for two thin lenses in air.

Parameters:
  • efl1 (float) – EFL of the first lens

  • efl2 (float) – EFL of the second lens

  • separation (float) – separation of the two lenses

Returns:

front focal length of the two lens system

Return type:

float

prysm.thinlens.twolens_separation(efl1, efl2, efl)#

Compute the separation required for a target two-lens EFL.

Parameters:
  • efl1 (float) – EFL of the first lens

  • efl2 (float) – EFL of the second lens

  • efl (float) – target EFL of the two-lens system

Returns:

separation between the two lenses

Return type:

float