stemdiff
Package: STEMDIFF
Conversion of a 4D-STEM dataset to a 2D-powder diffration pattern.
- Input = 4D-STEM dataset = 2D-array of 2D-NBD patterns.
- 2D-array = usually one (or more) two-dimensional scanning array(s).
- 2D-NBD = monocrystalline-like nanobeam diffraction pattern.
- Output = 2D-powder diffraction pattern
- The final 2D-diffractogram is a specific summation of 2D-NBD patterns.
- In other words, a 4D-STEM dataset is reduced to a 2D-diffraction pattern.
- The whole method (and final pattern) is called 4D-STEM/PNBD (powder NBD).
STEMDIFF modules:
- stemdiff.dbase = database of 4D-STEM datafiles + their basic parameters
- stemdiff.detectors = objects describing detectors and format of the datafiles
- stemdiff.gvars = objects describing source data and diffraction images
- stemdiff.io = input/output for datafiles and corresponding arrays + images
- stemdiff.sum = summation of datafiles (standard, serial processing)
- stemdiff.summ = summation of datafiles (multicore, parallel processing)
STEMDIFF auxiliary package IDIFF and its modules:
- IDIFF contains functions for the improvement of diffraction patterns
- IDIFF is imported below so that it could be used as: sd.idiff.some_module
- IDIFF modules are:
- idiff.bcorr = background correction/subtraction
- idiff.deconv = advanced deconvolution methods
- idiff.ncore = noise correction/reduction
- idiff.psf = estimate of PSF function
1''' 2Package: STEMDIFF 3----------------- 4Conversion of a 4D-STEM dataset to a 2D-powder diffration pattern. 5 6* Input = 4D-STEM dataset = 2D-array of 2D-NBD patterns. 7 - 2D-array = usually one (or more) two-dimensional scanning array(s). 8 - 2D-NBD = monocrystalline-like nanobeam diffraction pattern. 9* Output = 2D-powder diffraction pattern 10 - The final 2D-diffractogram is a specific summation of 2D-NBD patterns. 11 - In other words, a 4D-STEM dataset is reduced to a 2D-diffraction pattern. 12 - The whole method (and final pattern) is called 4D-STEM/PNBD (powder NBD). 13 14STEMDIFF modules: 15 16* stemdiff.dbase = database of 4D-STEM datafiles + their basic parameters 17* stemdiff.detectors = objects describing detectors and format of the datafiles 18* stemdiff.gvars = objects describing *source data* and *diffraction images* 19* stemdiff.io = input/output for datafiles and corresponding arrays + images 20* stemdiff.sum = summation of datafiles (standard, serial processing) 21* stemdiff.summ = summation of datafiles (multicore, parallel processing) 22 23STEMDIFF auxiliary package IDIFF and its modules: 24 25* IDIFF contains functions for the improvement of diffraction patterns 26* IDIFF is imported below so that it could be used as: sd.idiff.some_module 27* IDIFF modules are: 28 - idiff.bcorr = background correction/subtraction 29 - idiff.deconv = advanced deconvolution methods 30 - idiff.ncore = noise correction/reduction 31 - idiff.psf = estimate of PSF function 32''' 33__version__ = "5.2.10" 34 35 36# Import modules of stemdiff package 37# this enables us to use modules as follows: 38# >>> import stemdiff as sd 39# >>> sd.io.Datafiles.read(SDATA, '000_001.dat') 40import stemdiff.dbase 41import stemdiff.detectors 42import stemdiff.gvars 43import stemdiff.io 44import stemdiff.sum 45import stemdiff.summ 46 47 48# Import supplementary package idiff 49# this enables us to use the modules as follows: 50# >>> import stemdiff as sd 51# >>> sd.idiff.bcorr.rolling_ball(arr) 52import 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 65def 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 72if __name__ == '__main__': 73 acknowledgement()