4.1 Image Processing
4.1.3 Radial Average
the optical coupling fluid, which was used to fuse together the fiber-optic components of the detector assembly. Since the sources of these artifacts are known and individual pixels are treated independent of each other, it is justifiable to manually remove these erroneous pixels. Binary mask images are again used to filter out these incorrect pixels from the ratio images, as is illustrated in Figure 4.2.
Once the ratio image has been reduced to its viable data only, it is normalized to the number of active pixels according to
) . , (
) , ( ) , ( ) , ˆ(
∑
=
∑
pixel pixel
y x R
y x M y x R y x
R (4.7)
This normalization, empirical in nature, is used to ensure that the temporally referenced (i.e., time-resolved) signal is free from systematic variations as a function of temporal delay.9
In addition, the standard error associated with each pixel in the ratio image is calculated by propagating the standard errors of the input images to obtain a corresponding standard error ratio image, RˆStdErr(x,y).
course, does not take into account instrumental considerations, such as the distortion of the ring pattern that occurs, if the optical axis and the detection plane normal originating from the detector center are not parallel. A situation like this can arise due to the curved flight path of the electrons from the gun to the detector. The Lorentz force originating from the Earth’s magnetic field B
acts on the electrons traveling at velocity v
according to F=e
( )
v×B , such that the beam has to be steered/corrected by the electron optics. As a result, the interaction region may not lie on the geometrical axis of the instrument (straight line from photocathode to detector center), but may be offset from it. This misalignment results in the detection plane intersecting the scattering cone at a tilt angle, α . Figure 4.3a shows that such a detection geometry yields an elliptically distorted scattering pattern, as opposed to perfect circles. In addition, the center of the indicated ellipse does not coincide with the axis of the scattering cone. In fact, the center shift becomes a function of the electron scattering angle θ and the camera distance L given by( ( ) ) ( )
( )
,cos sin cos
sin
2
− −
= +
θ α
θ θ
α L θ
Shift
Center (4.8)
and we can define the ellipticity ε in terms of the major and minor semi-axis a and b of the ellipse as
( ) ( ) ( )
( )
( ) ( )
cos( )
.1 cos
cos 1 2 1
, tan
cos , 1 cos
sin 1 2 1
+ −
= +
≡
=
+ −
= +
θ α θ
θ α ε
θ
θ α θ
θ α
b a L b
L a
(4.9)
It should be noted here that the minor semi-axis b does not change with the tilt angle and is in fact equal to the radius of the circle that would have been obtained in the ideal scattering geometry. The major semi-axis a in contrast, grows as a function of the scattering angle, resulting in larger and larger elliptical distortions of the outer diffraction rings.
To determine the orientation angle β of the elliptical distortion, the center position of each diffraction ring, indexed in Figure 4.3b, is found separately. Center determination is accomplished by comparing the circularly averaged, one-dimensional data from the left and right sides or the top and bottom halves of the detector and eliminating any oscillatory feature in the difference intensity for the given diffraction ring. This method has been employed and described previously and can reveal the ring centers to an accuracy of 0.2 pixels.18 Figure 4.3c plots the coordinates of the center positions, which all fall on a straight line. Because the images are treated as N×N matrices (positive y-axis points downward), the orientation angle β is given by
, arctan
∆
− ∆
= x
β y (4.10)
such that β represents the angle of the major semi-axis of the ellipse with the positive x-axis of the image. Figure 4.3d shows the agreement between the experimental center shift, obtained by evaluating the linear distance between the center positions, and the calculated results based on the tilted detector model. Figure 4.3e highlights the skewed results that are obtained, when using a plain circular average with a single center position: The intensities measured in two separate halves (top vs. bottom, left vs. right) of the detector are shifted relative to each other, especially at high scattering angles. In
contrast, the elliptical average in Figure 4.3f eliminates these discrepancies, as evidenced by the flat difference intensities. A radial average of a pattern using an incorrect center or ignoring elliptical distortions is known to produce data that may, upon analysis, lead to the wrong conclusions.100 This is particularly important for time-resolved data, which is richer in oscillatory features, but much lower in intensity due to the subtraction by temporal frame referencing (see Section 4.1.4).
Once the center coordinates, the ellipticity, and the ellipse orientation angle is known, elliptical mask images can be formed by parameterizing the ellipses as
( ) ( ) ( ) ( ) ( )
( )
cos( ) ( )
sin sin( ) ( )
cos , , sin sin coscos
β β
β β
t b t
a y t y
t b t
a x t x
c c
+ +
=
− +
= (4.11)
where a and b are expressed in units of pixel, b is an integer in the interval
[
0,600]
, and the results obtained for x( )
t and y( )
t are rounded to next nearest integer. A weighted average using the standard errors at each pixel is then performed using the individual mask images for each b according to( )
( )
, ) , ˆ (
1( , ) ˆ
) , ( ) , ˆ( )
(
2 2
∑
∑
⋅=
pixel StdErr pixel StdErr
b
Mean
y x R
y x R
y x M y x R b
R (4.12)
where the sum is over all nonzero pixels in the resulting images. Since b is equivalent (up to a conversion factor) to the momentum transfer s, we have thus obtained the distortion-free one-dimensional diffraction intensity.
The corresponding weighted standard deviation is calculated using
( )
( ) ( )
( )
(
ˆ ( , ))
.) , ( ) ( ) , ˆ(
) , ˆ (
1 )
, ˆ (
1
) , ˆ (
1 )
( 2
2 2
2 2
2
2
∑
∑
∑
∑
× − ⋅
−
=
pixel StdErr
b Mean
pixel StdErr pixel StdErr
pixel StdErr StdDev
y x R
y x M b R y x R y
x R y
x R
y x b R
R (4.13)
As before, the calculation of RMean(b) and RStdDev(b) are repeated three times to filter out statistically rejectable data points, which fall outside the interval RMean(b)±µ⋅RStdDev(b). To satisfy Chauvenet’s condition,98,99 the parameter µ is here set to a value of 4, because there are about 500 – 3000 nonzero pixels in a given mask image, Mb(x,y).
After all outlier pixels have been rejected, the final standard error in the determination of the weighed mean is obtained by
) . , (
) ) (
( =
∑
pixel b StdDev StdErr
y x M
b b R
R (4.14)
The processed data in its final form, RMean(b), and the corresponding error estimation, )
(b
RStdErr , shown in Figure 4.4b, are used as input for the data analysis procedures
described in Section 4.2.