pyxem / orix

Analysing crystal orientations and symmetry in Python
https://orix.readthedocs.io
GNU General Public License v3.0
81 stars 49 forks source link

Visualizing rotation lists in an inverse pole figure #122

Closed din14970 closed 2 years ago

din14970 commented 4 years ago

Not sure if this is the place to ask, but I would like to get a quick visual on the rotations generated by the functions in rotation_list_generators, as shown in pyxem/diffsims#103 . Is there already some kind of IPF plot function in diffsims/orix, or is this being considered? Right now, I feel like I've created a very crappy workaround by creating a fictitious ebsd map from the orientations, which I then import into MTEX:

rot_list_cubic = diffsims.generators.rotation_list_generators.get_fundamental_zone_grid(225, 10)
euler = np.array(rot_list_cubic)
ln = euler.shape[0]
phase_id = np.ones((ln, 1))
score_xy = np.vstack([np.ones(ln), range(ln), np.ones(ln)]).T
results_array = np.hstack([phase_id, euler, score_xy])
np.savetxt("rotlist.txt", results_array, delimiter="\t", newline="\r\n")

Also, do you have (or would you consider opening) a Gitter channel for pyxem/orix/diffsims? I feel like I have questions that are more discussion type, not really feature requests or bug reports.

pc494 commented 4 years ago

Hi @din14970,

This would be orix functionality, as you correctly suggest. It's currently an (the only) open PR to orix (https://github.com/pyxem/orix/pull/62) - I'm not sure exactly how far along we are with it, but it's top of the orix list. Fake MTEX EBSD maps is probably the best workaround for getting pole figures right now, although the syntax might be a bit simpler if you used orix directly for that.

In the short term, no, I/we aren't that keen on gitter channels as I think having "questions" as issues works pretty well. That may change as the packages grow though.

hakonanes commented 4 years ago

@din14970, thanks a lot for opening this issue, which helps raise the PF/IPF plotting on the agenda. My short answer though is that using MTEX is the only option at the moment... If you just want to import rotations/orientations in MTEX, I don't think you need the phase and auxiliary property columns, just the Euler angles: https://mtex-toolbox.github.io/OrientationImport.html.

One alternative option, @pc494, we should be able to plot within the fundamental zone to visualize rotation sampling? As in https://nbviewer.jupyter.org/github/pyxem/orix-demos/blob/master/02%20-%20Clustering%20Orientations.ipynb#vis. I haven't used that myself, though, so I cannot say.

As @pc494, I'm not keen on Gitter, because I think discussing something in a GitHub issue makes it easier to follow and keep track of, thus hopefully shortening the time from an idea to a PR.

din14970 commented 4 years ago

Alright, yes I figured orix is still very new so the option might not be there, but I thought I'd ask. I hope there will be a day where I can ditch Matlab altogether.

Maybe now your userbase is still small so I can see your perspective on gitter. But I see a lot of growth potential for these tools. At some point you will get users asking the same questions over and over again (which I try to avoid but it happens), and then I think you may want to de-clutter your issues and relegate "tech support" discussions to elsewhere.

din14970 commented 4 years ago

If you just want to import rotations/orientations in MTEX, I don't think you need the phase and auxiliary property columns, just the Euler angles: https://mtex-toolbox.github.io/OrientationImport.html.

Also thanks for this tip, I figured it would be easiest to follow thesave_mtex_map function, but euler angles are indeed sufficient.

pc494 commented 4 years ago

I agree with everything that's been said here. I'll leave this issue open until the feature is added.

hakonanes commented 3 years ago

Inverse pole figure plotting can be implemented as an extension of the StereographicPlot. This is something I think shouldn't be too difficult, and will work towards implementing myself, by trying to utilize similar functionality as is done for Matplotlib's polar projection. My goal is to be able to define a triangle spine with three vectors, and plot only vectors inside this triangle.

hakonanes commented 3 years ago

I anticipate that this can be closed after a follow-up PR to #232.

hakonanes commented 3 years ago

The follow-up PR is #235.