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

Loading .ang files using orix.io.load() can produce duplicate phase names #542

Open
gsparks3 opened this issue Jan 22, 2025 · 0 comments
Open

Comments

@gsparks3
Copy link

In _get_phases_from_header() under orix/io/plugins/ang.py, there is a section of code (permalink) that replaces the phase names loaded from the .ang file header with phase formulas (also loaded from said file header) if a formula exists for each phase. This does tend to reduce the verbosity of the automatically loaded phase names. However, it is possible for multiple distinct phases to have the same formula - in my case, alpha titanium and beta titanium both had a formula of "Ti". The automatic replacement causes multiple phases to have the same name when loading such a file using orix.io.load(), which breaks the ability to select data from individual phases in a CrystalMap by phase name.

Thankfully, the phases in the loaded CrystalMap are still distinct outside of the identical names, so the phase names can be manually overridden after loading, at which point everything works properly again. However, this seems like a sufficiently common situation that it should be addressed more directly, especially since the default phases in APEX (the most recent EDAX software for EBSD data acquisition) are "Generic FCC" and "Generic BCC", both with a formula of "Fe", on top of the issue with dual-phase Ti scans.

A few possible options:

  • Remove the name-replacement code entirely
  • Add a check so that the replacement is only done if each phase has a unique formula
  • Detect duplicates phase names and raise a warning so the user knows they need to manually override the duplicates
    (they will probably find out once their code breaks, but the warning will make the cause a little more obvious)
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