janssen.lenses

Lens implementations and optical calculations.

Extended Summary

Comprehensive lens modeling for simulating optical elements. Includes implementations of common lens types and their optical properties. For propagation algorithms, see the janssen.prop submodule.

Routine Listings

create_lens_phase()

Create phase profile for a lens based on its parameters.

double_concave_lens()

Create parameters for a double concave lens.

double_convex_lens()

Create parameters for a double convex lens.

lens_focal_length()

Calculate focal length from lens parameters.

lens_thickness_profile()

Calculate thickness profile of a lens.

meniscus_lens()

Create parameters for a meniscus lens.

plano_concave_lens()

Create parameters for a plano-concave lens.

plano_convex_lens()

Create parameters for a plano-convex lens.

propagate_through_lens()

Propagate optical wavefront through a lens.

Notes

All lens functions are JAX-compatible and support automatic differentiation. The lens functions can model both ideal and realistic optical elements with aberrations.

For propagation methods (angular_spectrum_prop, fresnel_prop, etc.), see janssen.prop.

janssen.lenses.create_lens_phase(xx: Float[Array, 'hh ww'], yy: Float[Array, 'hh ww'], params: LensParams, wavelength: float | Float[Array, '']) tuple[Float[Array, 'hh ww'], Float[Array, 'hh ww']][source]

Create the phase profile and transmission mask for a lens.

Parameters:
  • xx (Float[Array, " hh ww"]) – X coordinates grid.

  • yy (Float[Array, " hh ww"]) – Y coordinates grid.

  • params (LensParams) – Lens parameters.

  • wavelength (float) – Wavelength of light.

Return type:

tuple[Float[Array, 'hh ww'], Float[Array, 'hh ww']]

Returns:

  • phase_profile (Float[Array, " hh ww"]) – Phase profile of the lens.

  • transmission (Float[Array, " hh ww"]) – Transmission mask of the lens.

Notes

  • Calculate radial coordinates.

  • Calculate thickness profile.

  • Calculate phase profile.

  • Create transmission mask.

  • Return phase and transmission.

janssen.lenses.double_concave_lens(focal_length: float | Float[Array, ''], diameter: float | Float[Array, ''], n: float | Float[Array, ''], center_thickness: float | Float[Array, ''], r_ratio: float | Float[Array, ''] | None = 1.0) LensParams[source]

Create parameters for a double concave lens.

Parameters:
  • focal_length (float) – Desired focal length.

  • diameter (float) – Lens diameter.

  • n (float) – Refractive index.

  • center_thickness (float) – Center thickness.

  • r_ratio (float, optional) – Ratio of R2/R1, by default 1.0 for symmetric lens.

Returns:

params – Lens parameters.

Return type:

LensParams

Notes

  • Calculate R1 using lensmaker’s equation.

  • Calculate R2 using R_ratio.

  • Create and return LensParams.

janssen.lenses.double_convex_lens(focal_length: float | Float[Array, ''], diameter: float | Float[Array, ''], n: float | Float[Array, ''], center_thickness: float | Float[Array, ''], r_ratio: float | Float[Array, ''] | None = 1.0) LensParams[source]

Create parameters for a double convex lens.

Parameters:
  • focal_length (float) – Desired focal length.

  • diameter (float) – Lens diameter.

  • n (float) – Refractive index.

  • center_thickness (float) – Center thickness.

  • r_ratio (float, optional) – Ratio of r2/r1, by default 1.0 for symmetric lens.

Returns:

params – Lens parameters.

Return type:

LensParams

Notes

  • Calculate r1 using lensmaker’s equation.

  • Calculate r2 using R_ratio.

  • Create and return LensParams.

janssen.lenses.lens_focal_length(n: float | Float[Array, ''], r1: int | float | complex | Num[Array, ''], r2: int | float | complex | Num[Array, '']) float | Float[Array, ''][source]

Calculate the focal length of a lens using the lensmaker’s equation.

Parameters:
  • n (float) – Refractive index of the lens material.

  • r1 (numeric) – Radius of curvature of the first surface (positive for convex).

  • r2 (numeric) – Radius of curvature of the second surface (positive for convex).

Returns:

f – Focal length of the lens.

Return type:

float

