Detectors

Detectors provide a way to evaluate beam data during optical simulations. They are designed to accumulate e.g. field data, enabling analysis of intensity distributions, interference patterns, and other beam properties.

Detectors are supposed to fall under the BeamletOptics.AbstractDetector type, which defines a interface for detector implementations.

Resetting detectors

In general, the data stored in a detector is not automatically reset between calls of solve_system!. This task is placed within the responsibility of the user. A detector reset can be performed with the empty! function.

Photodetector type

A concrete implementation to "measure" intensity distributions generated by a GaussianBeamlet is provided in the form of the Photodetector:

BeamletOptics.PhotodetectorMethod
Photodetector(width, n)

Spawns a quadratic rectangular 2D Photodetector that is aligned with the positive y-axis. Refer to the type docs for more information.

Inputs:

  • width: edge length in [m]
  • n: field discretization factor, higher results in more computational cost
source

The interact3d model of the Photodetector can store complex electric field (E-field) values from intersecting GaussianBeamlets, enabling the reconstruction of spatial intensity distribution across its active surface. This data can be used to calculate e.g. beam interference patterns via the intensity function. The BeamletOptics.optical_power method can be used in order to obtain the total optical power at the detector. Below a rendered example of a detector model (FDS010) can be seen. The detector active area is marked in blue (1x1 mm²).

Photodetector showcase

One of the use cases of the Photodetector is to analyse interference patterns. The figure below demonstrates an example intensity distribution captured by the detector pictured above, showing radial fringes due to a mismatch of the radii of curvature of the interfering GaussianBeamlets.

Interferometer tutorial

Refer to the Michelson interferometer section for a detailed tutorial on how to use the Photodetector.

Interference fringes showcase

Spotdetector type

A straight forward detector that stores the BeamletOptics.Intersection position of an incoming Beam. The Spotdetector can be used to generate spot diagrams, which are commonly used to perform initial assessments of the optical performance of an imaging setup.

BeamletOptics.SpotdetectorMethod
Spotdetector(width)

Generates a quadratic rectangular 2D Spotdetector that is aligned with the negative y-axis. Refer to the type docs for more information.

Inputs:

  • width: edge length in [m]
source

Below an optical system consisting of a collection of collimated Beams passing through a ThinLens is shown. A Spotdetector is positioned at the approximate focal plane to capture the resulting spot diagram.

Thin lens setup

The beam bundle used to generate the spot diagram was created via the CollimatedSource constructor. The resulting spot diagram of the lens shown above is visualized below.

Spot diagram showcase

Point-spread-function detector type

Experimental feature

The point spread function estimation is a highly experimental feature. It does not use pupils (yet) but merely uses superposition of the ray-attached plane-waves. While this gives qualitatively sound results, it requires good sampling of the problem to obtain quantitatively good results. Currently no Strehl-ratio is calculated due to that.

The package offers a simple method to estimate the point spread function of a system. It is currently limited and requires careful assessment by the user, if the results are to be trusted.

To analyze the PSF of a imaging system a PSFDetector is added to the system at the plane and orientation where the PSF is requested. This is the same approach as for the other detector types.

BeamletOptics.PSFDetectorMethod
Photodetector(width)

Spawns a quadratic rectangular 2D PSFDetector that is aligned with the positive y-axis. Refer to the type docs for more information.

Inputs:

  • width: edge length in [m]
source

The intensity map together with the coordinate system of the detector can be retrieved after solving the system by calling the intensity function.

BeamletOptics.intensityMethod
intensity(psf::PSFDetector{T};
          n::Int=100,
          crop_factor::Real=1,
          center::Symbol=:centroid,
          x_min = Inf,
          x_max = Inf,
          z_min = Inf,
          z_max = Inf,
          x0_shift::Real=0,
          z0_shift::Real=0) where T

Compute the two‐dimensional point‐spread function (PSF) of an optical system as captured by a PSFDetector. The returned intensity map is sampled on a regular n×n grid in the detector’s local (x,z)-plane.

