def nickel_ebsd_simulation_generator( nickel_phase, detector, nickel_rotations, r_tsl2bruker, ): """Generator for EBSD simulations of Kikuchi bands for the Nickel data set referenced above. """ return EBSDSimulationGenerator( detector=detector, phase=nickel_phase, rotations=nickel_rotations * r_tsl2bruker, )
def test_set_rotations( self, nickel_phase, detector, nickel_rotations, shape_in, shape_change, ndim_in, ndim_change, ): """Setting rotations updates detector PC navigation shape.""" r_nickel = nickel_rotations.reshape(*shape_in) simgen = EBSDSimulationGenerator(detector=detector, phase=nickel_phase, rotations=r_nickel) assert simgen.navigation_shape == shape_in assert simgen.detector.navigation_shape == shape_in assert simgen.navigation_dimension == ndim_in simgen.navigation_shape = shape_change assert simgen.navigation_shape == shape_change assert simgen.detector.navigation_shape == shape_change assert simgen.navigation_dimension == ndim_change
def test_align_navigation_shape( self, nickel_phase, detector, nickel_rotations, nav_shape ): """Initialization of a detector with orientations of a certain shape also reshapes the varying PCs, i.e. the detector navigation shape, if the detector has more than one PC. """ assert detector.navigation_shape == (1,) o_nickel = nickel_rotations.reshape(*nav_shape) assert o_nickel.shape == nav_shape simgen = EBSDSimulationGenerator( detector=detector, phase=nickel_phase, rotations=o_nickel ) assert simgen.detector.navigation_shape == simgen.rotations.shape