Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stereographic Projection in Fast Template Matching Tutorial #225

Open
SangPham1408 opened this issue Sep 26, 2024 · 0 comments
Open

Stereographic Projection in Fast Template Matching Tutorial #225

SangPham1408 opened this issue Sep 26, 2024 · 0 comments

Comments

@SangPham1408
Copy link

SangPham1408 commented Sep 26, 2024

Describe the bug
Hello everyone, I am currently following the Fast Template Matching scripts (https://pyxem.readthedocs.io/en/v0.19.1/tutorials/pyxem-demos/11%20Accelerated%20orientation%20mapping%20with%20template%20matching.html) to map the crystal orientation in my samples. I followed the instruction in the tutorial and what I found a bit confusing is in the get_beam_directions_grid() for stereographic projection mesh grids. I am having a problem when setting crystal_systems = 'monoclinic' which produces the stereographic projection mesh grid that is not as stereographic triangle as expected (see attached file). I checked the source code and it seems to me like the source code for get_beam_directions_grid() should perform the crop to stereographic triangle for different crystal systems (?) (#crop to stereographic triangle which depends on crystal system). Further check with different crystal systems also shows the same for triclinic, trigonal, and orthorhombic (eee attached). I am new in crystal orientation mapping so I am not sure if these types of stenographic projection mesh presentation are common for these crystal systems.

Picture1

The reason why I am asking is because I am having error in the following step when trying to plot the results after doing template matching on the stereographic projection:

image

What I found was the script for stereographic projection (below) reshapes the size of x and y to not match with the number of simulated patterns when I selected the crystal_system = 'monoclinic'. For reference, the number of simulated patterns was 1497 after performing grid_mono = get_beam_directions_grid("monoclinic", resolution=4.3, mesh="spherified_cube_edge") while the shape of x and y after the stereographic projection (below) was 771. Is there any specific reasons for such a change in shape as it does occur for trigonal, triclinic, and orthorhombic as well. Many thanks!

def grid_to_xy(grid):
    from orix.quaternion.rotation import Rotation
    from orix.vector.vector3d import Vector3d
    from orix.projections import StereographicProjection
    s = StereographicProjection(pole=-1)
    rotations_regular =  Rotation.from_euler(np.deg2rad(grid))
    rot_reg_test = rotations_regular*Vector3d.zvector()
    x, y = s.vector2xy(rot_reg_test)
    return x, y
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant