• Nem Talált Eredményt

Spatial calibration development and testing

4.5 Testing and calibration

4.5.2 Spatial calibration development and testing

During beam emission spectroscopy data analysis it is crucial to know the measurement position for each detector pixel. Based on this information one can determine the size of the structures, correlation lengths and velocities, as well. By following the theoretical back-ground of the spatial calibration (described in Sec. 4.3.1) one can calculate the transforma-tion between the CMOS image and the spatial coordinates of each detector’s measurement position on the NBI beam plane.

4.5. Testing and calibration 55 The steps of the spatial calibration are the following:

• 1.: Find the pixel coordinates of structures on the vacuum vessel’s wall in the CMOS camera image of which spatial coordinates are known from the engineering design of KSTAR.

• 2.: Determine the theoretical spatial coordinate of a pinhole with which the optics can be substituted and calculate the intersection coordinates of the theoretical NBI beam plane and the vectors between the fiducial points and the pinhole.

• 3.: Calculation of the transformation matrix.

• 4.: Calculation of the spatial position for each detector pixel by using the calibration image and the transformation matrix.

• 5.: Cross-check the results with the EFIT magnetic field reconstruction.

Fiducial point determination

During the development of the spatial calibration method, four fiducial points were identi-fied in the image of the vacuum vessel’s wall of which spatial coordinates are known. These points are the lowermost, uppermost, right and left points of a window on the J port of KSTAR. These points can be found by first finding an image in which this port is clearly vis-ible and in focus. Such a case can be seen in Figure 4.9 which was taken during a disruption in shot #9276. One can identify the window of the J-port in the picture along with the edges of the tiles on the wall. The edges of the bricks are horizontal and vertical in spatial space.

For the calibration one has to assume that the horizontal and vertical lines of the edges re-main horizontal and vertical. Thus, to arrive at the positions of the fiducial points, one has to fit one line (see Fig. 4.9 1. red line) on one edge of the tile, one on the other (Fig. 4.9 2.

red line) and a circle on the window (Fig. 4.9 3.). In the next step, one needs to slide line 1.

and 2. parallel so their intersection point is at the center of the circle. The intersections of the lines with the circle determine the coordinates of the fiducial points in pixel space. The positions of these points are already known in real spatial space.

1.

2.

3.

FIGURE 4.9: The image of the vacuum vessel’s wall for spatial calibration along with the steps for the fiducial point determination.

Determining the projected fiducial points on the plane of the NBI

Figure 4.10 depicts the next problem which needs to be solved in order to arrive at the transformation matrix for the spatial calibration. The coordinate of the pinhole can be found in the optical design. The coordinates of the fiducial points are known. Only the theoretical NBI plane needs to be found and then the intersection points can be calculated.

Pinhole NBI plane

Vacuum vessel’s wall

FIGURE 4.10: The geometry of determining the projected fiducial points on the plane of the NBI.

KSTAR has 3 NBI ion sources injected from the same beam. The beam injection is done in a way where the 3 beam lines cross each other at a point with an angle of 4 degrees. The beam lines are known in real space. Since the beam has a symmetrical rectangular cross-section one can relatively easily define the NBI plane. The intercross-section point, one point on one of the NBI beam lines and a point between these two with a different z coordinate define one beam plane. For our spatial calibration one effective beam plane is needed which is calculated from the weight averaged plane of the three beam plane. The weights for the averaging are calculated from the beam currents of each operating source. Equation 4.6 shows the calculation of the effective beam plane.

rN BI,ef f = w1·rN BI,1+w2·rN BI,2+w3·rN BI,3

Pwi (4.6)

where rN BI,i (i = 1,2,3) are points on each NBI ion source’s beam plane and wi are the weight factors. At this point all the information is known in order to determine the transformation. The next step is to calculate the coordinates of the fiducial points on the plane of the NBI. These points are determined by the intersection of the NBI plane and the lines drawn between the pinhole position and the fiducial points.

Let’s denote three points on the NBI plane withrj = [xj, yj, zj](j= 1,2,3) which unam-biguously define the NBI plane if they are not co-linear. The plane equations of the NBI are the following.