Keyword Arguments

  • n::Int=100 Number of sample points per axis.
  • crop_factor::Real=1 Scales the half‐width of the sampling window returned by calc_local_lims; values >1 expand, <1 shrink.
  • center::Symbol=:centroid How the sampling window is centred. :centroid uses the projection‑weighted centroid, :bbox uses the geometric mid‑point of the bounding box.
  • x_min, x_max, z_min, z_max Manually override the sampling bounds in the local x or z directions. If left as Inf, the bounds from calc_local_lims are used.
  • x0_shift::Real=0, z0_shift::Real=0 Apply a constant offset to the entire x or z coordinate arrays, useful for recentring or testing alignment.

Returns

A tuple (xs, zs, I) where

  • xs::LinRange{T} and zs::LinRange{T} are the sampled coordinates in the detector’s local x and z axes,
  • I::Matrix{T} is the corresponding raw/unscaled intensity map
Resetting detectors

Be sure to call empty!(psf) before each new measurement if reusing the same detector.

Scaling

The returned values are raw/unscaled and not a Strehl ratio. This feature is not yet added. In future versions a pupil finder along with a Strehl estimator will be added.

source
Warning

When dealing with a collimated source as the input to your optical system, where you want to calculate the PSF, DO NOT use the CollimatedSource beam group directly but instead use the UniformDiscSource constructor. This function returns a CollimatedSource with an equal-area sampling, which correctly weights the outer beams in relation to the inner beams. Otherwise the results might be wrong.

Airy-Disc Example

This is a classic example where a collimated circular beam is imaged onto a point by a singlet lens. Due to the finite size of the aperture stop (in this case given by the 15 mm size of the beam), the diffraction limited intensity pattern is given by the Airy-disc:

\[I(r)=I_0\!\left[\frac{2J_1\!\bigl(\pi D r/(\lambda f)\bigr)}{\pi D r/(\lambda f)}\right]^2\]

With $r$ the radius from the origin, $I_0$ the maximum intensity, $J_1$ the Bessel function of the first kind of order one, $D$ the aperture width, $\lambda$ the wavelength and the focal length $f$.

# example parameters
l = 1e-3
R1 = 100e-3
R2 = Inf
d = 25.4e-3
n = 1.5
λ = 1e-6

# generate uniform source, lens and PSF detector
cs = UniformDiscSource([0, -10mm, 0], [0, 1, 0], 15e-3, λ)
lens = SphericalLens(R1, R2, l, d, x -> n)
psfd = PSFDetector(10e-3)

# shift detector into focus
translate3d!(psfd, [0, 200mm + 0.13mm, 0])

# build system
sys = System([lens, psfd])

solve_system!(sys, cs)

# retrieve intensity
x, z, I_num = intensity(psfd; n=500, crop_factor=5)

Visualizing the result yields the expected Airy-disk pattern.

Airy disc PSF

Coma and Astigmatism Example

In this example, an aspheric lens images the collimated source onto a point but is tilted around the x-axis by 0.5 degrees. This results in aberrations distorting the stigmatic imaging and leading to coma and astigmatism.

k = -0.675
d = 75.0e-3
l = 15e-3
radius = 76.68e-3
A = [0*(1e3)^1, 2.7709219e-8*(1e3)^3, 6.418186e-13*(1e3)^5, -1.5724014e-17*(1e3)^7, -2.7768768e-21*(1e3)^9, -2.590162e-25*(1e3)^11]
AL75150 = Lens(
    EvenAsphericalSurface(radius, d, k, A),
    l,
    n -> 1.5006520430
)

xrotate3d!(AL75150, deg2rad(-0.5))

pd = PSFDetector(15e-3)

translate3d!(pd, [0, 158.1779e-3, 0.0])
system = System([AL75150, pd])

ps = UniformDiscSource([0, -0.1, 0], [0,1,0], 0.8*d, 1550e-9)

solve_system!(system, ps)

Tilted asphere PSF