Exemplo n.º 1
0
    def get_orientations_from_stereographic_triangle(self, inplane_rotations,
                                                     resolution):
        """
        Create a structure library from the stereographic triangles of the
        given crystal systems.

        Parameters
        ----------
        inplane_rotations : list
            List over identifiers of lists of inplane rotations of the
            diffraction patterns, in degrees.
        resolution : float
            Rotation list resolution in degrees.

        Returns
        -------
        structure_library : StructureLibrary
            Structure library for the given phase names, structures and crystal system.
        """
        rotation_lists = [
            rotation_list_stereographic(structure,
                                        *stereographic_corners[system],
                                        np.deg2rad(inplane_rotation),
                                        np.deg2rad(resolution))
            for phase_name, structure, system, inplane_rotation in zip(
                self.phase_names, self.structures, self.systems,
                inplane_rotations)
        ]
        return StructureLibrary(self.phase_names, self.structures,
                                rotation_lists)
Exemplo n.º 2
0
def test_rotation_list_stereographic_raises_invalid_corners(
        structure, corner_a, corner_b, corner_c, inplane_rotations, resolution,
        rotation_list):
    rotation_list_stereographic(structure, corner_a, corner_b, corner_c,
                                inplane_rotations, resolution)
Exemplo n.º 3
0
def test_rotation_list_stereographic(structure, corner_a, corner_b, corner_c,
                                     rotation_list):
    val = rotation_list_stereographic(structure, corner_a, corner_b, corner_c,
                                      [0], np.deg2rad(10))
    for expected in rotation_list:
        assert any((np.allclose(expected, actual) for actual in val))