ax+by+cz+d= 0 (4.7)

ax1+by1+cz1+d= 0 (4.8)

ax2+by2+cz2+d= 0 (4.9)

ax3+by3+cz3+d= 0 (4.10)

where a,b,c,d are coefficients which are going to be eliminated later.

4.5. Testing and calibration 57 The equation of the line passing through the plane is defined by the position of the pin-holerpinhole = [x4, y4, z4]and theithfiducial pointrf,i = [xf,i, yf,i, zf,i]. The corresponding line equations are the following.

rpinhole+ (rf,i−rpinhole)·ti =r (4.11) x4+ (xf,i−x4)·ti=x (4.12) y4+ (yf,i−y4)·ti =y (4.13) z4+ (zf,i−z4)·ti=z (4.14) wheretiis the parameter.

To arrive at the intersection coordinates on the NBI plane, one has to solve the above lin-ear equation system for thetiparameter. By multiplying equations 4.7-4.10 with(1 +ti)and substituting 4.11-4.14 equations in them, one can arrive at the following matrix equation.

A·a+Bi·a·ti = 0 (4.15)

wherea= [a, b, c, d]and theAandBimatrices are the following

A=

1 1 1 1

x1 x2 x3 x4

y1 y2 y3 y4 z1 z2 z3 z4

(4.16)

Bi =

1 1 1 0

x1 x2 x3 xf,i−x4 y1 y2 y3 yf,i−y4 z1 z2 z3 zf,i−z4

(4.17)

Equation 4.15 holds true if the determinant of theA+Bi·ti matrix is zero. This can be reordered to arrive at the expression forti(see Eqn. 4.18) which can be substituted into Eqn.

4.11 to arrive at ther0f,iintersection points on the NBI plane (see Eqn. 4.19).

ti =−

1 1 1 1

x1 x2 x3 x4

y1 y2 y3 y4 z1 z2 z3 z4

1 1 1 0

x1 x2 x3 xf,i−x4

y1 y2 y3 yf,i−y4 z1 z2 z3 zf,i−z4

(4.18)

r0f,i = rpinhole+ rf,i−rpinhole

·ti (4.19)

Determining the transformation matrix between the pixel and spatial coordinates

One can assume that the real spatial coordinates are bilinear functions of the pixel coordi-nates. Bilinear transformation can describe translation, rotation and trapezoidal distortion.

Higher order transformations could take other types of distortions into account, however, no strong distortion was seen in the CMOS images. Equations 4.20-4.22 describe the trans-formation between the pixel coordinates and the real spatial coordinate. Let’s denote the pixel coordinates with pi,x andpi,y and the spatial coordinates withri,x0 ,r0i,y,ri,z0 . If we as-sume bilinear connection between the two, then three equation can be formed:

ri,x0 = c1·pi,x+c2·pi,x·pi,y+c3·pi,y+c4 (4.20) r0i,y = c5·pi,x+c6·pi,x·pi,y+c7·pi,y+c8 (4.21) r0i,z = c9·pi,x+c10·pi,x·pi,y+c11·pi,z+c12 (4.22) wherepi,xandpi,y are the pixel coordinates of theithfiducial point, ri,x0 ,ri,y0 ,ri,z0 are the spatial coordinates of theith fiducial point andcj are the bilinear coefficients. Since there are four fiducialr0points, 12 equations can be written. There are also 12 unknown variables.

The resulting equation system can be solved by matrix algebra. One can rewrite the parts of the equations into a matrix and two vectors as follows:

A =

