pyxem / orix

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

(Inverse) pole figure convenience method(s) #265

Open hakonanes opened 2 years ago

hakonanes commented 2 years ago

We should have some convenience methods for plotting pole figures (PFs) and inverse pole figures (IPFs). The following are on my todo-list, but any help is appreciated if people find the time.

IPF

At the moment, IPFs are plotted via Orientation.scatter("ipf", direction=Vector3d((0, 0, 1))) or via orix.plot.InversePoleFigurePlot.scatter(), which accepts Vector3d (of which Miller is a subclass), seen in this user guide. Should we add "ipf" as an option to Miller? I think so.

PF

At the moment, we don't have any "official" pole figure plotting, however, almost all the functionality is there. The current stereographic plots are pole figures when fed sample directions r parallel to some crystal direction h, given by r = ~ori * h. We need to support outer multiplication of Orientation with Vector3d to enable multiplication of multiple orientations with a symmetrised Miller family, say <111> in a cubic crystal. I think we should add an Orientation.scatter("pf", direction=Miller) option as well.

harripj commented 2 years ago

At the moment, IPFs are plotted via Orientation.scatter("ipf", direction=Vector3d((0, 0, 1))) or via orix.plot.InversePoleFigurePlot.scatter(), which accepts Vector3d (of which Miller is a subclass), seen in this user guide. Should we add "ipf" as an option to Miller? I think so.

I think that this may be confusing. For IPF the sample axes are shown in the crystal reference frame, and whilst Miller is just a subclass of Vector3d in orix, my understanding is that Miller should be reserved for crystal directions? Perhaps there is an interpretation I am missing?

By the same logic Miller should definitely be included for PF.

hakonanes commented 2 years ago

I think that this may be confusing. For IPF the sample axes are shown in the crystal reference frame, and whilst Miller is just a subclass of Vector3d in orix, my understanding is that Miller should be reserved for crystal directions? Perhaps there is an interpretation I am missing?

Good point, we shouldn't call it "ipf". But we should definitely add a possibility to plot crystal directions by themselves within the fundamental sector. I'm not sure what to call it though. Miller.scatter("fundamental_sector") is in line with MTEX' plot(Miller, 'fundamentalRegion') seen in their docs. "sector" might be too short.

By the same logic Miller should definitely be included for PF.

Yes, and I think we shouldn't duplicate the direction parameter in this case, but it must be a single Miller instance (symmetrised internally) or multiple which then plots multiple PFs.

hakonanes commented 2 years ago

See https://github.com/pyxem/orix/pull/340#issuecomment-1131675465.