Hkl channel5 reader
Description of the change
Plugin to read crystal map from HKL Channel5 ctf file
Progress of the PR
- [ ] Docstrings for all functions
- [ ] Unit tests with pytest for all lines
- [ ] Clean code style by running black via pre-commit
Minimal example of the bug fix or new feature
>>> from orix.io import load
>>> xmap = load('hklch5.ctf')
>>>
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__inorix/__init__.pyand in.zenodo.json.
I realized that ctf reader implementation is already in PR #451. Sorry for duplication...
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.
Hi @ondrolexa, we've finally merged the CTF reader in #451 into the develop branch. Can you try this out on your datasets?
Hi @ondrolexa, we've finally merged the CTF reader in #451 into the
developbranch. 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
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
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.
Anyway if I remember well, the error codes was adopted from ctfFile3.py file of the xcdskd project...
I'm going through old PR's and saw this post right after messing with the crystal_map tutorial.
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?
The file attached has the following information for that phase:
4.913;4.913;5.504 90.000;90.000;120.000 Quartz-new 7 152 Sands, 1969
which I think is correctly interpreted as SG P3121 and PG 32
Is this an error in how the file is read, or is it a more general oddity of PhaseList? I believe this is the same warning described in the Cyrstal_map tutorial (see input 20)
@ondrolexa, are you still interested in contributing changes to the existing CTF reader?
I think the existing CTF reader is OK, so this PR could be closed. I will add error codes in another PR. Btw. The generated warning seems to be generated by PhaseList despite the file is read correctly. As mentioned by @argerlt, it is the same warning described in the Crystal_map tutorial (see input 20). So, the SG could be set as
>>> xmap = io.load('SM3-3.ctf')
>>> xmap
>>> m
Phase Orientations Name Space group Point group Proper point group Color
-1 9920 (13.4%) not_indexed None None None w
1 62154 (83.8%) Quartz-new None -3m 32 tab:blue
2 2107 (2.8%) Muscovite None 2/m 112 tab:orange
Properties: bands, error, MAD, BC, BS
Scan unit: um
>>> xmap.phases["Quartz-new"].space_group = 152
>>> xmap
Phase Orientations Name Space group Point group Proper point group Color
-1 9920 (13.4%) not_indexed None None None w
1 62154 (83.8%) Quartz-new P3121 32 32 tab:blue
2 2107 (2.8%) Muscovite None 2/m 112 tab:orange
Properties: bands, error, MAD, BC, BS
Great, please do!
The file attached has the following information for that phase: 4.913;4.913;5.504 90.000;90.000;120.000 Quartz-new 7 152 Sands, 1969 which I think is correctly interpreted as SG P3121 and PG 32
Is this an error in how the file is read, or is it a more general oddity of PhaseList? I believe this is the same warning described in the Cyrstal_map tutorial (see input 20)
This is an error in the CTF file, not in our interpretation of it. The Laue class ID and space group number signifies different symmetries. So the warning raised is suitable for this file.
The file has Laue class ID 7, which corresponds to -3m according to our CTF reader (the index into our list is ID - 1):
https://github.com/pyxem/orix/blob/ce19a5248674194cad08b45fd77d68ff84305ba6/orix/io/plugins/ctf.py#L232-L244
MTEX' reader also uses this list: https://github.com/mtex-toolbox/mtex/blob/246b6c9c631e01689b625b4b69f8a3b8467380f5/interfaces/loadEBSD_ctf.m#L41-L43.
However, the space group is 152, which corresponds to point group 321. Not -3m.