Skip to content

When should we rotate our structures? #59

@pc494

Description

@pc494

Describe the bug
simulate_rotated_structure(), in theory, "rotates" a diffpy lattice. In practice ... it's not that simple.

To Reproduce

Make a boring orthorhombic lattice.
Make a second "rotated" lattice - the rotation here is a cut down version of what we do in simulate_rotated_structure()

canonical = diffpy.structure.lattice.Lattice(4,2,1, 90, 90, 90)
R = np.asarray([[1/np.sqrt(2),1/np.sqrt(2),0],[-1/np.sqrt(2),1/np.sqrt(2),0],[0,0,1]])
halfhalf  = diffpy.structure.lattice.Lattice(base=(R@canonical.base))

The problem is that the halfhalf lattice has two cell parameters of 3.162... ~ this makes life hard work.

Solution
Cut all the rotation code that involved diffpy, spit cartesians out of get_points_sphere() then
manually rotate the cartesians with a rotation matrix. I actually think this might be quite simple.
get_kinematical_intensities might also need a revisit

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature, request, or improvement

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions