0% found this document useful (0 votes)
48 views27 pages

Physical Research Laboratory: Ahmedabad

This document describes a student's simulation of a Shack-Hartmann wavefront sensor to calculate the local slopes of wavefronts. The student simulated diffraction patterns from a square aperture and spot patterns from an 11x11 lens grid for both plane and aberrated wavefronts. The simulation analyzed a 500x500 phase map to calculate the x and y shifts in spots using plane fitting. Error analysis was also performed to determine the percentage error in measuring the x and y shifts. The goal was to gain experience with wavefront sensor simulations in support of adaptive optics systems used to improve optical performance.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
48 views27 pages

Physical Research Laboratory: Ahmedabad

This document describes a student's simulation of a Shack-Hartmann wavefront sensor to calculate the local slopes of wavefronts. The student simulated diffraction patterns from a square aperture and spot patterns from an 11x11 lens grid for both plane and aberrated wavefronts. The simulation analyzed a 500x500 phase map to calculate the x and y shifts in spots using plane fitting. Error analysis was also performed to determine the percentage error in measuring the x and y shifts. The goal was to gain experience with wavefront sensor simulations in support of adaptive optics systems used to improve optical performance.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 27

Physical Research Laboratory

Ahmedabad

A
Project On

Simulation of Shack-Hartmann Wavefront


Sensor
by
Alakesh Kalita
B.Tech Engineering Physics, III Yr
SC16B121
Indian Institute of Space Science and Technology

under the guidance of


Dr. Mudit K. Srivastava
Reader
Department of Astronomy and Astrophysics
Physical Research Laboratory
ACKNOWLEDGEMENT

I would like to extend my sincere thanks and gratitude to my guide Dr. Mu-
dit K. Srivastava, Reader, Physical Research Laboratory , Ahmedabad for
the constant support he extended to me in my short tenure. I would always
remain grateful to him for guiding me constantly in this Project.

I would also like to thank Mr.Vaibhav Dixit, Scientist, Physical Research Lab-
oratory, Ahmedabad for extending help to me whenever required. I would
always remain indebted to you for the immense support he extended to me.

Alakesh Kalita
B.Tech Engineering Physics
Indian Institute of Space Science and Technology

1
BONAFIDE CERTIFICATE

This is to certify that this project report entitled “Simulation of Shack-


Hartmann Wavefront Sensor ” submitted to Indian Institute of Space Science and Tech-
nology, Thiruvananthapuram, is a bonafide record of work done by “Alakesh Kalita” under
my supervision.

Dr.Mudit Srivastava
Scientist,PRL,Ahmedabad
Signature:

Office Seal:

Prof. Abhijit Chakraborty


H.O.D,Astronomy & Astrophyiscs
Signature:

2
DECLARATION BY THE AUTHOR

This is to declare that this report has been written by me/us. No part of
the report is plagiarized from other sources. All information included from other sources
have been duly acknowledged. I/We aver that if any part of the report is found to be
plagiarized, I/we are shall take full responsibility for it.

Alakesh Kalita
B.Tech Engineering Physics
Indian Institute of Space Science and Technology
Signature:

3
Contents

1 Introduction to Adaptive Optics: 7

1.1 Wavefront Sensors: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

1.2 Shack Hartmann Wavefront Sensor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

1.3 CCD Detector: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

1.3.1 Quantization Error of CCD: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

2 Diffraction Pattern due to a Square Aperture 11

2.1 Mathematical Formulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

2.2 Fresnel Approximation: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

2.3 Fraunhofer Approximation: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

2.4 Sample Simulation : . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

3 Spot Pattern Due to 11 X 11 Lens Grid with Plane and Aberrated Wavefront: 14

3.1 Generating Function for the Spot Pattern: . . . . . . . . . . . . . . . . . . . . . . . . . . 15

3.2 Pixelation: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

3.3 Spot Pattern Generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

4 Calculation of Shift in X and Y axes from the 500 X 500 Phase Map: 17

4.1 Phase Map: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

4.2 Algorithm for Plane Fit: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

4.3 Plane Fits for Sub-Apertures(Sample Example): . . . . . . . . . . . . . . . . . . . . . . . 18

4.4 Calculation of X and Y Shift: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

4.4.1 Calculation of Tip(φ) and Tilt(θ): . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

5 Results: 20

5.1 2-D Plot Along a Particular Y Value: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

5.2 Gaussian Fit of Non-Shifted Distribution for a Sub-Aperture: . . . . . . . . . . . . . . . . 21

5.3 Gaussian Fit of Shifted Distribution for a Sub-Aperture: . . . . . . . . . . . . . . . . . . . 22

5.4 Gaussian Fits for the Plane Wavefront and Distorted Wavefront: . . . . . . . . . . . . . . 23

4
6 Error Analysis in My Simulations: 23

6.1 Percentage Error in X Shift: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

6.2 Percentage Error in Y Shift: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

7 Conclusions: 25

8 Future Scope: 25

List of Figures

1 Aberrated Wavefront Due to atmospheric turbulence(Image Courtesy:Wikipedia) . . . . . 8

2 Shack-Hartmann Wave Sensor Thorlabs[(Image Courtesy:Thorlabs) . . . . . . . . . . . . 9

3 Spot Patterns Due to Shack-Hartmann Wave Sensor(Image Courtesy:Thorlabs) . . . . . 9

4 CCD Detector(Image Courtesy:Wikipedia) . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

5 Pixels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

6 Diffraction of a plane wave incident normally on a rectangular aperture(Image Cour-


tesy:Optics by Ajoy Ghatak) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

7 A plane wave incident normally on an aperture. The diffraction pattern is observed on


0
screen SS ((Image Courtesy:Optics by Ajoy Ghatak) . . . . . . . . . . . . . . . . . . . . . 12

8 Simulation of Diffraction Pattern due to Rectangular Aperture . . . . . . . . . . . . . . . 13

9 1-D Sinc Distribution having Central Width 32 µm. . . . . . . . . . . . . . . . . . . . . . 14

10 Shack Hartmann Sensor[(Image Courtesy:Thor Labs) . . . . . . . . . . . . . . . . . . . . . 14

11 Shack Hartmann Sensor for Displaced Spots(Image Courtesy:Thor Labs) . . . . . . . . . . 15

12 Simulated Spot Pattern for Plane Wavefront . . . . . . . . . . . . . . . . . . . . . . . . . . 16

13 Phase Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

14 Plane Fitting of a Sub-Aperture I . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

15 Plane Fitting of a Sub-Aperture I . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

16 Y-Shift Calculation((Image Courtesy:Thor Labs) . . . . . . . . . . . . . . . . . . . . . . . 18

17 Small Shifts ∼ 1µm(Scaled Upto 30 Times) . . . . . . . . . . . . . . . . . . . . . . . . . . 19

18 Intensity Distribution along the Centre of a Row of 11 Lenses . . . . . . . . . . . . . . . . 20

5
19 Gaussian Fit of Non-Shifted Distribution for a Sub-Aperture . . . . . . . . . . . . . . . . 21

20 Gaussian Fit of Shifted Distribution for a Sub-Aperture . . . . . . . . . . . . . . . . . . . 22

21 Gaussian Plots for the Shifted and Non-Shifted Case . . . . . . . . . . . . . . . . . . . . . 23

22 Absolute % error in Measurement of X Shift . . . . . . . . . . . . . . . . . . . . . . . . . . 24

23 Difference error in Measurement of X Shift . . . . . . . . . . . . . . . . . . . . . . . . . . 24

24 Absolute % error in Measurement of Y Shift . . . . . . . . . . . . . . . . . . . . . . . . . . 24

25 Difference error in Measurement of Y Shift . . . . . . . . . . . . . . . . . . . . . . . . . . 25

6
Simulation of Shack-Hartmann Wavefront
Sensor to calculate local slopes of wavefronts
Alakesh Kalita

Indian Institute of Space Science and Technology,


Trivandrum

July 12, 2019

Abstract

Adaptive optics (AO) is a technology used to improve the performance of optical systems by
reducing the effect of incoming wavefront distortions by deforming a mirror in order to compensate for
the distortion. It finds its use in numerous applications especially in Optical Astronomy to minimize
the atmospheric distortions. Shack-Hartmann Wavefront Sensor which forms an indispensable part
of adaptive optics finds its use in the calculation of local or average slopes of distorted wavefronts
which further can be processed to determine the shape of the wavefront to certain degree of accuracy
using certain basis polynomials known as Zernike Polynomials. The accuracy in determination of
the functional form of the wavefront depends on the number of Zernike Polynomials. Finding the
local/average slope demands the shift in x and y axis of each spot due to the aberrated wavefront.
This can be calculated via the Gaussian shifts of data processed out from CCD/CMOS.

1 Introduction to Adaptive Optics:

When light from a star or another astronomical object enters the Earth’s atmosphere, atmo-
spheric turbulence (introduced, for example, by atmospheric layers at different temperature and different
wind speeds) can distort and move the image in various ways. Two parameters are associated with the
aberrated wavefront known popularly in literature as tip and tilt angles. The Ideal wavefront is the
plane wavefront and the distorted wavefront is modelled or linearly fitted and given the structure of a
plane. The angles the plane makes with x and y axes if the direction of propagation is z are respectively
the tip and tilt angles. The simplest form of adaptive optics is tip-tilt correction, which corresponds
to correction of the tilts of the wavefront in two orthogonal dimensions (equivalent to correction of the
position offsets for the image). This is performed using a rapidly moving tip–tilt mirror that makes small
rotations around two of its axes. A significant fraction of the aberration introduced by the atmosphere
can be removed in this way.

1.1 Wavefront Sensors:

A wavefront sensor is a device for measuring the aberrations of an optical wavefront. An


adaptive optics system tries to correct these distortions, using a wavefront sensor which takes some of

7
the astronomical light, a deformable mirror that lies in the optical path, and a computer that receives
input from the detector. The wavefront sensor measures the distortions the atmosphere has introduced
on the timescale of a few milliseconds; the computer calculates the optimal mirror shape to correct the
distortions and the surface of the deformable mirror is reshaped accordingly.

Figure 1: Aberrated Wavefront Due to atmospheric turbulence(Image Courtesy:Wikipedia)

1.2 Shack Hartmann Wavefront Sensor

A Shack–Hartmann (or Hartmann–Shack) wavefront sensor (SHWFS) is an optical instrument


used for characterizing an imaging system. The design of this sensor improves upon an array of holes in
a mask that had been developed in 1900 by Johannes Franz Hartmann as a means of tracing individual
rays of light through the optical system of a large telescope, thereby testing the quality of the image.It
is a wavefront sensor commonly used in adaptive optics systems. It consists of an array of lenses (called
lenslets) of the same focal length. Each is focused onto a photon sensor (typically a CCD array or CMOS
array or quad-cell).It uses a purely geometric phase measurement technique; it works with both coherent
and incoherent light. To measure the local wavefront gradient, a lenslet array divides the incoming
wavefront into a set of spatial samples, called subapertures and forms an array of spots. A lens then
relays the spots onto a pixelated sensor. A change in the gradient of the wavefront across a subaperture
will produce a shift in position of the spot. By measuring these small shifts, the local gradient of
the wavefront is measured. From the array of wavefront gradients, the optical path difference may be
calculated. sampling the wavefront with an array of lenslets, all of these local tilts can be measured
and the whole wavefront reconstructed.Since only tilts are measured the Shack–Hartmann cannot detect
discontinuous steps in the wavefront.[5]

8
Figure 2: Shack-Hartmann Wave Sensor Thorlabs[(Image Courtesy:Thorlabs)

Figure 3: Spot Patterns Due to Shack-Hartmann Wave Sensor(Image Courtesy:Thorlabs)

1.3 CCD Detector:

Figure 4: CCD Detector(Image Courtesy:Wikipedia)

9
A Charge Coupled Device (CCD) is a highly sensitive photon detector. The CCD is divided
up into a large number of light-sensitive small areas (known as pixels) which can be used to build up
an image of the scene of interest. A photon of light which falls within the area defined by one of the
pixels will be converted into one (or more) electrons and the number of electrons collected will be directly
proportional to the intensity of the scene at each pixel. When the CCD is clocked out, the number of
electrons in each pixel are measured and the scene can be reconstructed.The Figure 4 shows a ”typical”
CCD. The CCD itself is primarily made of silicon and the structure has been altered so that some of the
silicon atoms have been replaced with impurity atoms.[5]

Figure 5: Pixels

An actual CCD will consist of a large number of pixels (i.e, potential wells), arranged horizon-
tally in rows and vertically in columns. The number of rows and columns defines the CCD size, typical
sizes are 1024 pixels high by 1024 pixels wide. The resolution of the CCD is defined by the size of the
pixels, also by their separation (the pixel pitch). In most astronomical CCDs the pixels are touching each
other and so the CCD resolution will be defined by the pixel size, typically 10-20µm. Thus, a 1024x1024
sized CCD would have a physical area image size of about 10mm x 10mm.

1.3.1 Quantization Error of CCD:

Quantization, in mathematics and digital signal processing, is the process of mapping input
values from a large set (often a continuous set) to output values in a (countable) smaller set, often with
a finite number of elements. Rounding and truncation are typical examples of quantization processes.
Quantization is involved to some degree in nearly all digital signal processing, as the process of represent-
ing a signal in digital form ordinarily involves rounding. Quantization also forms the core of essentially
all lossy compression algorithms.The difference between an input value and its quantized value (such
as round-off error) is referred to as quantization error. A device or algorithmic function that performs
quantization is called a quantizer. An analog-to-digital converter is an example of a quantizer.

10
2 Diffraction Pattern due to a Square Aperture

The Diffraction pattern obtained in the image plane is merely the square of the absolute value
of the 2-D Fourier Transform of the aperture function.Let’s say,the aperture function is t(u,v) where u
,v are the x and y coordinates of the diffraction plane.Let ζ,η be the x and y coordinates of the image
R∞ R∞
plane.Then the intensity at the output screen I(ζ,η)=C | −∞ −∞ t(u, v)exp(−i(ζu + ηv))dudv|2 ,where
C is a proportionality constant.In our case the aperture function t(u,v) is as follows:
(
−a
1, 2 ≤ u ≤ a2 , −a
2 ≤v ≤
a
2
t(u, v) =
0 otherwise

,where a is the length or breadth of the aperture. The fourier transform of a rectangular function is a
sinc function.So the expected intensity distribution is a sinc distribution.Since we will be using a lens
with a rectangular aperture the image plane will be the focal plane.As a sample example we will use the
following parameters:

• Wavelength, λ=0.650 µm.

• Aperture, a=150 µm.

• Focal length , f=3.7 mm

2.1 Mathematical Formulation

Figure 6: Diffraction of a plane wave incident normally on a rectangular aperture(Image Courtesy:Optics


by Ajoy Ghatak)

We consider a rectangular aperture ( of dimension a x b) as shown in Figure 6.The Fraun-


hofer diffraction of a plane wave incident normally on such a rectangular aperture will be given by the
Diffraction Integral:
2 2 b a
Aeikz exp( ik(x2z+y ) )
Z 2
Z 2
u(x, y, z) = e−ixξ e−iyη dξdη(Diffraction Integral) (1)
iλz − 2b −a
2

where we have chosen the origin to be the centre of the rectangular aperture.The parameter used are:
k=2 π/(λ), x ,y are the X and Y co-ordinates of image plane and ,ξ ,η are the X and Y co-ordinates of
diffraction plane ,a and b are dimensions of the rectangular aperture and z is the distance of the image
plane from the diffraction plane.In our case z=f, where f is the focal lens of our Shack-Hartmann Wave

11
Sensor.Carrying out the integration, we get:
2 2
Abaeikf exp( ik(x2f+y ) ) sinβ sinγ
u(x, y, z) = , (2)
iλf β γ
2 2
πby sin β sin γ
where, β = πax 2
λf and γ = λf .Thus we may write I(x,y)=|u(x, y)| and hence I(x,y)=I0 β 2 γ2 The
above equation represents the Fraunhofer diffraction pattern by a rectangular aperture.[1]

2.2 Fresnel Approximation:

Figure 7: A plane wave incident normally on an aperture. The diffraction pattern is observed on screen
0
SS ((Image Courtesy:Optics by Ajoy Ghatak)

1.The first assumption is that the dimensions of the aperture are large in comparison to the
wavelength.
Justification: Size of the aperture, a =150 µm and the wavelength, λ=0.650 µm. Hence,a >>>
λ.So,our assumption is rightly valid.
2. We have used a scalar theory in which we have represented the field by a scalar function u; this
implies that the electric field is in the same direction everywhere. This assumption will be valid when
the line joining point O and observation point P makes a small angle with the axis.
Justification:The separation between image plane and diffraction plane is of the order (∼ millimetre)
whereas the Point P’s distance from the origin of the image plane is of the order of (∼ µ metre).[1]

2.3 Fraunhofer Approximation:


2
+η 2 )
We have neglected the term exp(ik (ξ 2z ).In our case z=3.1*10−3 m and k= 650∗10

−9 m and
2
+η 2 )
ξ and ζ ∼ µ metres.So ξ 2 and ζ 2 ∼ 10−12 metres.So , k (ξ 2z ∼ 10−3 metres which is very small and
2 2
hence the term exp(ik (ξ 2z
+η )
) ∼ 1.

2.4 Sample Simulation :

As a sample example we will use the following parameters:

• Wavelength, λ=0.650 µm.

12
• Aperture, d=150 µm.

• Focal length , f=3.7 mm

• Image Screen taken within 0.1 mm X 0.1 mm.

Figure 8: Simulation of Diffraction Pattern due to Rectangular Aperture

2
Let’s analyse the intensity distribution along the constant y axis.So, I(x)= sin (ax) πd
(ax)2 , where a= λf =195941.329746
±π
m−1 .The first roots corresponding to I(x)=0 are a .Hence , the width of Central Maximum of I(x) is
2π106
a ≈ 32µm.

13
Figure 9: 1-D Sinc Distribution having Central Width 32 µm.

From the above Simulation by measuring the central maximum of the sinc function graphically
and comparing with the Mathematical analysis done above, it can be concluded that the graphical data
matched well with the analytical data.

3 Spot Pattern Due to 11 X 11 Lens Grid with Plane and Aber-


rated Wavefront:

In Shack-Hartmann Wave Sensor we have 121 lenses with aperture size=150 µm stacked in a
11 X 11 array without any gap between them.Cross Sectional view is as follows:

Figure 10: Shack Hartmann Sensor[(Image Courtesy:Thor Labs)

14
Figure 11: Shack Hartmann Sensor for Displaced Spots(Image Courtesy:Thor Labs)

Each lens focuses the rays at the focal plane.Since the lenses are equally we will also get equally
spaced spots with the consecutive central maxima separated by 150 µm.The obtained spots ideally should
be points but in practicality there is sort of dimension attached with it which is determined by factors
f ocal length 3.7∗10−3
like wavelength and f# (f-no) of the lens.In our case ,f# = aperture diameter = 150∗10−6 ≈24.7.

3.1 Generating Function for the Spot Pattern:

Since the consecutive spots are separated by 150 µm. and they are 121 in total and the pattern
is symmetric .So ,the generating function is as follows:
5
X 5
X
I(x, y) = f (x, y, i, j), (3)
i=−5 j=−5

2
sin2 (a∗(y−i∗δy)
where f(x,y,i,j)= sin (a∗(x−i∗δx)
(a∗(x−i∗δx)2 (a∗(y−i∗δy)2 and δx = δy=150 µm .
Some Salient Points are:

• My image grid is 1.65mm X 1.65 mm.

• Intensity at the centre of a particular spot is governed by its sinc function because at the centre of
that spot the sinc functions of the other spots decays to almost 0.

• Because of the symmetry one spot can be generated and can be shifted by δx = δy=150 µm to get
the entire spot pattern.

3.2 Pixelation:

The Data will be obtained from CMOS/CCD Detector.It will be pixelated.So while simulating
the data this must be taken into consideration.The pixel used is 5 µm X 5 µm.Since the total screen
width is 1650 µm X 1650 µm.So,total no of pixels are 330 X 330.Each pixel stores within the double
integration of the Intensity Distribution within it the pixel.Let’s pick up a random pixel P whose area
of integration is D then the value under that pixel will be
ZZ
I(x, y)dA
D

15
where
5
X 5
X
I(x, y) = f (x, y, i, j), (4)
i=−5 j=−5
2 2
and f(x,y,i,j)= sin (a∗(x−i∗δx) sin (a∗(y−i∗δy)
(a∗(x−i∗δx)2 (a∗(y−i∗δy)2 and δx = δy=150 µm .The Pixelated Matrix is a 330 X 330
Square Matrix and let it be P.So, P=
 
a11 a12 ··· a1n
 a21 a22 ··· a2n 
 
 . .. .. 
 . ..
 . . . . 

an1 an2 ··· ann 330X330

, where aij represent the pixelated value corresponding to ith pixel along the row and jth pixel along
the column.The Maximum value of the matrix P is found out and the whole matrix was divided just to
normalize the matrix and finally colour plot was obtained as shown in 12. [3]

3.3 Spot Pattern Generation

The Parameters of each lens is same as used in the above example.

Figure 12: Simulated Spot Pattern for Plane Wavefront

16
4 Calculation of Shift in X and Y axes from the 500 X 500
Phase Map:

The Phase Map is a 3-D map in which X and Y coordinate are the image coordinates in the
image plane and the z coordinate is the phase coordinate in radians.To convert phase difference δφ to
path difference δs we use δφ= 2πδs λ ,The 500 X 500 data is sorted according to its position in the image
grid and 3-D phase map is plotted for each sub-apertures.So,all in all 121 such 3-D plots were obtained
each corresponding to one sub-aperture.So,each wavefront will be of arbitrarily shaped ,so to find the
local slopes or average slopes we need to find the best plane fit for each arbitrarily shaped wavefront.Then
,it is required to find the angles which in literature is known as tip-tilt angles i.e angles made by locally
fitted plane with X and Y axis respectively.The angles calculated out are really small.Numerically they
are ∼ 1 arcsec(”).

4.1 Phase Map:

The Phase Map Provided contains X and Y coordinates as the x and y coordinates of the image
plane in metres.The Z coordinate is the phase value in radians.It contains 2,50,000 points in total.A
3-Dplot of the phase map is shown below:

Figure 13: Phase Map

4.2 Algorithm for Plane Fit:

Let the equation of the best fit plane be z=ax+by+c.The parameters to be determined are
a,b,c.We have a set of over-determined System of Linear Equation where No of variables are 3 and no of
equations are much more than that,say n.Total points are 500 X 500 and no of points per sub-aperture
2
are 500
11 ≈ 2066.So,roughly n=2066.Let, the system be AX=B,where:

 T
x1 x2 x3 ....xn 1 h iT h iT
A=  y1 y2 y3 ....yn 1 , X= a b c , B= z1 z2 z3 , .. zn .
 
z1 z2 z3 ....zn 1
The least square fit solution to this problem will be X=(AT A)−1 AT B.

17
4.3 Plane Fits for Sub-Apertures(Sample Example):

121 Plane fits of Local wavefronts impinging on 121 Sub-Apertures of Shack-Hartmann Wave-
front Sensor were done using the above algorithm using Python’s Scipy Optimize Package.Sample Ex-
amples are shown below:

Figure 15: Plane Fitting of a Sub-Aperture I

4.4 Calculation of X and Y Shift:

Figure 16: Y-Shift Calculation((Image Courtesy:Thor Labs)

Let the angle the fitted plane make with X and Y axis be respectively be θ and φ respectively.The
angles are very small and hence tan(θ) ≈ θ and tan(φ) ≈ φ.So From Simple Trigonometry ,δy=fM L θ
and δx=fM L φ.Since our focal length fM L =3.7 mm and as a consequence δx and δy ∼ 0.1 µm - 1 µm.

18
4.4.1 Calculation of Tip(φ) and Tilt(θ):

Let the fitted plane of some random sub-aperture be z=ax+by+c.Let zmax and zmin be the
maximum and minimum value of the function over the area of the sub-aperture and let’s consider it
happens at xmax ,xmax and ymax ,ymax respectively.Then,

λ(zmax −zmin )
1. X shift= 2π(x max −xmin )

λ(zmax −zmin )
2. Y shift= 2π(y max −ymin )

Figure 17: Small Shifts ∼ 1µm(Scaled Upto 30 Times)

The Shift comes out to be very small as evident 12.To analyse the shifts from experimental data obtained
via CMOS/CCD Detector standard statistical techniques must be employed .One Favourite trick will be
be to do the Gaussian Fits along X and Y direction (121 each) and measure the difference in the centroid
or mean of the Gaussian.Gaussian fitting algorithms from scipy.optimize python were used.

19
5 Results:

5.1 2-D Plot Along a Particular Y Value:

To get an idea regarding the intensity distribution we resort to 1-D sinc function.We pick the
centre of any row as fixed y and plot the variation of Intensity Distribution with x co-ordinate of the
image plane.As there are 11 lenses in a row we will get 11 spots and 11 peaks in the graph we plotted.In
case of the intensity distribution created by the plane wavefront we will get 11 same magnitude peaks
with equal separation of 150 µm.But for the aberrated case there will be a small shift in the maxima of
the distribution as well as the magnitude.

Figure 18: Intensity Distribution along the Centre of a Row of 11 Lenses

20
5.2 Gaussian Fit of Non-Shifted Distribution for a Sub-Aperture:

Figure 19: Gaussian Fit of Non-Shifted Distribution for a Sub-Aperture

As a Sample exercise I have shown the intensity distribution of one sub-aperture and have fitted
a Gaussian Function to it.Practically, I did this for 121 lenses and via this Gaussian fit centroid of the
Distribution were found out.

21
5.3 Gaussian Fit of Shifted Distribution for a Sub-Aperture:

Figure 20: Gaussian Fit of Shifted Distribution for a Sub-Aperture

Here I have taken the distorted wavefront and have plane fitted it and then have plotted it.Blue
Coloured Plot shows the distribution.Subsequently , I have plotted the Gaussian Plot for it with a view
to trace out the centroid.Red Coloured Plot is the Gaussian Plot.

22
5.4 Gaussian Fits for the Plane Wavefront and Distorted Wavefront:

Figure 21: Gaussian Plots for the Shifted and Non-Shifted Case

The necessity of this plot to trace out the shift in the centroid of the distribution due to the
aberrated wavefront.The Difference in the Peak Value which is very small gives the shift in X direction of
the spot pertaining to the sub-aperture. We do we it for 121 lenses and obtained the shift in X direction.
Similarly plotting the Intensity Distribution for constant X for these 121 lenses gives the shift in the y
direction.So via this 2X121 plots we can find the shifts in X and Y direction corresponding to each spot.

6 Error Analysis in My Simulations:

In the initial stage I simulated the Intensity Distribution and calculated the shift in X and Y
direction from the Phase Map Provided to me.I constructed two 11X11 Matrices containing the shift in
x and y direction of each spot.Then I did the analysis via Gaussian Fitting and calculated the Shift in X
and Y direction via the measurement of shift in Centroid.So, to ensure a good simulation I plotted the
error in my calculation.The Maximum Error obtained was 2.5 % .From this I ensured a good simulation.

23
6.1 Percentage Error in X Shift:

Figure 22: Absolute % error in Measurement of X Shift

Figure 23: Difference error in Measurement of X Shift

6.2 Percentage Error in Y Shift:

Figure 24: Absolute % error in Measurement of Y Shift

24
Figure 25: Difference error in Measurement of Y Shift

I have plotted in X axis the original X and Y shift values respectively which I obtained via the
linearization of the Phase Values and calculated the percentage error and difference error w.r.t to the
values I got via the measurement of the centroids of the Gaussian Fits.The error obtained is very small
as evident from the graph.

7 Conclusions:
• For a given phase map, local X and Y Shifts of wavefront were found out via linearization of
distorted wavefront.

• Shack-Hartmann Wavefront Sensor was simulated for Rectangular Pupil.

• X and Y shifts corresponding to the original phase map were determined out via Gaussian Fitting
of the Intensity Curves after Pixelization.

• The Error in The Simulation was found to be less than 2.5%

8 Future Scope:
• The Noises Due to the CCD can be taken into account for a better analysis.

• The Pupil in practical use is Circular.So,Circular Pupil can be used for a more advanced analysis.

• The Wavefront Slopes can be used for further reconstruction of the Wavefront using Zernike Poly-
nomials.

References
[1] Optics. Ajoy Ghatak. Tata McGraw-Hill Education, 2005

25
[2] (Optical engineering 67) Robert Tyson - Adaptive Optics Engineering Handbook-Marcel Dekker
(2000).

[3] (SPIE Tutorial Texts TT89) David George Voelz - Computational Fourier Optics a MATLAB
tutorial (SPIE Tutorial Texts Vol. TT89)-SPIE Press (2010)

[4] Nicholas J Giordano - Computational physics-Prentice Hall (1997)

[5] http://en.wikipedia.org/wiki/ShackHartmann_wavefront_sensor.

[6] Adaptive Shack-Hartmann wavefront sensor accommodating large wavefront variations Aftab,
M.; Choi, H.; Liang, R. Kim, D. W. Opt. Express , Vol. 26 , pp. 34428-34441 , 2018

[7] A. Kudryashov, V. Samarkin, A. Alexandrov, J. Sheldakova and V. Zavalova, ”Shack-Hartmann


wavefront sensor - advantages and disadvantages,” 2010 International Conference on Advanced
Optoelectronics and Lasers, Sevastopol, 2010, pp. 76-77.

[8] Introduction to Fourier Optics. Joseph W. Goodman. McGraw-Hill, New York

[9] https://commons.wikimedia.org/wiki/File:Atmospheric_seeing_r0_t0.svg#/media/
File:Atmospheric_seeing_r0_t0.svg

[10] https://www.thorlabs.com/thorproduct.cfm?partnumber=WFS150-5C

[11] https://www.researchgate.net/publication/258516995_Waffle_mode_mitigation_
in_adaptive_optics_systems_A_constrained_Receding_Horizon_Control_approach/
figures?lo=1

[12] https://commons.wikimedia.org/wiki/File:Delta-Doped_Charged_Coupled_Devices_
(CCD)_for_Ultra-Violet_and_Visible_Detection.jpg#/media/File:Delta-Doped_
Charged_Coupled_Devices_(CCD)_for_Ultra-Violet_and_Visible_Detection.jpg

[13] https://www.thorlabs.com/thorproduct.cfm?partnumber=WFS150-5C

26

You might also like