Notes

  • Apply the lensmaker’s equation.

  • Return the calculated focal length.

janssen.lenses.lens_thickness_profile(r: Float[Array, 'H W'], r1: float | Float[Array, ''], r2: float | Float[Array, ''], center_thickness: float | Float[Array, ''], diameter: float | Float[Array, '']) Float[Array, 'H W'][source]

Calculate the thickness profile of a lens.

Parameters:
  • r (Float[Array, " H W"]) – Radial distance from the optical axis.

  • r1 (float) – Radius of curvature of the first surface.

  • r2 (float) – Radius of curvature of the second surface.

  • center_thickness (float) – Thickness at the center of the lens.

  • diameter (float) – Diameter of the lens.

Returns:

thickness – Thickness profile of the lens.

Return type:

Float[Array, " H W"]

Notes

  • Calculate surface sag for both surfaces

    only where aperture mask & r is finite.

  • Combine sags with center thickness.

  • Return thickness profile.

janssen.lenses.meniscus_lens(focal_length: float | Float[Array, ''], diameter: float | Float[Array, ''], n: float | Float[Array, ''], center_thickness: float | Float[Array, ''], r_ratio: float | Float[Array, ''], convex_first: bool | Bool[Array, ''] | None = True) LensParams[source]

Create parameters for a meniscus (concavo-convex) lens.

For a meniscus lens, one surface is convex (positive R) and one is concave (negative R).

Parameters:
  • focal_length (float) – Desired focal length in meters.

  • diameter (float) – Lens diameter in meters.

  • n (float) – Refractive index of lens material.

  • center_thickness (float) – Center thickness in meters.

  • r_ratio (float) – Absolute ratio of R2/R1.

  • convex_first (bool, optional) – If True, first surface is convex, by default True.

Returns:

params – Lens parameters.

Return type:

LensParams

Notes

  • Calculate magnitude of R1 using lensmaker’s equation.

  • Calculate R2 magnitude using R_ratio.

  • Assign correct signs based on convex_first.

  • Create and return LensParams.

janssen.lenses.plano_concave_lens(focal_length: float | Float[Array, ''], diameter: float | Float[Array, ''], n: float | Float[Array, ''], center_thickness: float | Float[Array, ''], concave_first: bool | Bool[Array, ''] | None = True) LensParams[source]

Create parameters for a plano-concave lens.

Parameters:
  • focal_length (float) – Desired focal length.

  • diameter (float) – Lens diameter.

  • n (float) – Refractive index.

  • center_thickness (float) – Center thickness.

  • concave_first (bool, optional) – If True, first surface is concave, by default True.

Returns:

params – Lens parameters.

Return type:

LensParams

Notes

  • Calculate R for curved surface.

  • Set other R to infinity (flat surface).

  • Create and return LensParams.

janssen.lenses.plano_convex_lens(focal_length: float | Float[Array, ''], diameter: float | Float[Array, ''], n: float | Float[Array, ''], center_thickness: float | Float[Array, ''], convex_first: bool | Bool[Array, ''] | None = True) LensParams[source]

Create parameters for a plano-convex lens.

Parameters:
  • focal_length (float) – Desired focal length.

  • diameter (float) – Lens diameter.

  • n (float) – Refractive index.

  • center_thickness (float) – Center thickness.

  • convex_first (bool, optional) – If True, first surface is convex, by default True.

Returns:

params – Lens parameters.

Return type:

LensParams

Notes

  • Calculate R for curved surface.

  • Set other R to infinity (flat surface).

  • Create and return LensParams.

janssen.lenses.propagate_through_lens(field: Complex[Array, 'hh ww'], phase_profile: Float[Array, 'hh ww'], transmission: Float[Array, 'hh ww']) Complex[Array, 'hh ww'][source]

Propagate a field through a lens.

Parameters:
  • field (Complex[Array, " hh ww"]) – Input complex field.

  • phase_profile (Float[Array, " hh ww"]) – Phase profile of the lens.

  • transmission (Float[Array, " hh ww"]) – Transmission mask of the lens.

Returns:

output_field – Field after passing through the lens.

Return type:

Complex[Array, " hh ww"]

Notes

  • Apply transmission mask.

  • Add phase profile.

  • Return modified field.