PCCalibrationMovingScreen#

class kikuchipy.detectors.PCCalibrationMovingScreen(pattern_in: ndarray, pattern_out: ndarray, points_in: Union[ndarray, List[Tuple[float]]], points_out: Union[ndarray, List[Tuple[float]]], delta_z: float = 1.0, px_size: = None, binning: int = 1, convention: str = 'tsl')[source]#

Bases: object

A class to perform and inspect the calibration of the EBSD projection center (PC) using the “moving screen” technique from .

The technique requires two patterns acquired with a stationary beam but with different specimen detector distances (SDDs) where the difference is known. First, the goal is to find the pattern region which does not shift between the two camera positions, (PCx, PCy). This point can be estimated by selecting the same pattern features in both patterns. Second, the DD (PCz) can be estimated in the same unit as the known camera distance difference. If also the detector pixel size is known, PCz can be given in the fraction of the detector screen height.

Parameters:
pattern_in

Pattern acquired with the shortest detector distance (DD) in the “in” position.

pattern_out

Pattern acquired with the longer DD in the “out” position, with the camera a known distance delta_z from the “in” position.

points_in

Set of $$n$$ coordinates [(x1, y1), (x2, y2), ...] of pattern features in pattern_in.

points_out

Set of $$n$$ coordinates [(x1, y1), (x2, y2), ...] of pattern features, the same as in points_in, in pattern_out. They must be in the same order as in points_in.

delta_z

Known distance between the “in” and “out” camera positions in which the pattern_in and pattern_out were acquired, respectively. Default is 1.0. The output PCz value will be in the same unit as this value, unless px_size is provided.

px_size

Known size of the detector pixels, in the same unit as delta_z. If not given (default), the PCz will not be scaled to fractions of detector height.

binning

Detector pixel binning. Default is 1, meaning no binning. This is used together with px_size to scale PCz.

convention

Whether to present PCy as the value from bottom to top (TSL), or top to bottom (Bruker). Default is "tsl".

Attributes

 PCCalibrationMovingScreen.line_lengths Return the length of lines within the patterns in pixels. PCCalibrationMovingScreen.lines Return the start and end points of all possible lines between all points per pattern, of shape (2, n_lines, 4), where the last axis is (x1, y1, x2, y2). PCCalibrationMovingScreen.lines_end Return the end points of lines within both patterns, of shape (2, n_lines, 2). PCCalibrationMovingScreen.lines_out_in Return the start (out) and end (in) points of the lines between corresponding points in the patterns, of shape (n_points, 4). PCCalibrationMovingScreen.lines_out_in_end Return the end points of the lines between corresponding points in the patterns, of shape (n_points, 2). PCCalibrationMovingScreen.lines_out_in_start Return the starting points of the lines between corresponding points in the patterns, of shape (n_points, 2). PCCalibrationMovingScreen.lines_start Return the starting points of lines within the patterns, of shape (2, n_lines, 2). PCCalibrationMovingScreen.n_lines Return the number of lines in each pattern. PCCalibrationMovingScreen.n_points Return the number of points of pattern features in each pattern. PCCalibrationMovingScreen.ncols Return the number of detector columns. PCCalibrationMovingScreen.nrows Return the number of detector rows. PCCalibrationMovingScreen.pc Return the average PC calculated from all estimates. PCCalibrationMovingScreen.pc_all Return all estimates of PC. PCCalibrationMovingScreen.pcx_all Return all estimates of PCx. PCCalibrationMovingScreen.pcy_all Return all estimates of PCy. PCCalibrationMovingScreen.pcz_all Return all estimates of PCz, scaled to fraction of detector height if px_size is not None. PCCalibrationMovingScreen.pxy Return the average of intersections of the lines between corresponding points in the patterns. PCCalibrationMovingScreen.pxy_all Return the intersections of the lines between the corresponding points in the patterns, i.e. estimates of (PCx, PCy), of shape (n_points, 2). PCCalibrationMovingScreen.pxy_within_detector Return the boolean array stating whether each intersection of lines between corresponding points in the patterns are inside the detector (True), or outside (False). PCCalibrationMovingScreen.shape Return the detector shape, (nrows, ncols).

Methods

 Draw lines between all points within a pattern and populate self.lines. A convenience method of three images, the first two with the patterns with points and lines annotated, and the third with the calibration results.