Sunday, June 23, 2013

Gaussian to Flat-top

Zemax Knowledge Base gives a design method to convert Gaussian irradiance profile to flat top profile (see reference [1]).
This post (A) gives another analytic form and (B) examines the 1-D situation.

A.
If the input Gaussian profile has the 1/e2 radius of W, the output flat-top has the half-width of K, then the Zemax KB article gives:
        S = K [1-exp(-2X2/W2)]1/2                                              (1)
This is a ray mapping formula to get the output coordinate value S for every input coordinate X.

For Zemax, this formula can be written in another form. Let REP be the radius of the entrance pupil, then

X

W

 =  X/REP

W/REP
 = XNA1/2
(2)
where XN is the normalized coordinate and A is the system apodization factor. Eq(1) can therefore be written as
        S = K [1-exp(-2XN2A)]1/2                                              (3)
This formula is better suited for Zemax because both XN and A are the Zemax direct parameters. Using this formula, the macro file for generating merit function can be simplified.

B. How about 1-D?
Very often people need a 1-D flat-top, e.g., flat-top on X-axis and Gaussian on Y-axis. In this case, the irradiance integration is different.

For input Gaussian profile, the contained power in a 1-D variable slit is:
    Pi(X) = Ii  X
-X
exp(-2x2/Wx2)dx  +∞
-∞
exp(-2y2/Wy2)dy
(4)
where Ii is the peak irradiance, Wx and Wy are the 1/e2 beam radii. For output profile, the contained power in the 1-D variable slit is:
    Po(S) = Io  S
-S
dξ  +∞
-∞
exp(-2η2/Wη2)dη        (when S<=Wξ)
(5)
    Po(S) = Io2Wξ  +∞
-∞
exp(-2η2/Wη2)dη        (when S>Wξ)
(5)
where Io is the peak irradiance, Wξ is the half-width of the flat-top and Wη is the 1/e2 half-width of the Gaussian profile.

First, let Pi(X=∞) = Po(S=∞), the conservation of total power gives:

Io

Ii

 =  π1/2WxWy

21/22WξWη

(6)
To get the ray-mapping relation, let Pi(X) = Po(S) and plug in Eq.(6):
        S = Wξ erf (21/2X/Wx) = Wξ erf (21/2XNA1/2).                                              (7)
where erf is error function. So for 2D and 1D flat-top generation, the ray-mapping formula is different.

To write a macro for generating merit function for 1-D flat-top, one can use
       GETSYSTEMDATA 1
       Apodization = VEC1(2)
to read the apodization factor.

To caculate erf function, Zemax does not have it built-in. One can use an approximation from wikipedia [2].

References:
[1] http://kb-en.radiantzemax.com/Knowledgebase/How-to-Design-a-Gaussian-to-Top-Hat-Beam-Shaper
[2] http://en.wikipedia.org/wiki/Error_function

No comments: