QUADSERCHB

By Vinzenz Unger and Anchi Cheng

This program is a key component in the procedure. It determines the exact positions of the cross-correlation peaks in the real space cross-correlation map, which is obtained by inverse transformation of the cross-correlation transform (“correl$image.fft”) calculated by TWOFILE. The peak positions are written to a file (“prof$image.dat”) which later provides the data for CCUNBEND to calculate the distortion vectors.

Starting at the centre of the reference area (coordinates: $centrex $centrey) QUADSERCHB searches the cross-correlation map along the real-space a- and b-axes. Currently only a total of 180 unit cells can be searched along each direction. As the program progresses out from the reference it uses a specified number of previous unit cells (parameter: NRANGE) to predict the position of the next cross-correlation peak. Because lattice distortions are usually very smooth this feature minimizes the amount of search necessary to find the peaks. In the current protocol six unit cells are used for the learning algorithm. Furthermore, the algorithm can only use the information from unit cells that are behind the search front. Still, the program has an option that allows the use of information ahead of the search front during a second run. In this case the parameter IPASS, preceding the number of unit cells used in the learning algorithm, needs to be set to IPASS=1. As a result, the error for the prediction of the position of each cross-correlation peak, will be written to an ERROR file. In a second pass, this file can then be used to provide information about any distortions ahead of the search front by selecting IPASS=2. In our experience, using the simple search option IPASS=0 is fully sufficient in almost all cases. Furthermore, if the corrected image is used as target for a second pass (as we recommend for weaker, less ordered specimen) then this option cannot be used because any ERROR read in from the first pass will refer to the original, uncorrected image.

Regardless of the setting for IPASS, after moving to the predicted centre of the next cross-correlation peak the program searches for ± KDC and KDR pixel along x and y to locate the rough peak position. The true position is then found by fitting the densities against a more finely sampled profile that was generated with AUTOCORRL. Several things are important to point out here. The parameter KDC and KDR (see “set radius = “x,y” in protocol for JOBA) should be set to allow as much of a unit cell as possible to be searched. “Cracks” or “merging lines” of cross-correlation peaks in areas that are clearly crystalline and the diagnostic output “POSITION AND COEFF….” in the logfile are good indicators that an inappropriate value was chosen. To define an appropriate setting one needs to remember, that in contrast to the expected peak positions, which are calculated along a and b respectively, KDC and KDR refer to a number of pixel along x and y. This difference is important for two reasons. Firstly, the shape of the searched area is either square (KDC=KDR) or rectangular (KDC ≠ KDR) and hence one needs to adjust the settings for each individual case if the lattice is rectangular. Secondly, as a consequence of the shape of the searched area, one also needs to account for an apparent “shrinkage” of the usable search range if the lattice is hexagonal or at an angle with respect to x and y. If this apparent shrinkage is not considered the program will be able to reach into the neighboring unit cell, which can result in wrong results. To get an estimate for the appropriate number of pixel, divide the size of the map ($isezex) by the number of unit cells along the relevant edge of the map (calculated in XIMDISP as RLUA and RLUB). Take half of this number and multiply by ~0.8 (~sin 60˚) if the lattice is hexagonal or by an appropriate estimate if the lattice is square or rectangular but at an angle to the x,y coordinate system. The current program dimensions limit KDC and KDR to a maximum of 14 pixel and an explicit error message will be displayed if KDC and KDR are chosen too large.

A second important point is that QUADSERCH expects an autocorrelation profile array of 101×101 pixel at a 20-times over-sampling to fit the true peak position. This was already mentioned in the description of AUTOCORRL. The settings are “hard-wired” in the source code, i.e. several adjustments to the source will be necessary if the parameter for calculating the autocorrelation are changed. We do not recommend this unless you know exactly what you are doing. The current setup will refine the position of the peak within an area of ± 2.5 pixel around the roughly approximated centre of the peak. This will give good results if the image was digitized at an appropriate stepsize. Independent of these limitations it is possible to specify what part of the profile is used by adjusting the parameter RADLIM (see Fig.5). Especially the autocorrelation profiles for images of more highly tilted crystals may be anisotropic (i.e. have an elliptical shape) and furthermore may contain negative autocorrelation values within the 101×101 pixel array.

images/fig5.png Since the autocorrelation of an object cannot be less than 0, any negative values are not useful for the cross-correlation peak search and should be excluded from the profile fit.

This can be achieved as follows

  • Display the 101×101 pixel array (e.g. “autop1$image.map”) in XIMDISP.
  • Identify a pixel along each of the principle axes of the elliptical autocorrelation profile that still has a positive value. In praxis, choosing pixel that still have ~10% of the maximal autocorrelation value works well.
  • Read off the pixel coordinates and calculate the radius [r= √(x-50)2+(y-50)2)]. Note, subtraction of “50” is necessary since the centre of the profile is at coordinate (50,50). QUADSERCH only accepts radii <50 because for these values a perfectly round autocorrelation peak will reach the edge of the profile along the x and y-axes. Consequently, the corners of the (square) profile are not used. Hence if part of an elliptical autocorrelation peak reaches into the corner and r>50 is calculated for the chosen pixel, then a default of r=49 should be used. This will not have a negative impact on the result since the main purpose of this step is to exclude negative cross-correlation values at radii of less than 50 pixel.
  • Set the RADLIM parameter. This requires specifying the radius along the two principal axes (r1, r2) and the angle between r1 and the x-axis of the profile. By convention the angle is positive if r1 is pointing from the centre of the profile (xy coordinate: 50,50) to the right and is counterclockwise from x.

In our experience, setting RADLIM appropriately can make a significant difference to the processing result if the autocorrelation profile is not isotropic and contains negative areas.