pyemaps 2.10.0__tar.gz → 2.11.0__tar.gz
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-2.10.0/pyemaps.egg-info → pyemaps-2.11.0}/PKG-INFO +32 -18
- {pyemaps-2.10.0 → pyemaps-2.11.0}/README.md +15 -8
- pyemaps-2.11.0/__version__.py +1 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/diffract/_resources.py +43 -9
- {pyemaps-2.10.0 → pyemaps-2.11.0}/diffract/bloch_dec.py +35 -14
- {pyemaps-2.10.0 → pyemaps-2.11.0}/diffract/dpgen_dec.py +5 -6
- {pyemaps-2.10.0 → pyemaps-2.11.0}/diffract/mxtal_dec.py +4 -1
- {pyemaps-2.10.0 → pyemaps-2.11.0}/errors.py +32 -5
- {pyemaps-2.10.0 → pyemaps-2.11.0}/notebooks/adf.ipynb +97 -91
- {pyemaps-2.10.0 → pyemaps-2.11.0}/notebooks/al_cu_phasemap.ipynb +61 -54
- {pyemaps-2.10.0 → pyemaps-2.11.0}/notebooks/al_ediom.ipynb +38 -38
- {pyemaps-2.10.0 → pyemaps-2.11.0}/notebooks/al_orientmap.ipynb +63 -84
- {pyemaps-2.10.0 → pyemaps-2.11.0}/notebooks/powder.ipynb +33 -33
- {pyemaps-2.10.0 → pyemaps-2.11.0}/notebooks/probe.ipynb +61 -61
- {pyemaps-2.10.0 → pyemaps-2.11.0}/notebooks/si_bloch.ipynb +54 -54
- {pyemaps-2.10.0 → pyemaps-2.11.0}/notebooks/si_constructor.ipynb +34 -34
- {pyemaps-2.10.0 → pyemaps-2.11.0}/notebooks/si_csf.ipynb +49 -49
- {pyemaps-2.10.0 → pyemaps-2.11.0}/notebooks/si_dif.ipynb +66 -66
- {pyemaps-2.10.0 → pyemaps-2.11.0}/notebooks/si_lacbed.ipynb +47 -53
- {pyemaps-2.10.0 → pyemaps-2.11.0}/notebooks/si_multislice.ipynb +38 -44
- {pyemaps-2.10.0 → pyemaps-2.11.0}/notebooks/si_scm.ipynb +53 -53
- {pyemaps-2.10.0 → pyemaps-2.11.0}/notebooks/si_stereo.ipynb +34 -34
- {pyemaps-2.10.0 → pyemaps-2.11.0}/probe.py +6 -6
- {pyemaps-2.10.0 → pyemaps-2.11.0/pyemaps.egg-info}/PKG-INFO +32 -18
- {pyemaps-2.10.0 → pyemaps-2.11.0}/pyemaps.egg-info/requires.txt +1 -1
- {pyemaps-2.10.0 → pyemaps-2.11.0}/setup.py +1 -1
- {pyemaps-2.10.0 → pyemaps-2.11.0}/stackimg.py +19 -33
- pyemaps-2.10.0/__version__.py +0 -1
- {pyemaps-2.10.0 → pyemaps-2.11.0}/COPYING +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/MANIFEST.in +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/__config__.py +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/__init__.py +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/__main__.py +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/cdata/Aluminium.xtl +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/cdata/AluminiumOxide.xtl +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/cdata/Aluminium_FCC.xtl +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/cdata/BariumTitanate_180k.xtl +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/cdata/BariumTitanate_270k.xtl +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/cdata/BariumTitanate_Tetra.xtl +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/cdata/BiMnO3.xtl +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/cdata/Boron_Tetra.xtl +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/cdata/CadmiumSelenide_Hex.xtl +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/cdata/CadmiumSulfide_Cubic.xtl +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/cdata/CadmiumSulfide_Hex.xtl +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/cdata/Chromium_BCC.xtl +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/cdata/CoSb3_Skutterudite.xtl +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/cdata/CopperOxide.xtl +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/cdata/Copper_FCC.xtl +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/cdata/Cu2O_Cuprite.xtl +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/cdata/Diamond.xtl +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/cdata/ErbiumPyrogermanate.xtl +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/cdata/FePd_Tetra.xtl +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/cdata/FeS2_Pyrite.xtl +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/cdata/GalliumAntimonide.xtl +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/cdata/GalliumArsenide.xtl +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/cdata/GalliumNitride.xtl +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/cdata/Germanium.xtl +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/cdata/Gold_FCC.xtl +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/cdata/IndiumArsenide.xtl +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/cdata/LaMnO3.xtl +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/cdata/LeadZirconateTitanate.xtl +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/cdata/Li2MnO3.xtl +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/cdata/NaFeO2.xtl +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/cdata/Nb3Sn.xtl +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/cdata/Pentacene.xtl +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/cdata/SiAlONa.xtl +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/cdata/Silicon.xtl +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/cdata/StrontiumTitanate.xtl +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/cdata/TelluriumDioxide.xtl +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/cdata/TinDioxide_RT.xtl +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/cdata/TitaniumDioxide_Anatase.xtl +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/cdata/TitaniumDioxide_Rutile.xtl +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/cdata/TungstenDiselenide.xtl +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/cdata/VanadiumDioxide_RT.xtl +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/cdata/ZincOxide.xtl +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/cdata/Zinc_HCP.xtl +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/cdata/ZirconiumNitride.xtl +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/cdata/limno2.xtl +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/cifreader.py +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/crystals.py +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/ddiffs.py +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/diffract/__init__.py +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/diffract/csf_dec.py +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/diffract/dif_dec.py +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/diffract/powder_dec.py +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/diffract/stereo_dec.py +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/display.py +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/dmreader.py +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/emcontrols.py +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/emdreader.py +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/expimage.py +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/fileutils.py +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/kdiffs.py +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/license-exception.txt +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/license.txt +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/mibreader.py +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/mrcreader.py +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/orientmap.py +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/phasemap.py +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/picreader.py +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/pyemaps.egg-info/SOURCES.txt +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/pyemaps.egg-info/dependency_links.txt +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/pyemaps.egg-info/entry_points.txt +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/pyemaps.egg-info/top_level.txt +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/pyproject.toml +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/readerbase.py +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/samples/Al_COD_4004108.cif +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/samples/Cu_COD_7101269.cif +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/samples/Si_COD_2102763.cif +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/samples/adf.py +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/samples/al.img +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/samples/al_cu_phasemap.py +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/samples/al_dpgen.py +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/samples/al_ediom.py +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/samples/al_orientmap.py +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/samples/convert_image.py +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/samples/crystal_imaging.py +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/samples/crystal_thickness.py +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/samples/ctf.py +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/samples/dm_diff.py +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/samples/hrem.py +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/samples/mask.im3 +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/samples/powder.py +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/samples/raw.img +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/samples/ronchigram.py +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/samples/si_bloch.py +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/samples/si_constructor.py +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/samples/si_csf.py +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/samples/si_dif.py +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/samples/si_lacbed.py +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/samples/si_pyemaps.py +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/samples/si_scm.py +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/samples/si_stereo.py +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/samples/stem_probe.py +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/scattering/__init__.py +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/scattering/sct_dec.py +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/setup.cfg +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/spg/__init__.py +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/spg/spg_dec.py +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/tiffreader.py +0 -0
- {pyemaps-2.10.0 → pyemaps-2.11.0}/xtal.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pyemaps
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.11.0
|
|
4
4
|
Summary: A Python Package for Transmission Electron Diffraction Simulations and Crystallographic Computing
|
|
5
5
|
Home-page: https://github.com/emlab-solutions/pyemaps
|
|
6
6
|
Author: EMLab Solutions, Inc.
|
|
@@ -24,7 +24,7 @@ Description-Content-Type: text/markdown
|
|
|
24
24
|
License-File: license-exception.txt
|
|
25
25
|
License-File: license.txt
|
|
26
26
|
License-File: COPYING
|
|
27
|
-
Requires-Dist: emaps>=2.
|
|
27
|
+
Requires-Dist: emaps>=2.8.0
|
|
28
28
|
Requires-Dist: numpy>=2.0
|
|
29
29
|
Requires-Dist: matplotlib>=3.8.4
|
|
30
30
|
Provides-Extra: emd
|
|
@@ -61,7 +61,8 @@ kinematical and dynamical electron diffraction described by J. C. H. Spence and
|
|
|
61
61
|
|
|
62
62
|
|
|
63
63
|
## Features
|
|
64
64
|
|
|
65
65
|
|
|
66
66
|
|
|
67
|
-
The
|
|
68
|
-
|
|
67
|
+
**The core features are free, with no license, no sign-up and no time limit**, under the GNU
|
|
68
|
+
|
|
69
|
+
General Public License v3.0:
|
|
70
|
+
|
|
69
71
|
|
|
70
72
|
|
|
71
73
|
- **Crystallography**
|
|
72
74
|
|
|
73
75
|
- Crystal construction, from your own data or the built-in crystal library
|
|
74
76
|
|
|
@@ -85,12 +86,17 @@ The base features are free, under the GNU General Public License v3.0:
|
|
|
85
86
|
- Contrast transfer functions, with their coherence envelopes
|
|
86
87
|
|
|
87
88
|
- HREM images of thin samples
|
|
88
89
|
|
|
89
90
|
|
|
90
91
|
|
|
91
|
-
The
|
|
92
|
-
|
|
92
|
+
**The advanced features need a license, and you can try them all free for 7 days** with
|
|
93
|
+
|
|
94
|
+
`pyemaps -l trial`:
|
|
95
|
+
|
|
93
96
|
|
|
94
97
|
|
|
95
|
-
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
-
|
|
102
|
-
|
|
98
|
+
- **4D-STEM analysis**: indexing experimental diffraction patterns, orientation and phase maps,
|
|
99
|
+
|
|
100
|
+
annular bright and dark field and masked images, and averaging, comparing, grouping and
|
|
101
|
+
|
|
102
|
+
transforming patterns
|
|
103
|
+
|
|
104
|
+
- **Diffraction pattern databases**: building and searching them
|
|
105
|
+
|
|
106
|
+
- **Multislice** simulations of thick crystals: exit waves and Ronchigrams
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
[Free and licensed features](https://emlab-solutions.github.io/pyemaps/free_and_licensed.html)
|
|
111
|
+
|
|
112
|
+
has the details.
|
|
113
|
+
|
|
103
114
|
|
|
104
115
|
|
|
105
116
|
Reading experimental patterns is free: TIFF, Gatan DigitalMicrograph (`.dm3`, `.dm4`), MRC,
|
|
106
117
|
|
|
107
118
|
Quantum Detectors Merlin (`.mib`), PNG, BMP, JPEG and NumPy files, single images, stacks and
|
|
108
119
|
|
|
@@ -161,8 +167,9 @@ pyEMAPS is free software under the
|
|
|
161
167
|
[GNU General Public License v3.0 or later](https://emlab-solutions.github.io/pyemaps/license.html),
|
|
162
168
|
|
|
163
169
|
for personal and commercial use, with a linking exception
|
|
164
170
|
|
|
165
171
|
([license-exception.txt](https://github.com/emlab-solutions/pyemaps/blob/main/license-exception.txt))
|
|
166
172
|
|
|
167
|
-
that allows its use with emaps, the proprietary simulation engine it runs on.
|
|
168
|
-
|
|
169
|
-
features
|
|
170
|
-
|
|
173
|
+
that allows its use with emaps, the proprietary simulation engine it runs on. The core features
|
|
174
|
+
|
|
175
|
+
need no license. The advanced features (4D-STEM analysis, diffraction pattern databases and
|
|
176
|
+
|
|
177
|
+
multislice) need one, and you can try them free for 7 days:
|
|
178
|
+
|
|
171
179
|
|
|
172
180
|
|
|
173
181
|
- `pyemaps --license trial` activates a 7-day trial license. It needs an internet connection.
|
|
174
182
|
|
|
175
183
|
- `pyemaps --license <token>` activates a trial or production license with a license activation
|
|
176
184
|
|
|
@@ -22,7 +22,8 @@ kinematical and dynamical electron diffraction described by J. C. H. Spence and
|
|
|
22
22
|
|
|
23
23
|
## Features
|
|
24
24
|
|
|
25
|
-
The
|
|
25
|
+
**The core features are free, with no license, no sign-up and no time limit**, under the GNU
|
|
26
|
+
General Public License v3.0:
|
|
26
27
|
|
|
27
28
|
- **Crystallography**
|
|
28
29
|
- Crystal construction, from your own data or the built-in crystal library
|
|
@@ -46,12 +47,17 @@ The base features are free, under the GNU General Public License v3.0:
|
|
|
46
47
|
- Contrast transfer functions, with their coherence envelopes
|
|
47
48
|
- HREM images of thin samples
|
|
48
49
|
|
|
49
|
-
The
|
|
50
|
+
**The advanced features need a license, and you can try them all free for 7 days** with
|
|
51
|
+
`pyemaps -l trial`:
|
|
50
52
|
|
|
51
|
-
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
-
|
|
53
|
+
- **4D-STEM analysis**: indexing experimental diffraction patterns, orientation and phase maps,
|
|
54
|
+
annular bright and dark field and masked images, and averaging, comparing, grouping and
|
|
55
|
+
transforming patterns
|
|
56
|
+
- **Diffraction pattern databases**: building and searching them
|
|
57
|
+
- **Multislice** simulations of thick crystals: exit waves and Ronchigrams
|
|
58
|
+
|
|
59
|
+
[Free and licensed features](https://emlab-solutions.github.io/pyemaps/free_and_licensed.html)
|
|
60
|
+
has the details.
|
|
55
61
|
|
|
56
62
|
Reading experimental patterns is free: TIFF, Gatan DigitalMicrograph (`.dm3`, `.dm4`), MRC,
|
|
57
63
|
Quantum Detectors Merlin (`.mib`), PNG, BMP, JPEG and NumPy files, single images, stacks and
|
|
@@ -122,8 +128,9 @@ pyEMAPS is free software under the
|
|
|
122
128
|
[GNU General Public License v3.0 or later](https://emlab-solutions.github.io/pyemaps/license.html),
|
|
123
129
|
for personal and commercial use, with a linking exception
|
|
124
130
|
([license-exception.txt](https://github.com/emlab-solutions/pyemaps/blob/main/license-exception.txt))
|
|
125
|
-
that allows its use with emaps, the proprietary simulation engine it runs on.
|
|
126
|
-
features
|
|
131
|
+
that allows its use with emaps, the proprietary simulation engine it runs on. The core features
|
|
132
|
+
need no license. The advanced features (4D-STEM analysis, diffraction pattern databases and
|
|
133
|
+
multislice) need one, and you can try them free for 7 days:
|
|
127
134
|
|
|
128
135
|
- `pyemaps --license trial` activates a 7-day trial license. It needs an internet connection.
|
|
129
136
|
- `pyemaps --license <token>` activates a trial or production license with a license activation
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "2.11.0"
|
|
@@ -15,25 +15,47 @@ says how long it will take before it starts.
|
|
|
15
15
|
The memory figures follow the backend's allocations:
|
|
16
16
|
|
|
17
17
|
* the beam matrix, one complex value (8 bytes) for each pair of beams: 8 x nbeams**2 bytes;
|
|
18
|
-
* at each sampling point,
|
|
19
|
-
|
|
18
|
+
* at each sampling point, for each thread working on one, with N strong beams: the strong-beam
|
|
19
|
+
matrix and the weak beams' correction, 24 x N**2 bytes, plus 16 KB per strong beam for the
|
|
20
|
+
correction's working blocks; another 8 x N**2 for the eigenvectors and their inverse when the
|
|
21
|
+
point is solved as an eigenproblem; and the math library's working memory, about 64 MB
|
|
22
|
+
(80 MB for an eigenproblem), measured at 565 to 1,038 strong beams and taken to shrink in
|
|
23
|
+
proportion below 500;
|
|
20
24
|
* the images, 4 bytes per pixel.
|
|
25
|
+
|
|
26
|
+
emaps from 2.8.0 solves each sampling point of the images whichever way is cheaper: by
|
|
27
|
+
propagating the beams through the thicknesses (Chebyshev expansion), or as an eigenproblem.
|
|
21
28
|
'''
|
|
22
29
|
|
|
23
30
|
import os
|
|
24
31
|
import sys
|
|
25
32
|
|
|
26
33
|
BEAM_MATRIX_BYTES = 8 # bytes per beam pair (COMPLEX)
|
|
27
|
-
EIGEN_BYTES = 48 # bytes per N**2, for each thread solving a sampling point
|
|
28
34
|
PIXEL_BYTES = 4 # float32 images
|
|
29
35
|
|
|
36
|
+
# How the timing point was solved: emaps' image_pilot returns EIGENPROBLEM or PROPAGATED;
|
|
37
|
+
# SCATTERING_MATRIX is the stand-in timing point for emaps before 2.8.0
|
|
38
|
+
SCATTERING_MATRIX, EIGENPROBLEM, PROPAGATED = 0, 1, 2
|
|
39
|
+
|
|
40
|
+
# For each thread working on a sampling point of N strong beams (measured with emaps 2.8.0 on
|
|
41
|
+
# paracetamol forms I and II and BiMnO3, 565 to 1,038 strong beams, 3 to 12 threads)
|
|
42
|
+
PROPAGATION_BYTES = 24 # bytes per N**2: the strong-beam matrix, the weak beams' correction
|
|
43
|
+
EIGEN_BYTES = 32 # bytes per N**2: those, the eigenvectors and their inverse
|
|
44
|
+
CORRECTION_BYTES = 16 * 1024 # bytes per strong beam: the correction's working blocks
|
|
45
|
+
LIBRARY_BYTES = {PROPAGATED: 64 * 1024**2, EIGENPROBLEM: 80 * 1024**2}
|
|
46
|
+
LIBRARY_NDIAG = 500 # below this many strong beams, LIBRARY_BYTES shrinks in proportion
|
|
47
|
+
|
|
30
48
|
# Memory use above this fraction of the free memory gets a warning
|
|
31
49
|
MEMORY_WARN_FRACTION = 0.5
|
|
32
50
|
|
|
33
51
|
# The images' run time is estimated from one sampling point solved on its own, which the
|
|
34
|
-
# backend does with all threads
|
|
35
|
-
# times as long each
|
|
36
|
-
|
|
52
|
+
# backend does with all threads. Run side by side, on a 6-core PC, the sampling points then
|
|
53
|
+
# took 0.35 to 0.7 times as long each when solved as eigenproblems (565 to 1,038 strong beams),
|
|
54
|
+
# and 0.75 to 0.97 times as long when propagated, since they then share the memory bandwidth.
|
|
55
|
+
# With the factors below, and the timing point's own time, the estimates for paracetamol forms
|
|
56
|
+
# I and II and BiMnO3 came within 15% of the run. Before emaps 2.8.0 the timing point solved
|
|
57
|
+
# the eigenproblem's scattering matrix: 0.35 to 0.5.
|
|
58
|
+
PILOT_FACTORS = {SCATTERING_MATRIX: 0.5, EIGENPROBLEM: 0.75, PROPAGATED: 1.0}
|
|
37
59
|
|
|
38
60
|
# Runs estimated to take longer than this get a warning
|
|
39
61
|
LONG_RUN_SECONDS = 60
|
|
@@ -86,9 +108,21 @@ def beam_matrix_bytes(nbeams):
|
|
|
86
108
|
return BEAM_MATRIX_BYTES * nbeams * nbeams
|
|
87
109
|
|
|
88
110
|
|
|
89
|
-
def images_bytes(ndiag, threads, det_size, nslices):
|
|
90
|
-
'''
|
|
91
|
-
|
|
111
|
+
def images_bytes(ndiag, threads, det_size, nslices, propagated=False):
|
|
112
|
+
'''
|
|
113
|
+
Memory the images need: the sampling points solved at once, propagated or as eigenproblems,
|
|
114
|
+
and the images themselves.
|
|
115
|
+
'''
|
|
116
|
+
method = PROPAGATED if propagated else EIGENPROBLEM
|
|
117
|
+
per_n2 = PROPAGATION_BYTES if propagated else EIGEN_BYTES
|
|
118
|
+
library = LIBRARY_BYTES[method] * min(1.0, ndiag / LIBRARY_NDIAG)
|
|
119
|
+
point = per_n2 * ndiag * ndiag + CORRECTION_BYTES * ndiag + library
|
|
120
|
+
return int(point * threads) + PIXEL_BYTES * det_size * det_size * nslices
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
def pilot_factor(method):
|
|
124
|
+
'''How much shorter, each, the sampling points take side by side than the timing point.'''
|
|
125
|
+
return PILOT_FACTORS.get(method, PILOT_FACTORS[EIGENPROBLEM])
|
|
92
126
|
|
|
93
127
|
|
|
94
128
|
def gb(nbytes):
|
|
@@ -246,20 +246,42 @@ def add_bloch(target):
|
|
|
246
246
|
self.session_controls=em_controls
|
|
247
247
|
return nsampling, sp
|
|
248
248
|
|
|
249
|
-
def
|
|
249
|
+
def _timeBlochPoint(thicknesses):
|
|
250
|
+
'''
|
|
251
|
+
Solve the centre sampling point on its own, as the images will solve it: (method,
|
|
252
|
+
seconds), or (None, None) if that failed. With emaps before 2.8.0, which has no such
|
|
253
|
+
timing point, the eigenproblem's scattering matrix stands in.
|
|
254
|
+
'''
|
|
255
|
+
start = time.perf_counter()
|
|
256
|
+
if hasattr(bloch, 'image_pilot'):
|
|
257
|
+
method, ret = bloch.image_pilot(farray(np.array(thicknesses), dtype=np.int32))
|
|
258
|
+
else:
|
|
259
|
+
_, ret = bloch.compute_scm([0, 0])
|
|
260
|
+
method = _res.SCATTERING_MATRIX
|
|
261
|
+
seconds = time.perf_counter() - start
|
|
262
|
+
return (int(method), seconds) if ret == 0 else (None, None)
|
|
263
|
+
|
|
264
|
+
def _checkBlochImages(self, det_size, nslices, thicknesses):
|
|
250
265
|
"""
|
|
251
266
|
Before the session's images are made: raise BlochError if they need more memory than is
|
|
252
267
|
free, and warn if they will take long. The time is measured on this computer, by solving
|
|
253
|
-
one sampling point on its own (about 1% of the work) and
|
|
254
|
-
when at least PILOT_MIN_NDIAG (400) beams are
|
|
268
|
+
one sampling point on its own, as the images will solve it (about 1% of the work), and
|
|
269
|
+
scaling to all of them; only when at least PILOT_MIN_NDIAG (400) beams are strong, since
|
|
270
|
+
smaller runs are short. That point also says how the images are solved: by propagating
|
|
271
|
+
the beams through the thicknesses, or as an eigenproblem, which needs more memory.
|
|
255
272
|
"""
|
|
256
273
|
ndiag, ntilt = int(bloch.ndiag_max), int(bloch.ntilt)
|
|
257
274
|
threads = min(_res.openmp_threads(), max(ntilt, 1))
|
|
258
|
-
|
|
275
|
+
method, seconds = None, None
|
|
276
|
+
if ndiag >= _res.PILOT_MIN_NDIAG:
|
|
277
|
+
method, seconds = _timeBlochPoint(thicknesses)
|
|
278
|
+
propagated = method == _res.PROPAGATED
|
|
279
|
+
need = _res.images_bytes(ndiag, threads, det_size, nslices, propagated)
|
|
280
|
+
free = _res.available_memory()
|
|
259
281
|
if free is not None and need > free:
|
|
260
282
|
images = f'{nslices:,} image' + ('' if nslices == 1 else 's')
|
|
261
|
-
raise BlochError(f'The images need {_res.gb(need)} of memory ({ndiag:,} beams '
|
|
262
|
-
f'
|
|
283
|
+
raise BlochError(f'The images need {_res.gb(need)} of memory ({ndiag:,} strong beams '
|
|
284
|
+
f'on {threads} threads, and {images} of '
|
|
263
285
|
f'{det_size} x {det_size}), and this computer has {_res.gb(free)} '
|
|
264
286
|
f'free. Lower omega, gmax or the excitation error limits, or make '
|
|
265
287
|
f'fewer or smaller images, and retry')
|
|
@@ -267,14 +289,12 @@ def add_bloch(target):
|
|
|
267
289
|
warnings.warn(f'The images need {_res.gb(need)} of memory, more than half of the '
|
|
268
290
|
f'{_res.gb(free)} free; the computer may slow down.', stacklevel=3)
|
|
269
291
|
|
|
270
|
-
if
|
|
271
|
-
return # a short run
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
seconds = _res.PILOT_FACTOR * ntilt * (time.perf_counter() - start)
|
|
275
|
-
if ret == 0 and seconds > _res.LONG_RUN_SECONDS:
|
|
292
|
+
if seconds is None:
|
|
293
|
+
return # a short run, not timed
|
|
294
|
+
seconds *= _res.pilot_factor(method) * ntilt
|
|
295
|
+
if seconds > _res.LONG_RUN_SECONDS:
|
|
276
296
|
warnings.warn(f'These Bloch images will take {_res.duration(seconds)} on this '
|
|
277
|
-
f'computer: {ndiag:,} beams
|
|
297
|
+
f'computer: {ndiag:,} strong beams at each of {ntilt} '
|
|
278
298
|
f'sampling points. To shorten it, lower sampling (the time grows with '
|
|
279
299
|
f'its square), omega, or gmax in em_controls.', stacklevel=3)
|
|
280
300
|
|
|
@@ -355,7 +375,8 @@ def add_bloch(target):
|
|
|
355
375
|
if ndep > MAX_DEPTH:
|
|
356
376
|
raise BlochListError(f'Number of sample thickness cannot exceed {MAX_DEPTH}')
|
|
357
377
|
|
|
358
|
-
self._checkBlochImages(det_size, ndep * (bloch.getncalcbeams() if nType == TY_LACBED else 1)
|
|
378
|
+
self._checkBlochImages(det_size, ndep * (bloch.getncalcbeams() if nType == TY_LACBED else 1),
|
|
379
|
+
thlist)
|
|
359
380
|
|
|
360
381
|
# save the input as optional control attributes
|
|
361
382
|
imgfn =''
|
|
@@ -138,12 +138,11 @@ def add_dpgen(target):
|
|
|
138
138
|
#release the memory
|
|
139
139
|
dpgen.cleanup()
|
|
140
140
|
|
|
141
|
-
if ret
|
|
142
|
-
from
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
'support@emlabsoftware.com for one.')
|
|
141
|
+
if ret in (-5, -7):
|
|
142
|
+
# -5 no license, -7 expired (a trial that has ended, from emaps 2.8.0)
|
|
143
|
+
from ..errors import LicenseError, license_message, LICENSE_NONE, LICENSE_EXPIRED
|
|
144
|
+
raise LicenseError(license_message('Diffraction pattern database generation',
|
|
145
|
+
LICENSE_EXPIRED if ret == -7 else LICENSE_NONE))
|
|
147
146
|
if ret != 0:
|
|
148
147
|
print(f'Error generating diffraction patterns for {self.name}')
|
|
149
148
|
return -1, final_fp
|
|
@@ -100,7 +100,10 @@ def add_mxtal(target):
|
|
|
100
100
|
units. Defaults to ``[[0, 0, 0], [3, 3, 3]]``.
|
|
101
101
|
:type cellbox: list or array, optional
|
|
102
102
|
:param xz: two real-space directions, ``[x_direction, z_direction]``, to align with the
|
|
103
|
-
output's x and z axes. Defaults to ``[[1, 0, 0], [0, 0, 1]]``.
|
|
103
|
+
output's x and z axes. Defaults to ``[[1, 0, 0], [0, 0, 1]]``. z follows
|
|
104
|
+
*z_direction*. If *x_direction* isn't perpendicular to it, as with the default in a
|
|
105
|
+
monoclinic or triclinic cell, x is the part of *x_direction* perpendicular to z.
|
|
106
|
+
Before emaps 2.8.0, the structure came out sheared instead.
|
|
104
107
|
:type xz: list or array, optional
|
|
105
108
|
:param orShift: shift added to the atom positions in cell coordinates, before they're
|
|
106
109
|
oriented. Defaults to ``[0, 0, 0]``.
|
|
@@ -222,14 +222,41 @@ class XDPImageError(Exception):
|
|
|
222
222
|
super().__init__(self.message)
|
|
223
223
|
|
|
224
224
|
|
|
225
|
+
# Why an advanced feature can't run: no license, an expired one (a trial that has ended), or one
|
|
226
|
+
# that couldn't be read
|
|
227
|
+
LICENSE_NONE, LICENSE_EXPIRED, LICENSE_UNREADABLE = 'none', 'expired', 'unreadable'
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
def license_message(feature, state):
|
|
231
|
+
'''
|
|
232
|
+
The message for an advanced feature that can't run for want of a license. *feature* names
|
|
233
|
+
it as a sentence starts ("Multislice simulation"); *state* is ``LICENSE_NONE``,
|
|
234
|
+
``LICENSE_EXPIRED`` or ``LICENSE_UNREADABLE``. Every advanced feature says the same thing,
|
|
235
|
+
and says that the core features need no license.
|
|
236
|
+
'''
|
|
237
|
+
if state == LICENSE_EXPIRED:
|
|
238
|
+
return (f'Your free 7-day pyEMAPS trial has ended, and {feature[:1].lower()}{feature[1:]} is '
|
|
239
|
+
'an advanced feature. To keep using it, get a license from '
|
|
240
|
+
'support@emlabsoftware.com, then run "pyemaps -l <license token>". The core '
|
|
241
|
+
'features keep working without a license.')
|
|
242
|
+
if state == LICENSE_UNREADABLE:
|
|
243
|
+
return (f'{feature} is an advanced feature, and pyEMAPS could not read its license. Run '
|
|
244
|
+
'"pyemaps -l info" to see it, and contact support@emlabsoftware.com if this '
|
|
245
|
+
'persists.')
|
|
246
|
+
return (f'{feature} is an advanced feature, and no pyEMAPS license is active. Try it free '
|
|
247
|
+
'for 7 days: run "pyemaps -l trial" (it needs an internet connection once). The core '
|
|
248
|
+
'features need no license.')
|
|
249
|
+
|
|
250
|
+
|
|
225
251
|
class LicenseError(Exception):
|
|
226
252
|
"""
|
|
227
|
-
Raised when
|
|
228
|
-
emaps package: the multislice simulations of
|
|
229
|
-
(:py:meth:`~pyemaps.probe.Probe.crystal_exit_wave` and
|
|
253
|
+
Raised when an advanced feature is used without an active pyEMAPS license, after a trial
|
|
254
|
+
has ended, or when the feature isn't in this emaps package: the multislice simulations of
|
|
255
|
+
:py:class:`~pyemaps.probe.Probe` (:py:meth:`~pyemaps.probe.Probe.crystal_exit_wave` and
|
|
230
256
|
:py:meth:`~pyemaps.probe.Probe.crystal_ronchigram`) and diffraction pattern database
|
|
231
|
-
generation (:py:meth:`~pyemaps.crystals.Crystal.generateDPDB`).
|
|
232
|
-
|
|
257
|
+
generation (:py:meth:`~pyemaps.crystals.Crystal.generateDPDB`). The message says what to do:
|
|
258
|
+
``pyemaps -l trial`` starts a free 7-day trial, and support@emlabsoftware.com has licenses.
|
|
259
|
+
The 4D-STEM features raise :py:class:`XDPImageError` with the same message.
|
|
233
260
|
"""
|
|
234
261
|
def __init__(self, message=''):
|
|
235
262
|
self.message = str(f'{message}')
|