prysm.thinlens#
A collection of thin lens 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 numpy.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 numpy.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.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.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 numpy.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 numpy.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 numpy.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.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.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_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