p1,x p1,x·p1,y p1,y 1 0 0 0 0 0 0 0 0 0 0 0 0 p1,x p1,x·p1,y p1,y 1 0 0 0 0 0 0 0 0 0 0 0 0 p1,x p1,x·p1,y p1,y 1 p2,x p2,x·p2,y p2,y 1 0 0 0 0 0 0 0 0 0 0 0 0 p2,x p2,x·p2,y p2,y 1 0 0 0 0 0 0 0 0 0 0 0 0 p2,x p2,x·p2,y p2,y 1 p3,x p3,x·p3,y p3,y 1 0 0 0 0 0 0 0 0 0 0 0 0 p3,x p3,x·p3,y p3,y 1 0 0 0 0 0 0 0 0 0 0 0 0 p3,x p3,x·p3,y p3,y 1 p4,x p4,x·p4,y p4,y 1 0 0 0 0 0 0 0 0 0 0 0 0 p4,x p4,x·p4,y p4,y 1 0 0 0 0 0 0 0 0 0 0 0 0 p4,x p4,x·p4,y p4,y 1

c = [c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12]0 r0 =

r01,x, r01,y, r01,z, r02,x, r2,y0 , r2,z0 , r03,x, r3,y0 , r3,z0 , r04,x, r4,y0 , r4,z0 0

The problem is then reduced to find thecconstant vector in the Eqn. 4.23 matrix equa-tion.

c=A−1r0 (4.23)

If more then four fiducial points are given, then the problem becomes over-defined. Such a problem can be solved by the least square method. (see Eqn. 4.25)

c = ATA−1

ATr0 (4.24)

e = r0−Ac (4.25)

4.5. Testing and calibration 59 LED light on the calibration screen

along with the detector pixels, shot 14110

0 200 400 600 800 1000 1200 x [pix]

0 200 400 600 800 1000

y [pix]

FIGURE 4.11: The image of the calibration LEDs on the calibration screen along with the interpolated detector centers.

whereeis the error vector. The transformation can be calculated with equation 4.26.

r0 =Cp (4.26)

whereCis the coefficient matrix andpis the pixel vector (see Eqn. 4.28 and 4.27).

C =

c1 c2 c3 c4 c5 c6 c7 c8

c9 c10 c11 c12

 (4.27)

p =

 px px·py

py

1

(4.28)

where[px, py]is the pixel coordinate of an arbitrary point in the image.

The resulting r0 vector can be easily transformed into cylindrical coordinates of r0a = [R, z, θ].

Calculation of the spatial coordinates of the individual detector pixels

After calculation of the transformation matrix, one can calculate the spatial coordinates of each detector pixel. The APDCAM-10G 4x16 has 5 calibration LEDs which surround the detectors. One can take an image of the LEDs on the calibration screen (see Fig. 4.11). Since the geometry of these LEDs and the detectors are known, one can calculate the position of the detectors by interpolating the pixel positions of the detectors between the LEDs. The calculated pixel positions of the detector centers can also be seen in Fig. 4.11.

From the pixel coordinates of each detector and the transformation matrix, one can cal-culate the spatial coordinates of each detector pixel.

0.65 0.90 1.15 r/a

-150 -100 -50 0 50 100 150

Z [mm]

14110 4.00s b)

Separatrix

Separatrix from BES

Time delay profile

-20 -10 0 10 20

Time delay [µs]

a)

e-diam (LFS up)

i-diam (LFS down)

Separatrix

0.75 0.85 0.95 1.05 r/a

FIGURE 4.12: a) Time lag profile calculated from the cross-correlation func-tions (shot 14110); b) Spatial posifunc-tions of the BES channels along with the EFIT

magnetic reconstruction.

Cross-checking the results with EFIT

With the analysis of BES signals one can identify the position of the separatrix from the poloidal velocity profile. The poloidal velocity profile can be calculated with the method described in Section 1.8.3. The position where the poloidal velocity profile changes sign due to the edge shear layer shows the position of the separatrix.

The EFIT reconstruction provides the position of the last closed flux surface on the poloidal plane with an accuracy of 1-2cm. By plotting the spatially calibrated BES posi-tions on the EFIT reconstruction, one can check the validity of the spatial calibration. The calculated time lag profile and the EFIT reconstruction can be seen in Fig. 4.12.

As one can see, the separatrix position calculated from the BES signal matches the results from the EFIT reconstruction within the 10mm resolution of the BES measurement and the 1-2cm accuracy of the EFIT reconstruction.