stemdiff 5.2.5__py3-none-any.whl → 5.2.7__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.
@@ -1,6 +1,6 @@
1
1
  '''
2
- STEMDIFF package
3
- ----------------
2
+ Package: STEMDIFF
3
+ -----------------
4
4
  Conversion of a 4D-STEM dataset to a 2D-powder diffration pattern.
5
5
 
6
6
  * Input = 4D-STEM dataset = 2D-array of 2D-NBD patterns.
@@ -30,7 +30,8 @@ STEMDIFF auxiliary package IDIFF and its modules:
30
30
  - idiff.ncore = noise correction/reduction
31
31
  - idiff.psf = estimate of PSF function
32
32
  '''
33
- __version__ = "5.2.5"
33
+ __version__ = "5.2.7"
34
+
34
35
 
35
36
  # Import modules of stemdiff package
36
37
  # this enables us to use modules as follows:
@@ -43,8 +44,30 @@ import stemdiff.io
43
44
  import stemdiff.sum
44
45
  import stemdiff.summ
45
46
 
47
+
46
48
  # Import supplementary package idiff
47
49
  # this enables us to use the modules as follows:
48
50
  # >>> import stemdiff as sd
49
51
  # >>> sd.idiff.bcorr.rolling_ball(arr)
50
52
  import idiff
53
+
54
+
55
+ # Obligatory acknowledgement -- the development was co-funded by TACR.
56
+ # TACR requires that the acknowledgement is printed when we run the program.
57
+ # Nevertheless, Python packages run within other programs, not directly.
58
+ # The following code ensures that the acknowledgement is printed when:
59
+ # (1) You run this file: __init__.py
60
+ # (2) You run the package from command line: python -m stemdiff
61
+ # Technical notes:
62
+ # To get item (2) above, we define __main__.py (next to __init__.py).
63
+ # The usage of __main__.py is not very common, but still quite standard.
64
+
65
+ def acknowledgement():
66
+ print('STEMDIFF package - convert 4D-STEM data to 2D powder diffractogram.')
67
+ print('------')
68
+ print('The development of the package was co-funded by')
69
+ print('the Technology agency of the Czech Republic,')
70
+ print('program NCK, project TN02000020.')
71
+
72
+ if __name__ == '__main__':
73
+ acknowledgement()
STEMDIFF/__main__.py ADDED
@@ -0,0 +1,9 @@
1
+ # __main__.py = top-level code environment
2
+ # Usage: (1) __main__ in programs (2) __main__.py in packages
3
+ # More information: https://docs.python.org/3/library/__main__.html
4
+ # Here: To print the the acknowledgement when we run: python -m stemdiff
5
+ # (the acknowledgement function is defined in the sister __init__.py file
6
+
7
+ from stemdiff import acknowledgement
8
+
9
+ if __name__ == '__main__': acknowledgement()
@@ -1,6 +1,6 @@
1
1
  '''
2
- stemdiff.dbase
3
- --------------
2
+ Module: stemdiff.dbase
3
+ ----------------------
4
4
  Functions to calculate, save and re-read the database of 4D-STEM datafiles.
5
5
 
6
6
  * The database is saved as a pandas.DataFrame object,
@@ -1,6 +1,6 @@
1
1
  '''
2
- stemdiff.detectors
3
- ------------------
2
+ Module: stemdiff.detectors
3
+ --------------------------
4
4
  Description of detectors that can be used in stemdiff package.
5
5
 
6
6
  This module is basically a container of classes.
@@ -63,7 +63,7 @@ def print_known_detectors():
63
63
 
64
64
  def describe_detector(detector_object):
65
65
  '''
66
- Print the description of the detector on the screen.
66
+ Global method: the description of the detector on the screen.
67
67
 
68
68
  Parameters
69
69
  ----------
@@ -83,7 +83,8 @@ def describe_detector(detector_object):
83
83
  >>> # (minimalistic example
84
84
  >>> import stemdiff as sd
85
85
  >>> my_detector = sd.detectors.TimePix()
86
- >>> my_detector.self_describe()
86
+ >>> my_detector.self_describe() # OO-interface, indirect call
87
+ >>> describe_detector(my_detector) # procedural interface, direct call
87
88
  >>>
88
89
  >>> # Real usage
89
90
  >>> # (in STEMDIFF scripts,
@@ -145,12 +146,10 @@ class TimePix:
145
146
 
146
147
  def __init__(self, detector_name='TimePix',
147
148
  detector_size=256, max_intensity=11810,
148
- data_type=np.uint16, upscale=4):
149
- '''
150
- * The initialization of TimePix detector objects.
151
- * The parameters are described above in class definition.
152
- * Auto-documentation list (some of) the initialization parameters.
153
- '''
149
+ data_type=np.uint16, upscale=4):
150
+ # The initialization of TimePix detector objects.
151
+ # The parameters are described above in class definition.
152
+ # -----
154
153
  self.detector_name = detector_name
155
154
  self.detector_size = detector_size
156
155
  self.max_intensity = max_intensity
@@ -259,8 +258,8 @@ class Secom:
259
258
  -------
260
259
  Secom detector object.
261
260
 
262
- Format of Secom datafiles
263
- ---------------------------
261
+ Format of SECOM datafiles
262
+ -------------------------
264
263
  * image files, TIFF format
265
264
  * 16-bit images = images containing np.uint16 values
266
265
  '''
