directions_to_pixels#
- de_ebsd.index.backproject.directions_to_pixels(directions, detector, pattern_center=None)[source]#
Map sphere directions to fractional detector pixels (inverse of the DC map).
- Parameters:
- directions
Unit vectors
(M, 3)in the sample frame (need not be exactly normalized; the gnomonic ratios are scale-invariant).- detector
The
de_ebsd.simEBSDDetectorgeometry.- pattern_center
Optional pattern-center override
(3,)(pcx, pcy, pcz). When supplied withrequires_grad, the returned pixel coordinates are differentiable in the pattern center. Defaults todetector.pattern_center.
- Returns:
col,rowFractional pixel coordinates
(M,), where integer values land on pixel centers (col = 0is the leftmost column,row = 0the top row) – ready fortorch.nn.functional.grid_sample()withalign_corners=True.in_fovBoolean field-of-view mask
(M,):Truewhere the direction points at the detector (d_z > 0) and lands within the gnomonic bounds.