pyxem / orix

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

Hkl channel5 reader #465

Open ondrolexa opened 7 months ago

ondrolexa commented 7 months ago

Description of the change

Plugin to read crystal map from HKL Channel5 ctf file

Progress of the PR

Minimal example of the bug fix or new feature

>>> from orix.io import load
>>> xmap = load('hklch5.ctf')
>>> 

For reviewers

ondrolexa commented 7 months ago

I realized that ctf reader implementation is already in PR #451. Sorry for duplication...

hakonanes commented 7 months ago

Hi Ondrej! Thank you for making this PR. It might be that your work here can improve the already opened PR by @IMBalence. I'll have a look. Let's keep it open for now.

hakonanes commented 1 month ago

Hi @ondrolexa, we've finally merged the CTF reader in #451 into the develop branch. Can you try this out on your datasets?

ondrolexa commented 1 month ago

Hi @ondrolexa, we've finally merged the CTF reader in #451 into the develop branch. Can you try this out on your datasets?

It seems to read my ctf files without problem...

>>> xmap = io.load("orix-tests/EBSD-Ondro/SM3-3.ctf")
/home/ondro/develrepo/orix/orix/crystal_map/phase_list.py:250: UserWarning: Setting space group to 'None', as current space group 'P3121' is derived from current point group '32'.
  warnings.warn(
>>> xmap
Phase     Orientations         Name  Space group  Point group  Proper point group       Color
   -1     33747 (6.6%)  not_indexed         None         None                None           w
    1   456027 (88.6%)   Quartz-new         None          -3m                  32    tab:blue
    2     24794 (4.8%)    Muscovite         None          2/m                 112  tab:orange
Properties: bands, error, MAD, BC, BS
Scan unit: um
hakonanes commented 1 month ago

It seems to read my ctf files without problem...

Great! But, we should avoid that warning. There seems to be some inconsistency in how we set the symmetry from your file. Do you mind sharing the file? Or even better, if you find the reason why, could you a PR to silence the warning?

Also, I see you have listed the CTF error codes in this PR. They would be very nice to have in the CTF reader we just merged. Could you open a new PR and add them to the Notes section in the file_reader() function in the CTF reader, with a brief description and a source (manual or similar)?

https://github.com/pyxem/orix/blob/006e85df106e35d7fe5fdc99393b0ea65d7cb634/orix/io/plugins/ctf.py#L70-L77

ondrolexa commented 1 month ago

Here is a zipped ctf file producing the warning SM3-3.zip. Later I can make a PR to update Notes section of file_reader() function.

ondrolexa commented 1 month ago

Anyway if I remember well, the error codes was adopted from ctfFile3.py file of the xcdskd project...