@@ -269,10 +268,9 @@ class Secom:
269
268
  def __init__(self, detector_name='Secom',
270
269
  detector_size=2048, max_intensity=65536,
271
270
  data_type=np.uint16, upscale=1):
272
- '''
273
- Initialize parameters of Secom detector.
274
- The parameters are described above in class definition.
275
- '''
271
+ # The initialization of Secom detector objects.
272
+ # The parameters are described above in class definition.
273
+ # -----
276
274
  self.detector_name = detector_name
277
275
  self.detector_size = detector_size
278
276
  self.max_intensity = max_intensity
@@ -1,6 +1,6 @@
1
1
  '''
2
- stemdiff.gvars
3
- --------------
2
+ Module: stemdiff.gvars
3
+ ----------------------
4
4
  Global variables/objects for package stemdiff.
5
5
 
6
6
  The global variables are used throughout the whole program.
@@ -53,15 +53,13 @@ class SourceData:
53
53
 
54
54
  Returns
55
55
  -------
56
- DataFiles object.
56
+ DataFiles object
57
57
  '''
58
58
 
59
59
  def __init__(self, detector, data_dir, filenames):
60
- '''
61
- * The initialization of SourceData objects.
62
- * The parameters are described above in class definition.
63
- * Auto-documentation list (some of) the initialization parameters.
64
- '''
60
+ # The initialization of SourceData objects.
61
+ # The parameters are described above in class definition.
62
+ # -----
65
63
  self.detector = detector
66
64
  self.data_dir = Path(data_dir)
67
65
  self.filenames = self.data_dir.glob(filenames)
@@ -97,18 +95,16 @@ class DiffImages:
97
95
 
98
96
  Returns
99
97
  -------
100
- DiffImages object.
98
+ DiffImages object
101
99
  '''
102
100
 
103
101
  def __init__(self,
104
102
  imgsize=100, psfsize=30,
105
103
  ctype=2, csquare=20, cintensity=0.8,
106
104
  peak_height=100, peak_dist=3):
107
- '''
108
- * The initialization of DiffImages objects.
109
- * The parameters are described above in class definition.
110
- * Auto-documentation list (some of) the initialization parameters.
111
- '''
105
+ # The initialization of DiffImages objects.
106
+ # The parameters are described above in class definition.
107
+ # -----
112
108
  self.imgsize = imgsize
113
109
  self.psfsize = psfsize
114
110
  self.ctype = ctype
@@ -1,6 +1,6 @@
1
1
  '''
2
- stemdiff.io
3
- -----------
2
+ Module: stemdiff.io
3
+ -------------------
4
4
  Input/output functions for package stemdiff.
5
5
 
6
6
  Three types of stemdiff.io objects
@@ -69,7 +69,8 @@ def set_plot_parameters(size=(12,9), dpi=75, fontsize=10, my_rcParams=None):
69
69
 
70
70
  Returns
71
71
  -------
72
- None; the result is a modification of the global plt.rcParams variable.
72
+ None
73
+ The result is a modification of the global plt.rcParams variable.
73
74
  '''
74
75
  # This function just calls the final function in Plotting module.
75
76
  # (left in the main namespace of the package as it is frequently used
@@ -79,7 +80,8 @@ def set_plot_parameters(size=(12,9), dpi=75, fontsize=10, my_rcParams=None):
79
80
  class Datafiles:
80
81
  '''
81
82
  Datafiles class = a collection of functions
82
- that work with datafiles from 2D-STEM detector saved as files in a disk.
83
+ that work with datafiles from 2D-STEM detector
84
+ (assumption: the datafiles were saved as standard files on a disk).
83
85
  '''
84
86
 
85
87
  def read(SDATA, filename):
@@ -1,6 +1,6 @@
1
1
  '''
