EBSDDetector#

class de_ebsd.sim.EBSDDetector(shape=(480, 480), pattern_center=(0.5, 0.5, 0.5), sample_tilt=70.0, tilt=0.0, azimuthal=0.0, twist=0.0, px_size=1.0)[source]#

Bases: object

An EBSD detector with a fixed pattern center.

Parameters:
shape

(n_rows, n_cols) in pixels.

pattern_center

Pattern center (PCx, PCy, PCz) in the Bruker convention.

sample_tilt

Sample tilt in degrees (usually set from Microscope.sample_tilt).

tilt

Detector tilt in degrees.

azimuthal

Detector azimuthal angle in degrees.

twist

Detector twist about its normal, in degrees.

px_size

Effective screen pixel pitch in micrometers, including binning (not camera sensor pitch). Used for physical dimensions in the inspector; pattern projection itself only depends on the normalized PC.

Methods

direction_cosines

Unit direction vectors (n_rows * n_cols, 3) in the sample frame.

show

Interactive screen placement and PC editor, also exportable to HTML.

Attributes

aspect_ratio

azimuthal

corners_sample_mm

Top-left clockwise corners relative to the beam impact, in mm.

gnomonic_bounds

Detector bounds [x_min, x_max, y_min, y_max] in gnomonic coordinates.

ncols

nrows

pattern_center

pattern_center_sample_mm

Perpendicular foot from impact to screen, in sample coordinates.

px_size

sample_tilt

shape

size

tilt

twist

property corners_sample_mm#

Top-left clockwise corners relative to the beam impact, in mm.

Uses the same Bruker PC and frame transform as direction_cosines. Physical distances assume px_size is the effective screen pixel pitch (including binning), not the camera sensor’s pixel pitch.

direction_cosines(device=None, dtype=torch.float32)[source]#

Unit direction vectors (n_rows * n_cols, 3) in the sample frame.

Row-major over the detector (row 0 = top). Port of kikuchipy _get_direction_cosines_for_fixed_pc.

property gnomonic_bounds#

Detector bounds [x_min, x_max, y_min, y_max] in gnomonic coordinates.

property pattern_center_sample_mm#

Perpendicular foot from impact to screen, in sample coordinates.

show(microscope=None, crystal=None)[source]#

Interactive screen placement and PC editor, also exportable to HTML.

If a microscope is supplied, its sample tilt and azimuth must match. Edits are a separate snapshot; read them with widget.to_detector().