empix 0.0.7__tar.gz → 0.0.8__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.
- {empix-0.0.7 → empix-0.0.8}/PKG-INFO +1 -1
- {empix-0.0.7 → empix-0.0.8}/empix/version.py +3 -3
- {empix-0.0.7 → empix-0.0.8}/empix.egg-info/PKG-INFO +1 -1
- {empix-0.0.7 → empix-0.0.8}/examples/basic_usage.ipynb +41 -23
- {empix-0.0.7 → empix-0.0.8}/examples/helpers_for_basic_usage.py +42 -39
- {empix-0.0.7 → empix-0.0.8}/.coveragerc +0 -0
- {empix-0.0.7 → empix-0.0.8}/.github/workflows/measure_code_coverage.yml +0 -0
- {empix-0.0.7 → empix-0.0.8}/.github/workflows/publish_documentation_website.yml +0 -0
- {empix-0.0.7 → empix-0.0.8}/.github/workflows/publish_release_to_pypi.yml +0 -0
- {empix-0.0.7 → empix-0.0.8}/.github/workflows/test_library.yml +0 -0
- {empix-0.0.7 → empix-0.0.8}/.gitignore +0 -0
- {empix-0.0.7 → empix-0.0.8}/LICENSE +0 -0
- {empix-0.0.7 → empix-0.0.8}/README.md +0 -0
- {empix-0.0.7 → empix-0.0.8}/docs/INSTALL.rst +0 -0
- {empix-0.0.7 → empix-0.0.8}/docs/Makefile +0 -0
- {empix-0.0.7 → empix-0.0.8}/docs/_static/readthedocs_custom.css +0 -0
- {empix-0.0.7 → empix-0.0.8}/docs/_templates/custom_class_template.rst +0 -0
- {empix-0.0.7 → empix-0.0.8}/docs/_templates/custom_module_template.rst +0 -0
- {empix-0.0.7 → empix-0.0.8}/docs/_templates/versions.html +0 -0
- {empix-0.0.7 → empix-0.0.8}/docs/api.rst +0 -0
- {empix-0.0.7 → empix-0.0.8}/docs/build_docs.py +0 -0
- {empix-0.0.7 → empix-0.0.8}/docs/conf.py +0 -0
- {empix-0.0.7 → empix-0.0.8}/docs/examples.rst +0 -0
- {empix-0.0.7 → empix-0.0.8}/docs/index.rst +0 -0
- {empix-0.0.7 → empix-0.0.8}/docs/license.rst +0 -0
- {empix-0.0.7 → empix-0.0.8}/docs/make.bat +0 -0
- {empix-0.0.7 → empix-0.0.8}/docs/private_members_to_publish_to_docs.rst +0 -0
- {empix-0.0.7 → empix-0.0.8}/empix/__init__.py +0 -0
- {empix-0.0.7 → empix-0.0.8}/empix.egg-info/SOURCES.txt +0 -0
- {empix-0.0.7 → empix-0.0.8}/empix.egg-info/dependency_links.txt +0 -0
- {empix-0.0.7 → empix-0.0.8}/empix.egg-info/requires.txt +0 -0
- {empix-0.0.7 → empix-0.0.8}/empix.egg-info/top_level.txt +0 -0
- {empix-0.0.7 → empix-0.0.8}/pyproject.toml +0 -0
- {empix-0.0.7 → empix-0.0.8}/run_tests.sh +0 -0
- {empix-0.0.7 → empix-0.0.8}/setup.cfg +0 -0
- {empix-0.0.7 → empix-0.0.8}/setup.py +0 -0
- {empix-0.0.7 → empix-0.0.8}/tests/test_root.py +0 -0
- {empix-0.0.7 → empix-0.0.8}/tox.ini +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: empix
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.8
|
|
4
4
|
Summary: Contains tools for analyzing electron microscopy data that are not available in ``hyperspy``.
|
|
5
5
|
Author-email: Matthew Fitzpatrick <matthew.rc.fitzpatrick@gmail.com>
|
|
6
6
|
Project-URL: Homepage, https://mrfitzpa.github.io/empix
|
|
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
|
|
|
28
28
|
commit_id: COMMIT_ID
|
|
29
29
|
__commit_id__: COMMIT_ID
|
|
30
30
|
|
|
31
|
-
__version__ = version = '0.0.
|
|
32
|
-
__version_tuple__ = version_tuple = (0, 0,
|
|
31
|
+
__version__ = version = '0.0.8'
|
|
32
|
+
__version_tuple__ = version_tuple = (0, 0, 8)
|
|
33
33
|
|
|
34
|
-
__commit_id__ = commit_id = '
|
|
34
|
+
__commit_id__ = commit_id = 'ga30344106'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: empix
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.8
|
|
4
4
|
Summary: Contains tools for analyzing electron microscopy data that are not available in ``hyperspy``.
|
|
5
5
|
Author-email: Matthew Fitzpatrick <matthew.rc.fitzpatrick@gmail.com>
|
|
6
6
|
Project-URL: Homepage, https://mrfitzpa.github.io/empix
|
|
@@ -83,21 +83,13 @@
|
|
|
83
83
|
"# be safely ignored.\n",
|
|
84
84
|
"import empix\n",
|
|
85
85
|
"\n",
|
|
86
|
-
"# For generating data to be used in this demonstration
|
|
86
|
+
"# For generating data to be used in this demonstration. Users need not focus on\n",
|
|
87
|
+
"# the implementation details of this module in order to follow the logic of each\n",
|
|
88
|
+
"# cell in the remainder of this notebook. Morevoer, users need not import this\n",
|
|
89
|
+
"# module for their own applications of ``empix``.\n",
|
|
87
90
|
"import helpers_for_basic_usage as helpers"
|
|
88
91
|
]
|
|
89
92
|
},
|
|
90
|
-
{
|
|
91
|
-
"cell_type": "code",
|
|
92
|
-
"execution_count": null,
|
|
93
|
-
"id": "c97d0485-cf65-478b-80c4-d5d294879c26",
|
|
94
|
-
"metadata": {},
|
|
95
|
-
"outputs": [],
|
|
96
|
-
"source": [
|
|
97
|
-
"%matplotlib ipympl\n",
|
|
98
|
-
"%matplotlib ipympl"
|
|
99
|
-
]
|
|
100
|
-
},
|
|
101
93
|
{
|
|
102
94
|
"cell_type": "markdown",
|
|
103
95
|
"id": "e667d633",
|
|
@@ -114,20 +106,40 @@
|
|
|
114
106
|
"In this notebook, we demonstrate how one can use each function and class in the\n",
|
|
115
107
|
"``empix`` library.\n",
|
|
116
108
|
"\n",
|
|
117
|
-
"
|
|
118
|
-
"
|
|
109
|
+
"In order to execute the cells in this notebook as intended, a set of Python\n",
|
|
110
|
+
"libraries need to be installed in the Python environment within which the cells\n",
|
|
111
|
+
"of the notebook are to be executed. For this particular notebook, users need to\n",
|
|
112
|
+
"install:\n",
|
|
113
|
+
"\n",
|
|
114
|
+
" empix\n",
|
|
115
|
+
" jupyter\n",
|
|
116
|
+
" ipympl\n",
|
|
117
|
+
"\n",
|
|
118
|
+
"Users can install these libraries either via `pip`:\n",
|
|
119
|
+
"\n",
|
|
120
|
+
" pip install empix[examples]\n",
|
|
121
|
+
"\n",
|
|
122
|
+
"or `conda`:\n",
|
|
123
|
+
"\n",
|
|
124
|
+
" conda install -y empix jupyter ipympl -c conda-forge\n",
|
|
125
|
+
"\n",
|
|
126
|
+
"You can find the documentation for the emicroml library\n",
|
|
127
|
+
"[here](https://mrfitzpa.github.io/empix/_autosummary/empix.html). It is\n",
|
|
119
128
|
"recommended that you consult the documentation of this library as you explore\n",
|
|
120
129
|
"the notebook. Moreover, users should execute the cells in the order that they\n",
|
|
121
130
|
"appear, i.e. from top to bottom, as some cells reference variables that are set\n",
|
|
122
|
-
"in other cells above them
|
|
131
|
+
"in other cells above them. **Users should make sure to navigate the documentation\n",
|
|
132
|
+
"for the version of emicroml that they are currently using.**\n",
|
|
123
133
|
"\n",
|
|
124
|
-
"The last module that we imported above
|
|
125
|
-
"
|
|
126
|
-
"used in this demonstration. It is
|
|
127
|
-
"
|
|
128
|
-
"
|
|
129
|
-
"
|
|
130
|
-
"
|
|
134
|
+
"The last module that we imported above (i.e. the module with the alias helpers)\n",
|
|
135
|
+
"contains helper functions that are used throughout the remainder of the\n",
|
|
136
|
+
"notebook, specifically to generate data to be used in this demonstration. It is\n",
|
|
137
|
+
"not essential that users know the implementation details of these helper\n",
|
|
138
|
+
"functions in order to follow the logic of each cell in the remainder of this\n",
|
|
139
|
+
"notebook. Moreover, users need not import this module for their own applications\n",
|
|
140
|
+
"of emicroml. That being said, if any users are interested in the implementation\n",
|
|
141
|
+
"details, they can find them in the file\n",
|
|
142
|
+
"`<root>/examples/helpers_for_basic_usage.py`."
|
|
131
143
|
]
|
|
132
144
|
},
|
|
133
145
|
{
|
|
@@ -182,6 +194,8 @@
|
|
|
182
194
|
"metadata": {},
|
|
183
195
|
"outputs": [],
|
|
184
196
|
"source": [
|
|
197
|
+
"%matplotlib ipympl\n",
|
|
198
|
+
"\n",
|
|
185
199
|
"kwargs = {\"axes_off\": False, \n",
|
|
186
200
|
" \"scalebar\": False, \n",
|
|
187
201
|
" \"colorbar\": False, \n",
|
|
@@ -675,6 +689,8 @@
|
|
|
675
689
|
"metadata": {},
|
|
676
690
|
"outputs": [],
|
|
677
691
|
"source": [
|
|
692
|
+
"%matplotlib inline\n",
|
|
693
|
+
"\n",
|
|
678
694
|
"plt.close(\"all\") # Close all previous figures to release memory.\n",
|
|
679
695
|
"\n",
|
|
680
696
|
"kwargs = {\"axes_off\": False, \n",
|
|
@@ -836,6 +852,8 @@
|
|
|
836
852
|
"metadata": {},
|
|
837
853
|
"outputs": [],
|
|
838
854
|
"source": [
|
|
855
|
+
"%matplotlib ipympl\n",
|
|
856
|
+
"\n",
|
|
839
857
|
"plt.close(\"all\") # Close all previous figures to release memory.\n",
|
|
840
858
|
"\n",
|
|
841
859
|
"kwargs = {\"axes_off\": False, \n",
|
|
@@ -1115,7 +1133,7 @@
|
|
|
1115
1133
|
"name": "python",
|
|
1116
1134
|
"nbconvert_exporter": "python",
|
|
1117
1135
|
"pygments_lexer": "ipython3",
|
|
1118
|
-
"version": "3.
|
|
1136
|
+
"version": "3.12.12"
|
|
1119
1137
|
}
|
|
1120
1138
|
},
|
|
1121
1139
|
"nbformat": 4,
|
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# Copyright 2024 Matthew Fitzpatrick.
|
|
3
|
+
#
|
|
4
|
+
# This program is free software: you can redistribute it and/or modify it under
|
|
5
|
+
# the terms of the GNU General Public License as published by the Free Software
|
|
6
|
+
# Foundation, version 3.
|
|
7
|
+
#
|
|
8
|
+
# This program is distributed in the hope that it will be useful, but WITHOUT
|
|
9
|
+
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
10
|
+
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
11
|
+
#
|
|
12
|
+
# You should have received a copy of the GNU General Public License along with
|
|
13
|
+
# this program. If not, see <https://www.gnu.org/licenses/gpl-3.0.html>.
|
|
1
14
|
"""This module contains helper functions for the Jupyter notebook located at
|
|
2
15
|
``<root>/examples/basic_usage.ipynb``, where ``<root>`` is the root of the
|
|
3
16
|
``empix`` repository.
|
|
@@ -26,18 +39,8 @@ import hyperspy.axes
|
|
|
26
39
|
# List of public objects in module.
|
|
27
40
|
__all__ = ["generate_real_2d_input_signal",
|
|
28
41
|
"generate_complex_2d_input_signal",
|
|
29
|
-
"generate_complex_2d_input_signal_data",
|
|
30
|
-
"generate_complex_2d_input_signal_data_shape",
|
|
31
|
-
"generate_complex_2d_input_signal_metadata",
|
|
32
|
-
"generate_ring_centers_in_pixel_coords",
|
|
33
|
-
"generate_complex_2d_input_signal_axes",
|
|
34
42
|
"generate_real_1d_input_signal",
|
|
35
|
-
"generate_complex_1d_input_signal"
|
|
36
|
-
"generate_complex_1d_input_signal_data",
|
|
37
|
-
"generate_complex_1d_input_signal_data_shape",
|
|
38
|
-
"generate_complex_1d_input_signal_metadata",
|
|
39
|
-
"generate_slopes",
|
|
40
|
-
"generate_complex_1d_input_signal_axes"]
|
|
43
|
+
"generate_complex_1d_input_signal"]
|
|
41
44
|
|
|
42
45
|
|
|
43
46
|
|
|
@@ -60,11 +63,11 @@ def generate_real_2d_input_signal():
|
|
|
60
63
|
|
|
61
64
|
|
|
62
65
|
def generate_complex_2d_input_signal():
|
|
63
|
-
kwargs = {"data":
|
|
64
|
-
"metadata":
|
|
66
|
+
kwargs = {"data": _generate_complex_2d_input_signal_data(),
|
|
67
|
+
"metadata": _generate_complex_2d_input_signal_metadata()}
|
|
65
68
|
complex_2d_input_signal = hyperspy.signals.ComplexSignal2D(**kwargs)
|
|
66
69
|
|
|
67
|
-
axes =
|
|
70
|
+
axes = _generate_complex_2d_input_signal_axes()
|
|
68
71
|
|
|
69
72
|
for axis_idx, axis in enumerate(axes):
|
|
70
73
|
complex_2d_input_signal.axes_manager[axis_idx].update_from(axis)
|
|
@@ -75,11 +78,11 @@ def generate_complex_2d_input_signal():
|
|
|
75
78
|
|
|
76
79
|
|
|
77
80
|
|
|
78
|
-
def
|
|
79
|
-
signal_data_shape =
|
|
81
|
+
def _generate_complex_2d_input_signal_data():
|
|
82
|
+
signal_data_shape = _generate_complex_2d_input_signal_data_shape()
|
|
80
83
|
Y_dim, X_dim, v_dim, h_dim = signal_data_shape
|
|
81
84
|
|
|
82
|
-
metadata =
|
|
85
|
+
metadata = _generate_complex_2d_input_signal_metadata()
|
|
83
86
|
ring_centers_in_pixel_coords = metadata["ring_centers_in_pixel_coords"]
|
|
84
87
|
inner_ring_radius_in_pixels = metadata["inner_ring_radius_in_pixels"]
|
|
85
88
|
outer_ring_radius_in_pixels = metadata["outer_ring_radius_in_pixels"]
|
|
@@ -123,21 +126,21 @@ def generate_complex_2d_input_signal_data():
|
|
|
123
126
|
|
|
124
127
|
|
|
125
128
|
|
|
126
|
-
def
|
|
129
|
+
def _generate_complex_2d_input_signal_data_shape():
|
|
127
130
|
complex_2d_input_signal_data_shape = (3, 2, 181, 200)
|
|
128
131
|
|
|
129
132
|
return complex_2d_input_signal_data_shape
|
|
130
133
|
|
|
131
134
|
|
|
132
135
|
|
|
133
|
-
def
|
|
134
|
-
axes =
|
|
136
|
+
def _generate_complex_2d_input_signal_metadata():
|
|
137
|
+
axes = _generate_complex_2d_input_signal_axes()
|
|
135
138
|
h_offset = axes[-2].offset
|
|
136
139
|
h_scale = axes[-2].scale
|
|
137
140
|
v_offset = axes[-1].offset
|
|
138
141
|
v_scale = axes[-1].scale
|
|
139
142
|
|
|
140
|
-
ring_centers_in_pixel_coords =
|
|
143
|
+
ring_centers_in_pixel_coords = _generate_ring_centers_in_pixel_coords()
|
|
141
144
|
|
|
142
145
|
ring_centers = np.array(ring_centers_in_pixel_coords, dtype="float")
|
|
143
146
|
ring_centers[:, :, 0] = h_offset + ring_centers[:, :, 0]*h_scale
|
|
@@ -174,8 +177,8 @@ def generate_complex_2d_input_signal_metadata():
|
|
|
174
177
|
|
|
175
178
|
|
|
176
179
|
|
|
177
|
-
def
|
|
178
|
-
signal_data_shape =
|
|
180
|
+
def _generate_ring_centers_in_pixel_coords():
|
|
181
|
+
signal_data_shape = _generate_complex_2d_input_signal_data_shape()
|
|
179
182
|
Y_dim, X_dim, v_dim, h_dim = signal_data_shape
|
|
180
183
|
|
|
181
184
|
ring_centers_in_pixel_coords = np.zeros((Y_dim, X_dim, 2), dtype="int")
|
|
@@ -194,8 +197,8 @@ def generate_ring_centers_in_pixel_coords():
|
|
|
194
197
|
|
|
195
198
|
|
|
196
199
|
|
|
197
|
-
def
|
|
198
|
-
signal_data_shape =
|
|
200
|
+
def _generate_complex_2d_input_signal_axes():
|
|
201
|
+
signal_data_shape = _generate_complex_2d_input_signal_data_shape()
|
|
199
202
|
Y_dim, X_dim, v_dim, h_dim = signal_data_shape
|
|
200
203
|
|
|
201
204
|
d_h = 0.1
|
|
@@ -238,11 +241,11 @@ def generate_real_1d_input_signal():
|
|
|
238
241
|
|
|
239
242
|
|
|
240
243
|
def generate_complex_1d_input_signal():
|
|
241
|
-
kwargs = {"data":
|
|
242
|
-
"metadata":
|
|
244
|
+
kwargs = {"data": _generate_complex_1d_input_signal_data(),
|
|
245
|
+
"metadata": _generate_complex_1d_input_signal_metadata()}
|
|
243
246
|
complex_1d_input_signal = hyperspy.signals.ComplexSignal1D(**kwargs)
|
|
244
247
|
|
|
245
|
-
axes =
|
|
248
|
+
axes = _generate_complex_1d_input_signal_axes()
|
|
246
249
|
|
|
247
250
|
for axis_idx, axis in enumerate(axes):
|
|
248
251
|
complex_1d_input_signal.axes_manager[axis_idx].update_from(axis)
|
|
@@ -253,11 +256,11 @@ def generate_complex_1d_input_signal():
|
|
|
253
256
|
|
|
254
257
|
|
|
255
258
|
|
|
256
|
-
def
|
|
257
|
-
signal_data_shape =
|
|
259
|
+
def _generate_complex_1d_input_signal_data():
|
|
260
|
+
signal_data_shape = _generate_complex_1d_input_signal_data_shape()
|
|
258
261
|
Y_dim, X_dim, u_dim = signal_data_shape
|
|
259
262
|
|
|
260
|
-
metadata =
|
|
263
|
+
metadata = _generate_complex_1d_input_signal_metadata()
|
|
261
264
|
slopes = metadata["slopes"]
|
|
262
265
|
y_intercept_of_real_part = metadata["y_intercept_of_real_part"]
|
|
263
266
|
y_intercept_of_imag_part = metadata["y_intercept_of_imag_part"]
|
|
@@ -268,7 +271,7 @@ def generate_complex_1d_input_signal_data():
|
|
|
268
271
|
navigation_dims = (Y_dim, X_dim)
|
|
269
272
|
num_patterns = Y_dim*X_dim
|
|
270
273
|
|
|
271
|
-
axes =
|
|
274
|
+
axes = _generate_complex_1d_input_signal_axes()
|
|
272
275
|
d_u = axes[-1].scale
|
|
273
276
|
|
|
274
277
|
n_u = np.arange(u_dim)
|
|
@@ -292,17 +295,17 @@ def generate_complex_1d_input_signal_data():
|
|
|
292
295
|
|
|
293
296
|
|
|
294
297
|
|
|
295
|
-
def
|
|
298
|
+
def _generate_complex_1d_input_signal_data_shape():
|
|
296
299
|
complex_1d_input_signal_data_shape = (3, 2, 200)
|
|
297
300
|
|
|
298
301
|
return complex_1d_input_signal_data_shape
|
|
299
302
|
|
|
300
303
|
|
|
301
304
|
|
|
302
|
-
def
|
|
305
|
+
def _generate_complex_1d_input_signal_metadata():
|
|
303
306
|
metadata = {"General": {"title": "First Complex 1D Input"},
|
|
304
307
|
"Signal": dict(),
|
|
305
|
-
"slopes":
|
|
308
|
+
"slopes": _generate_slopes(),
|
|
306
309
|
"y_intercept_of_real_part": 0,
|
|
307
310
|
"y_intercept_of_imag_part": 10}
|
|
308
311
|
|
|
@@ -312,8 +315,8 @@ def generate_complex_1d_input_signal_metadata():
|
|
|
312
315
|
|
|
313
316
|
|
|
314
317
|
|
|
315
|
-
def
|
|
316
|
-
signal_data_shape =
|
|
318
|
+
def _generate_slopes():
|
|
319
|
+
signal_data_shape = _generate_complex_1d_input_signal_data_shape()
|
|
317
320
|
Y_dim, X_dim, r_dim = signal_data_shape
|
|
318
321
|
|
|
319
322
|
slopes = np.zeros((Y_dim, X_dim))
|
|
@@ -328,8 +331,8 @@ def generate_slopes():
|
|
|
328
331
|
|
|
329
332
|
|
|
330
333
|
|
|
331
|
-
def
|
|
332
|
-
signal_data_shape =
|
|
334
|
+
def _generate_complex_1d_input_signal_axes():
|
|
335
|
+
signal_data_shape = _generate_complex_1d_input_signal_data_shape()
|
|
333
336
|
Y_dim, X_dim, u_dim = signal_data_shape
|
|
334
337
|
|
|
335
338
|
axes_sizes = (X_dim, Y_dim, u_dim)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|