2
- stemdiff.sum
3
- ------------
2
+ Module: stemdiff.sum
3
+ --------------------
4
4
  The summation of 4D-STEM datafiles to create one 2D powder diffraction file.
5
5
 
6
6
  * stemdiff.sum = this module, which runs on a single core (serial processing)
@@ -1,6 +1,6 @@
1
1
  '''
2
- stemdiff.summ
3
- -------------
2
+ Module: stemdiff.summ
3
+ ---------------------
4
4
  The summation of 4D-STEM datafiles to create one 2D powder diffraction file.
5
5
 
6
6
  * The summation runs on all available cores (parallel processing).
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: stemdiff
3
- Version: 5.2.5
3
+ Version: 5.2.7
4
4
  Summary: Convert 4D-STEM data to 2D-powder diffraction pattern.
5
5
  Home-page: https://github.com/mirekslouf/stemdiff/
6
6
  Author: Mirek Slouf
@@ -31,7 +31,7 @@ STEMDIFF :: 4D-STEM dataset to 2D-diffractogram
31
31
  [https://doi.org/10.3390/nano11040962](https://doi.org/10.3390/nano11040962)
32
32
  2. *Materials* 14 (2021) 7550.
33
33
  [https://doi.org/10.3390/ma14247550](https://doi.org/10.3390/ma14247550)
34
- * If you use STEMDIFF package, **please cite** the 2nd publication (or both :-).
34
+ * If you use STEMDIFF package, **please cite** the 2nd publication (or both :-)
35
35
 
36
36
  Principle
37
37
  ---------
@@ -40,7 +40,7 @@ Principle
40
40
 
41
41
  Installation
42
42
  ------------
43
- * Requirement: Python with sci-modules: numpy, matplotlib, scipy, pandas
43
+ * Requirement: Python with sci-modules = numpy, matplotlib, scipy, pandas
44
44
  * `pip install scikit-image` = 3rd party package for advanced image processing
45
45
  * `pip install tqdm` = to show progress meter during long summations
46
46
  * `pip install idiff` = to improve diffractograms (remove noise, background ...)
@@ -49,20 +49,23 @@ Installation
49
49
  Quick start
50
50
  -----------
51
51
 
52
- * See how it works:
53
- - Look at [worked example](https://www.dropbox.com/scl/fi/l5eskdgxo7976ea9x35fp/01_sdiff_au.nb.pdf?rlkey=7yd5tqtcm3zxr1uc0m0aisenl&dl=0)
54
- in Jupyter.
55
- * Try it yourself:
56
- - Download [complete examples with data](https://www.dropbox.com/scl/fo/ccb6hs28er9dc1xufshh4/h?rlkey=omk5bqoe17jmedhj407ng9xr0&dl=0).
57
- - After downloading, unzip and follow the instructions in *readme* file.
52
+ * Look at the
53
+ [worked example](https://www.dropbox.com/scl/fi/l5eskdgxo7976ea9x35fp/01_sdiff_au.nb.pdf?rlkey=7yd5tqtcm3zxr1uc0m0aisenl&dl=0)
54
+ to see STEMDIFF in action.
55
+ * Download
56
+ [complete examples with data](https://www.dropbox.com/scl/fo/ccb6hs28er9dc1xufshh4/h?rlkey=omk5bqoe17jmedhj407ng9xr0&dl=0)
57
+ and try STEMDIFF yourself.
58
58
 
59
59
  Documentation, help and examples
60
60
  --------------------------------
61
61
 
62
- * [PyPI](https://pypi.org/project/stemdiff) repository.
63
- * [GitHub](https://github.com/mirekslouf/stemdiff) repository.
62
+ * [PyPI](https://pypi.org/project/stemdiff) repository -
63
+ the stable version to install.
64
+ * [GitHub](https://github.com/mirekslouf/stemdiff) repository -
65
+ the current version under development.
64
66
  * [GitHub Pages](https://mirekslouf.github.io/stemdiff)
65
- with [documentation](https://mirekslouf.github.io/stemdiff/docs).
67
+ with [help](https://mirekslouf.github.io/stemdiff/docs)
68
+ and [complete package documentation](https://mirekslouf.github.io/stemdiff/docs/pdoc.html/stemdiff.html).
66
69
 
67
70
  ## Versions of STEMDIFF
68
71
 
@@ -89,3 +92,9 @@ Documentation, help and examples
89
92
  - more types of deconvolution (experimental; to be finished in v.6.0)
90
93
  * Version 5.1 = (beta) support for parallel processing
91
94
  * Version 5.2 = (beta) improvement of diff.patterns in sister package idiff
95
+
96
+ Acknowledgement
97
+ ---------------
98
+
99
+ The development was co-funded by TACR, program NCK,
100
+ project [TN02000020](https://www.isibrno.cz/en/centre-advanced-electron-and-photonic-optics).
@@ -0,0 +1,13 @@
1
+ STEMDIFF/__init__.py,sha256=mHJVVAlVjYi2R4Mr8ZHL9794BWgw4xhYILsHpi5nYlE,2928
2
+ STEMDIFF/__main__.py,sha256=ECOOjxFFnVPb5gHkI05h8KrVpk_vYmAI18nfrL0ZF9M,413
3
+ STEMDIFF/dbase.py,sha256=Z-41mzzX2XqWJwPCPNMIboq7m57NtJhP4ViTfPssvpk,5985
4
+ STEMDIFF/detectors.py,sha256=YHiOZjEaeOtYstlX0ATFPWqfVMVIiJCfFthXtVuVZaw,11850
5
+ STEMDIFF/gvars.py,sha256=BBMM70kv-l3_mSQb_GX1abNR-EYewvUgZYkB66RQG0M,4453
6
+ STEMDIFF/io.py,sha256=xHmjy5KYWz1P0cnYK8nVesf6AoDHQIWc7aeXFUUJIHM,48011
7
+ STEMDIFF/sum.py,sha256=ZEHgLbdaQkooB7ZWgTxxmLJZpM5yCxCaOlK70A1rNSU,14607
8
+ STEMDIFF/summ.py,sha256=LBhgfmPEvWMmCruZE2K7-XYSjA7Mh33WrziP4bTGcU4,8030
9
+ stemdiff-5.2.7.dist-info/LICENCE,sha256=A0HugtkWkgCwRhYrsSqENRlIFre2Vu14xQajDnsYlqU,1340
10
+ stemdiff-5.2.7.dist-info/METADATA,sha256=imBKXcZvJ01VsKB-kMtxDWHGJPwCKyD8p4ToxD5DDY4,4493
11
+ stemdiff-5.2.7.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
12
+ stemdiff-5.2.7.dist-info/top_level.txt,sha256=TEpwqMUcpSUvwCDrcH9fkjpU8fYGdR1ti2H2UsNiUIk,9
13
+ stemdiff-5.2.7.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.43.0)
2
+ Generator: setuptools (75.6.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -0,0 +1 @@
1
+ STEMDIFF
@@ -1,12 +0,0 @@
1
- stemdiff/__init__.py,sha256=cDXnOdcNldPJNO9qI9yJAbHmBvd3KIClj7mMXDd_4d4,1996
2
- stemdiff/dbase.py,sha256=ZrhCxZjG5HKzau89xQA7WiwR5ZMyTAmFzCbh9IFkziQ,5969
3
- stemdiff/detectors.py,sha256=sFivE68oDdEff06Vf9CJFejo4-EY3E1B3aGggzn8kZY,11798
4
- stemdiff/gvars.py,sha256=njyT8cYULdmnOAhCi6MeqDTaW4GrUrFaxiVePCvab9s,4610
5
- stemdiff/io.py,sha256=me7FPuxooMRnTgwRV78V16ERQiw78-23diuAdCXp8yM,47940
6
- stemdiff/sum.py,sha256=2BIHk8kIzuSREfQCt3Tgp24b8YdnfDZFMQDz5US9ayU,14591
7
- stemdiff/summ.py,sha256=E1-I9mErLUwK8zJjr492D2Pz0P8GVaZ_5QUVHnbASgo,8014
8
- stemdiff-5.2.5.dist-info/LICENCE,sha256=A0HugtkWkgCwRhYrsSqENRlIFre2Vu14xQajDnsYlqU,1340
9
- stemdiff-5.2.5.dist-info/METADATA,sha256=5rKj9YpShr0lw4D-M0Ddq19oKg5BB-ZGDferbU2ajTM,4197
10
- stemdiff-5.2.5.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
11
- stemdiff-5.2.5.dist-info/top_level.txt,sha256=EQn-XSqpLeMnvowHwcgup7Qwlk6c0zeBT3abWmDapRQ,9
12
- stemdiff-5.2.5.dist-info/RECORD,,
@@ -1 +0,0 @@
1
- stemdiff