pyemaps 2.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pyemaps/COPYING +798 -0
- pyemaps/CifFile/CifFile_module.py +3117 -0
- pyemaps/CifFile/StarFile.py +2496 -0
- pyemaps/CifFile/TypeContentsParser.py +82 -0
- pyemaps/CifFile/YappsStarParser_1_0.py +289 -0
- pyemaps/CifFile/YappsStarParser_1_1.py +288 -0
- pyemaps/CifFile/YappsStarParser_2_0.py +369 -0
- pyemaps/CifFile/YappsStarParser_STAR2.py +382 -0
- pyemaps/CifFile/__init__.py +7 -0
- pyemaps/CifFile/drel/__init__.py +1 -0
- pyemaps/CifFile/drel/drel_ast_yacc.py +582 -0
- pyemaps/CifFile/drel/drel_lex.py +228 -0
- pyemaps/CifFile/drel/drel_runtime.py +126 -0
- pyemaps/CifFile/drel/parsetab.py +185 -0
- pyemaps/CifFile/drel/py_from_ast.py +628 -0
- pyemaps/CifFile/parsetab.py +185 -0
- pyemaps/CifFile/yapps3_compiled_rt.py +390 -0
- pyemaps/README.md +201 -0
- pyemaps/__config__.py +91 -0
- pyemaps/__init__.py +233 -0
- pyemaps/__main__.py +219 -0
- pyemaps/__version__.py +1 -0
- pyemaps/cdata/Aluminium.xtl +4 -0
- pyemaps/cdata/AluminiumOxide.xtl +5 -0
- pyemaps/cdata/Aluminium_FCC.xtl +4 -0
- pyemaps/cdata/BariumTitanate_180k.xtl +6 -0
- pyemaps/cdata/BariumTitanate_270k.xtl +7 -0
- pyemaps/cdata/BariumTitanate_Tetra.xtl +7 -0
- pyemaps/cdata/BiMnO3.xtl +27 -0
- pyemaps/cdata/Boron_Tetra.xtl +8 -0
- pyemaps/cdata/CadmiumSelenide_Hex.xtl +5 -0
- pyemaps/cdata/CadmiumSulfide_Cubic.xtl +5 -0
- pyemaps/cdata/CadmiumSulfide_Hex.xtl +5 -0
- pyemaps/cdata/Chromium_BCC.xtl +4 -0
- pyemaps/cdata/CoSb3_Skutterudite.xtl +5 -0
- pyemaps/cdata/CopperOxide.xtl +5 -0
- pyemaps/cdata/Copper_FCC.xtl +4 -0
- pyemaps/cdata/Cu2O_Cuprite.xtl +5 -0
- pyemaps/cdata/Diamond.xtl +4 -0
- pyemaps/cdata/ErbiumPyrogermanate.xtl +9 -0
- pyemaps/cdata/FePd_Tetra.xtl +5 -0
- pyemaps/cdata/FeS2_Pyrite.xtl +15 -0
- pyemaps/cdata/GalliumAntimonide.xtl +5 -0
- pyemaps/cdata/GalliumArsenide.xtl +5 -0
- pyemaps/cdata/GalliumNitride.xtl +5 -0
- pyemaps/cdata/Germanium.xtl +4 -0
- pyemaps/cdata/Gold_FCC.xtl +4 -0
- pyemaps/cdata/IndiumArsenide.xtl +5 -0
- pyemaps/cdata/LaMnO3.xtl +7 -0
- pyemaps/cdata/LeadZirconateTitanate.xtl +8 -0
- pyemaps/cdata/Li2MnO3.xtl +13 -0
- pyemaps/cdata/NaFeO2.xtl +6 -0
- pyemaps/cdata/Nb3Sn.xtl +5 -0
- pyemaps/cdata/Pentacene.xtl +39 -0
- pyemaps/cdata/Silicon.xtl +4 -0
- pyemaps/cdata/StrontiumTitanate.xtl +6 -0
- pyemaps/cdata/TelluriumDioxide.xtl +5 -0
- pyemaps/cdata/TinDioxide_RT.xtl +5 -0
- pyemaps/cdata/TitaniumDioxide_Anatase.xtl +5 -0
- pyemaps/cdata/TitaniumDioxide_Rutile.xtl +5 -0
- pyemaps/cdata/TungstenDiselenide.xtl +5 -0
- pyemaps/cdata/VanadiumDioxide_RT.xtl +6 -0
- pyemaps/cdata/ZincOxide.xtl +5 -0
- pyemaps/cdata/Zinc_HCP.xtl +4 -0
- pyemaps/cdata/ZirconiumNitride.xtl +5 -0
- pyemaps/cdata/limno2.xtl +6 -0
- pyemaps/crystals.py +1415 -0
- pyemaps/ddiffs.py +147 -0
- pyemaps/diffract/__init__.py +70 -0
- pyemaps/diffract/bloch_dec.py +779 -0
- pyemaps/diffract/csf_dec.py +242 -0
- pyemaps/diffract/dif_dec.py +519 -0
- pyemaps/diffract/dpgen_dec.py +175 -0
- pyemaps/diffract/mxtal_dec.py +201 -0
- pyemaps/diffract/powder_dec.py +137 -0
- pyemaps/diffract/stereo_dec.py +111 -0
- pyemaps/display.py +791 -0
- pyemaps/emcontrols.py +1017 -0
- pyemaps/errors.py +266 -0
- pyemaps/fileutils.py +1001 -0
- pyemaps/kdiffs.py +1221 -0
- pyemaps/license.txt +42 -0
- pyemaps/samples/adf.py +137 -0
- pyemaps/samples/al.img +0 -0
- pyemaps/samples/al_dpgen.py +57 -0
- pyemaps/samples/al_ediom.py +94 -0
- pyemaps/samples/convert_image.py +88 -0
- pyemaps/samples/dm_diff.py +225 -0
- pyemaps/samples/mask.im3 +0 -0
- pyemaps/samples/powder.py +51 -0
- pyemaps/samples/raw.img +0 -0
- pyemaps/samples/si_bloch.py +120 -0
- pyemaps/samples/si_constructor.py +51 -0
- pyemaps/samples/si_csf.py +59 -0
- pyemaps/samples/si_dif.py +134 -0
- pyemaps/samples/si_lacbed.py +59 -0
- pyemaps/samples/si_pyemaps.py +80 -0
- pyemaps/samples/si_scm.py +156 -0
- pyemaps/samples/si_stereo.py +116 -0
- pyemaps/scattering/__init__.py +26 -0
- pyemaps/scattering/sct_dec.py +31 -0
- pyemaps/spg/__init__.py +25 -0
- pyemaps/spg/spg_dec.py +60 -0
- pyemaps/stackimg.py +1031 -0
- pyemaps/xtal.py +222 -0
- pyemaps-2.0.0.dist-info/METADATA +231 -0
- pyemaps-2.0.0.dist-info/RECORD +112 -0
- pyemaps-2.0.0.dist-info/WHEEL +5 -0
- pyemaps-2.0.0.dist-info/entry_points.txt +2 -0
- pyemaps-2.0.0.dist-info/licenses/COPYING +798 -0
- pyemaps-2.0.0.dist-info/licenses/license.txt +42 -0
- pyemaps-2.0.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
|
|
2
|
+
"""
|
|
3
|
+
This file is part of pyemaps
|
|
4
|
+
___________________________
|
|
5
|
+
|
|
6
|
+
pyemaps is free software. You can redistribute it and/or modify
|
|
7
|
+
it under the terms of the GNU General Public License as published
|
|
8
|
+
by the Free Software Foundation, either version 3 of the License,
|
|
9
|
+
or (at your option) any later version.
|
|
10
|
+
|
|
11
|
+
pyemaps is distributed in the hope that it will be useful,
|
|
12
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
+
GNU General Public License for more details.
|
|
15
|
+
|
|
16
|
+
You should have received a copy of the GNU General Public License
|
|
17
|
+
along with pyemaps. If not, see <https://www.gnu.org/licenses/>.
|
|
18
|
+
|
|
19
|
+
Contact supprort@emlabsoftware.com for any questions and comments.
|
|
20
|
+
___________________________
|
|
21
|
+
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Author: EMLab Solutions, Inc.
|
|
25
|
+
Date: September 26th, 2022
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
import concurrent.futures
|
|
29
|
+
from re import S
|
|
30
|
+
from pyemaps import EMC, DPError,EMCError
|
|
31
|
+
|
|
32
|
+
MAX_PROCWORKERS = 4
|
|
33
|
+
|
|
34
|
+
def getStereo(cn, emc = EMC(), ckey='tilt'):
|
|
35
|
+
from pyemaps import Crystal as cr
|
|
36
|
+
|
|
37
|
+
if cn is None:
|
|
38
|
+
return None
|
|
39
|
+
|
|
40
|
+
cc = cr.from_builtin(cn)
|
|
41
|
+
|
|
42
|
+
if ckey is None:
|
|
43
|
+
stereo = cc.generateStereo()
|
|
44
|
+
return cn, emc, stereo
|
|
45
|
+
|
|
46
|
+
if ckey == 'tilt':
|
|
47
|
+
stereo = cc.generateStereo(tilt = emc.tilt)
|
|
48
|
+
return cn, emc, stereo
|
|
49
|
+
elif (ckey == 'zone'):
|
|
50
|
+
stereo = cc.generateStereo(zone = emc.zone)
|
|
51
|
+
return cn, emc, stereo
|
|
52
|
+
else:
|
|
53
|
+
return None
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def generate_stereo(name = 'Silicon', ckey = 'tilt'):
|
|
57
|
+
'''
|
|
58
|
+
This routine demonstrate how to use pyemaps stereo module
|
|
59
|
+
to generate stereodiagram
|
|
60
|
+
|
|
61
|
+
: name: crystal name from builtin database
|
|
62
|
+
: ckey: emcontrol key name to change
|
|
63
|
+
|
|
64
|
+
'''
|
|
65
|
+
|
|
66
|
+
emclist = []
|
|
67
|
+
for i in range(-3,3):
|
|
68
|
+
|
|
69
|
+
if ckey == 'tilt':
|
|
70
|
+
emclist.append(EMC(tilt=(i*0.5, 0.0)))
|
|
71
|
+
|
|
72
|
+
if ckey == 'zone':
|
|
73
|
+
emclist.append(EMC(zone=(i,-i,1)))
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
fs = []
|
|
77
|
+
slist=[]
|
|
78
|
+
with concurrent.futures.ProcessPoolExecutor(max_workers=MAX_PROCWORKERS) as e:
|
|
79
|
+
|
|
80
|
+
for ec in emclist:
|
|
81
|
+
fs.append(e.submit(getStereo, cn = name, emc = ec, ckey = ckey))
|
|
82
|
+
|
|
83
|
+
for f in concurrent.futures.as_completed(fs):
|
|
84
|
+
try:
|
|
85
|
+
_, emc, stereo = f.result()
|
|
86
|
+
except Exception as e:
|
|
87
|
+
print('failed to generate stereodiagram with ' + str(e))
|
|
88
|
+
exit(1)
|
|
89
|
+
else:
|
|
90
|
+
slist.append((emc, stereo))
|
|
91
|
+
|
|
92
|
+
# sorting the list by controls
|
|
93
|
+
slist.sort(key=lambda x: x[0])
|
|
94
|
+
|
|
95
|
+
return slist
|
|
96
|
+
def main():
|
|
97
|
+
from pyemaps import showStereo
|
|
98
|
+
|
|
99
|
+
# display in table format
|
|
100
|
+
stereoList = generate_stereo(ckey='tilt')
|
|
101
|
+
showStereo(stereoList,
|
|
102
|
+
name='Silicon',
|
|
103
|
+
layout='table',
|
|
104
|
+
iShow=True,
|
|
105
|
+
bClose=True,
|
|
106
|
+
zLimit = 1)
|
|
107
|
+
|
|
108
|
+
# display in individual syereodiagram
|
|
109
|
+
stereoList = generate_stereo(ckey='zone')
|
|
110
|
+
showStereo(stereoList,
|
|
111
|
+
name='Silicon',
|
|
112
|
+
iShow=True,
|
|
113
|
+
bClose=True,
|
|
114
|
+
zLimit = 1)
|
|
115
|
+
if __name__ == '__main__':
|
|
116
|
+
main()
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
'''
|
|
2
|
+
.. This file is part of pyEMAPS
|
|
3
|
+
|
|
4
|
+
.. ----
|
|
5
|
+
|
|
6
|
+
.. pyEMAPS is free software. You can redistribute it and/or modify
|
|
7
|
+
.. it under the terms of the GNU General Public License as published
|
|
8
|
+
.. by the Free Software Foundation, either version 3 of the License,
|
|
9
|
+
.. or (at your option) any later version..
|
|
10
|
+
|
|
11
|
+
.. pyEMAPS is distributed in the hope that it will be useful,
|
|
12
|
+
.. but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
+
.. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
+
.. GNU General Public License for more details.
|
|
15
|
+
|
|
16
|
+
.. You should have received a copy of the GNU General Public License
|
|
17
|
+
.. along with pyEMAPS. If not, see `<https://www.gnu.org/licenses/>`_.
|
|
18
|
+
|
|
19
|
+
.. Contact supprort@emlabsoftware.com for any questions and comments.
|
|
20
|
+
|
|
21
|
+
.. ----
|
|
22
|
+
|
|
23
|
+
'''
|
|
24
|
+
|
|
25
|
+
# root directory for all emaps modules
|
|
26
|
+
from emaps import sct
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
'''
|
|
2
|
+
.. This file is part of pyEMAPS
|
|
3
|
+
|
|
4
|
+
.. ----
|
|
5
|
+
|
|
6
|
+
.. pyEMAPS is free software. You can redistribute it and/or modify
|
|
7
|
+
.. it under the terms of the GNU General Public License as published
|
|
8
|
+
.. by the Free Software Foundation, either version 3 of the License,
|
|
9
|
+
.. or (at your option) any later version..
|
|
10
|
+
|
|
11
|
+
.. pyEMAPS is distributed in the hope that it will be useful,
|
|
12
|
+
.. but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
+
.. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
+
.. GNU General Public License for more details.
|
|
15
|
+
|
|
16
|
+
.. You should have received a copy of the GNU General Public License
|
|
17
|
+
.. along with pyEMAPS. If not, see `<https://www.gnu.org/licenses/>`_.
|
|
18
|
+
|
|
19
|
+
.. Contact supprort@emlabsoftware.com for any questions and comments.
|
|
20
|
+
|
|
21
|
+
.. ----
|
|
22
|
+
|
|
23
|
+
.. Author: EMLab Solutions, Inc.
|
|
24
|
+
.. Date Created: May 07, 2022
|
|
25
|
+
|
|
26
|
+
'''
|
|
27
|
+
import re
|
|
28
|
+
from . import sct
|
|
29
|
+
sct_symbtable = re.split(r'\s+', sct.elnams.tobytes().decode().strip())
|
|
30
|
+
sct_cifsymbtable = re.split(r'\s+', sct.cifelnams.tobytes().decode().strip())
|
|
31
|
+
|
pyemaps/spg/__init__.py
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
'''
|
|
2
|
+
.. This file is part of pyEMAPS
|
|
3
|
+
|
|
4
|
+
.. ----
|
|
5
|
+
|
|
6
|
+
.. pyEMAPS is free software. You can redistribute it and/or modify
|
|
7
|
+
.. it under the terms of the GNU General Public License as published
|
|
8
|
+
.. by the Free Software Foundation, either version 3 of the License,
|
|
9
|
+
.. or (at your option) any later version..
|
|
10
|
+
|
|
11
|
+
.. pyEMAPS is distributed in the hope that it will be useful,
|
|
12
|
+
.. but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
+
.. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
+
.. GNU General Public License for more details.
|
|
15
|
+
|
|
16
|
+
.. You should have received a copy of the GNU General Public License
|
|
17
|
+
.. along with pyEMAPS. If not, see `<https://www.gnu.org/licenses/>`_.
|
|
18
|
+
|
|
19
|
+
.. Contact supprort@emlabsoftware.com for any questions and comments.
|
|
20
|
+
|
|
21
|
+
.. ----
|
|
22
|
+
|
|
23
|
+
'''
|
|
24
|
+
|
|
25
|
+
from emaps import spgseek
|
pyemaps/spg/spg_dec.py
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
'''
|
|
2
|
+
.. This file is part of pyEMAPS
|
|
3
|
+
|
|
4
|
+
.. ----
|
|
5
|
+
|
|
6
|
+
.. pyEMAPS is free software. You can redistribute it and/or modify
|
|
7
|
+
.. it under the terms of the GNU General Public License as published
|
|
8
|
+
.. by the Free Software Foundation, either version 3 of the License,
|
|
9
|
+
.. or (at your option) any later version..
|
|
10
|
+
|
|
11
|
+
.. pyEMAPS is distributed in the hope that it will be useful,
|
|
12
|
+
.. but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
+
.. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
+
.. GNU General Public License for more details.
|
|
15
|
+
|
|
16
|
+
.. You should have received a copy of the GNU General Public License
|
|
17
|
+
.. along with pyEMAPS. If not, see `<https://www.gnu.org/licenses/>`_.
|
|
18
|
+
|
|
19
|
+
.. Contact supprort@emlabsoftware.com for any questions and comments.
|
|
20
|
+
|
|
21
|
+
.. ----
|
|
22
|
+
|
|
23
|
+
.. Author: EMLab Solutions, Inc.
|
|
24
|
+
.. Date Created: May 07, 2022
|
|
25
|
+
|
|
26
|
+
'''
|
|
27
|
+
from . import spgseek as spgra
|
|
28
|
+
|
|
29
|
+
SPG_SYMMETRY_MAXCOL = spgra.getsymmetrymaxlen() #48
|
|
30
|
+
|
|
31
|
+
SPG_SETTING_MAX = spgra.getspgallsettingmax() #6
|
|
32
|
+
|
|
33
|
+
SPG_SYMMETRY_MAXLEN = spgra.getsymmetryitemlen() #20
|
|
34
|
+
|
|
35
|
+
SPG_ITNUM_MAX = spgra.getspgitnum() #234
|
|
36
|
+
|
|
37
|
+
SPG_ENTRY_MAX = spgra.getspgentrynum() #310
|
|
38
|
+
|
|
39
|
+
def get_settingmax(num):
|
|
40
|
+
return spgra.getspgsettingmax(num)
|
|
41
|
+
|
|
42
|
+
def get_settingmax(num):
|
|
43
|
+
return spgra.getspgsettingmax(num)
|
|
44
|
+
|
|
45
|
+
def lookuphm(inum):
|
|
46
|
+
return(spgra.getspghm(inum))
|
|
47
|
+
|
|
48
|
+
def getsymmetryxyz(sp, coords):
|
|
49
|
+
return spgra.getsymmetryxyz(sp[0], sp[1], coords)
|
|
50
|
+
|
|
51
|
+
def validateSPG(num, iset):
|
|
52
|
+
if num < 1 or num > SPG_ITNUM_MAX:
|
|
53
|
+
return False
|
|
54
|
+
|
|
55
|
+
setting_max = get_settingmax(num)
|
|
56
|
+
|
|
57
|
+
if iset <1 or iset > setting_max:
|
|
58
|
+
return False
|
|
59
|
+
|
|
60
|
+
return True
|