PCCalibrationMovingScreen#
- class kikuchipy.detectors.PCCalibrationMovingScreen(pattern_in: ndarray, pattern_out: ndarray, points_in: ndarray | List[Tuple[float]], points_out: ndarray | List[Tuple[float]], delta_z: float = 1.0, px_size: float | None = 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 [Hjelen et al., 1991].
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 inpattern_in
.- points_out
Set of \(n\) coordinates
[(x1, y1), (x2, y2), ...]
of pattern features, the same as inpoints_in
, inpattern_out
. They must be in the same order as inpoints_in
.- delta_z
Known distance between the “in” and “out” camera positions in which the
pattern_in
andpattern_out
were acquired, respectively. Default is1.0
. The output PCz value will be in the same unit as this value, unlesspx_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 withpx_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
Return the length of lines within the patterns in pixels.
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)
.Return the end points of lines within both patterns, of shape
(2, n_lines, 2)
.Return the start (out) and end (in) points of the lines between corresponding points in the patterns, of shape
(n_points, 4)
.Return the end points of the lines between corresponding points in the patterns, of shape
(n_points, 2)
.Return the starting points of the lines between corresponding points in the patterns, of shape
(n_points, 2)
.Return the starting points of lines within the patterns, of shape
(2, n_lines, 2)
.Return the number of lines in each pattern.
Return the number of points of pattern features in each pattern.
Return the number of detector columns.
Return the number of detector rows.
Return the average PC calculated from all estimates.
Return all estimates of PC.
Return all estimates of PCx.
Return all estimates of PCy.
Return all estimates of PCz, scaled to fraction of detector height if
px_size
is notNone
.Return the average of intersections of the lines between corresponding points in the patterns.
Return the intersections of the lines between the corresponding points in the patterns, i.e. estimates of (PCx, PCy), of shape
(n_points, 2)
.Return the boolean array stating whether each intersection of lines between corresponding points in the patterns are inside the detector (
True
), or outside (False
).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.