Skip to content

calculating the mean of an orientation with respect to symmetry#669

Open
argerlt wants to merge 23 commits into
pyxem:developfrom
argerlt:symmetry_respecting_mean
Open

calculating the mean of an orientation with respect to symmetry#669
argerlt wants to merge 23 commits into
pyxem:developfrom
argerlt:symmetry_respecting_mean

Conversation

@argerlt

@argerlt argerlt commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

Description of the change

Currently a draft, but this would be an up-to-date solution to #434 and #437
EDIT: complete, ready for review. Description below also updated for clarity.

As originally discussed, mean is calculated for transforms with symmetry using a variation of the 'flip-flop' method:

1) reduce everything with respect to symmetry.
2) find a rough mean (allow weighted averages if desired)
3) convert (mis)orientations to the point closest to the rough mean
4) recalculate the mean, again with weighted averages if desired.

In the process of this simple fix, it turned out ORIX had some inconsistent handling of fundamental zones and reduction. This update makes it match exactly with the original paper previously mentioned as the souce for OrientationRegion.from_symmetry.

Other things fixed along the way:

  1. added some unit tests for uncovered lines
  2. fixed the error with Orientation.dot_outer discussed in Orientation.dot_outer() scambles axis ordering and can give the wrong answer #673
  3. Added a lot of clarifying language
  4. Detangled the previous logic in orientation_region.get_point_groups and added the logical extension discussed in the above paper.
  5. fixed the loss of proper/improper discussed in Misorientation.reduce() tosses proper/improper information #670

Progress of the PR

For reviewers

  • The PR title is short, concise, and will make sense 1 year later.
  • New functions are imported in corresponding __init__.py.
  • New features, API changes, and deprecations are mentioned in the unreleased
    section in CHANGELOG.rst.
  • Contributor(s) are listed correctly in __credits__ in orix/__init__.py and in
    .zenodo.json.

@hakonanes hakonanes added the enhancement New feature or request label Jun 18, 2026
@hakonanes

Copy link
Copy Markdown
Member

This is good, it's the same approach as taken in MTEX (I believe some call it the "flip-flop" algorithm).

@argerlt
argerlt force-pushed the symmetry_respecting_mean branch from 50ba623 to 07856cc Compare June 26, 2026 02:54
@argerlt

argerlt commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator Author

pre-commit.ci autofix

@argerlt

argerlt commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator Author

Almost done, but the new failing test is a real error and I need to run some tests to see if #671 is the correct solution.

@argerlt
argerlt marked this pull request as draft July 1, 2026 01:03
@argerlt

argerlt commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator Author

@hakonanes, if you get a chance, check out this updated docstring for Misorientation.reduce().

Nevermind, heavily edited.

@argerlt
argerlt force-pushed the symmetry_respecting_mean branch from a948f8e to d4f7129 Compare July 2, 2026 22:43
@argerlt
argerlt force-pushed the symmetry_respecting_mean branch from 4c153ec to 181db7d Compare July 9, 2026 02:54
@argerlt
argerlt force-pushed the symmetry_respecting_mean branch from 896bb8c to a85ddda Compare July 15, 2026 01:08
@argerlt

argerlt commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator Author

pre-commit.ci autofix

@argerlt
argerlt marked this pull request as ready for review July 15, 2026 01:18
@argerlt
argerlt requested a review from hakonanes July 15, 2026 01:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

2 participants