원시데이터 수집 시스템
선정목록으로

An open-source software ecosystem for the interactive exploration of ultrafast electron scattering data

간접 관련 화학·수지 · (21) 에폭시수지 (6) PEM(고분자전해질막)(15) 디스플레이 패널재료

기본 정보

저자
  1. Laurent P. René de Cotret — 1Department of Physics, McGill University, Montréal, Canada|||Department of Physics, McGill University, Montréal, Canada
  2. Martin Otto — 1Department of Physics, McGill University, Montréal, Canada|||Department of Physics, McGill University, Montréal, Canada
  3. Mark J. Stern — 1Department of Physics, McGill University, Montréal, Canada|||Department of Physics, McGill University, Montréal, Canada
  4. Bradley J. Siwick — 1Department of Physics, McGill University, Montréal, Canada|||2Department of Chemistry, McGill University, Montréal, Canada|||Department of Chemistry, McGill University, Montréal, Canada
DOI
10.1186/s40679-018-0060-y
저널
Advanced Structural and Chemical Imaging
발행년도
2018
발행기관
Springer Science+Business Media
피인용수
23
라이선스
cc-by
논문 유형
–
언어
–
원문 페이지
https://doi.org/10.1186/s40679-018-0060-y
토픽
Electron and X-Ray Spectroscopy Techniques
OpenAlex ID
W2891476371

평가 내용

관련도
간접 관련
사업분야
화학·수지 · (21) 에폭시수지
부 분야
(6) PEM(고분자전해질막), (15) 디스플레이 패널재료
R&D 측면
분석·모델링
확신도
0.70
근거 용어
ultrafast electron scattering, crystal structure manipulation, image processing algorithms, simulation routines, diffraction patterns
판단 근거
본 논문은 초고속 전자 산란(UES) 데이터를 처리하고 분석하기 위한 오픈소스 소프트웨어 생태계에 관한 연구입니다. 직접적인 제품 연구는 아니나, 결정 구조 분석 및 시뮬레이션 기술은 에폭시/페놀 수지 등의 고분자 결정성 제어나 디스플레이/연료전지용 소재의 미세 구조 분석 기법으로 응용 가능합니다.
R&D 활용 포인트
고분자 소재(에폭시, 아라미드 등)의 결정 구조 및 상전이 현상을 초고속 분석할 때, 본 논문에서 제시된 데이터 처리 알고리즘 및 시뮬레이션 루틴을 활용하여 소재의 물성 변화를 정밀하게 모델링할 수 있습니다.
평가 입력
본문 35,983자

초록

Abstract This paper details a software ecosystem comprising three free and open-source Python packages for processing raw ultrafast electron scattering (UES) data and interactively exploring the processed data. The first package, iris , is graphical user-interface program and library for interactive exploration of UES data. Under the hood, iris makes use of npstreams , an extensions of numpy to streaming array-processing, for high-throughput parallel data reduction. Finally, we present scikit-ued , a library of reusable routines and data structures for analysis of UES data, including specialized image processing algorithms, simulation routines, and crystal structure manipulation operations. In this paper, some of the features or all three packages are highlighted, such as parallel data reduction, image registration, interactive exploration. The packages are fully tested and documented and are released under permissive licenses.

본문 35,983자

본문 펼치기
_g_ _(_ _)_ https://doi.org/10.1186/s40679-018-0060-y ## METHODOLOGY ## Open Access # An open‑source software ecosystem for the interactive exploration of ultrafast electron scattering data Laurent P. René de Cotret <sup>1*</sup>, Martin R. Otto <sup>1</sup>, Mark J. Stern <sup>1</sup> and Bradley J. Siwick <sup>1,2</sup> Abstract This paper details a software ecosystem comprising three free and open-source Python packages for processing raw ultrafast electron scattering (UES) data and interactively exploring the processed data. The first package, _iris_, is graphical user-interface program and library for interactive exploration of UES data. Under the hood, _iris_ makes use of _npstreams_, an extensions of _numpy_ to streaming array-processing, for high-throughput parallel data reduction. Finally, we present _scikit-ued_, a library of reusable routines and data structures for analysis of UES data, including specialized image processing algorithms, simulation routines, and crystal structure manipulation operations. In this paper, some of the features or all three packages are highlighted, such as parallel data reduction, image registration, interactive exploration. The packages are fully tested and documented and are released under permissive licenses. Keywords: Ultrafast electron scattering, Visualization, Data processing, Open-source Background The advent of ultrafast electron diffraction (UES) has extended crystallography into the temporal dimension. Combining the spatial resolution of electron microscopy and femtosecond time-resolution, this laboratory-scale technique has shed light on a broad spectrum of phenomena, from photoinduced structural phase transitions in inorganic [21, 32] and organic materials [8], to coherent nuclear motion in dilute molecular gas [36]. Beyond probing structure through elastic interactions, UES has provided a direct observation of electron–phonon couplings and phonon relaxation pathways in layered materials [26, 31]. Ultrafast electron scattering is a stroboscopic technique. Electron scattering patterns are acquired a fixed time-delay after photoexcitation with an ultrafast laser. A full view of the scattering dynamics can be assembled by acquiring electron scattering patterns for sufficient time-delays. To maximize the signal-to-noise ratio, equivalent experiments—hereafter referred to as *Correspondence: laurent.renedecotret@mail.mcgill.ca 1 Department of Physics, McGill University, Montréal, Canada Full list of author information is available at the end of the article _scans_ —are acquired sequentially. This set of equivalent sub-experiments forms the raw experimental data. In order to extract time-dynamics, the data must be distilled, or _reduced_ ; the data reduction might involve scattering intensity normalization or alignment, and ends in averaging. A physical picture of dynamics in a sample is built by looking at in scattering intensity over time, in a fixed region of reciprocal space. A conceptual view of the flow from raw data to dynamics is presented in Fig. 1. The path from data acquisition to scientific insights can never be fully standardized and streamlined. However, one step common to all workflows is data exploration. This is especially important for time-resolved techniques such as UES due to the breadth and depth of information contained in a dataset. This emerging field would benefit greatly from an aggregation of efforts towards free and open-source tools that standardize and simplify analysis and interpretation of complex dynamics. In this work, we present a program built specifically for interactive data exploration, _iris_ . We also introduce a software package of reusable routines and data structures related to ultrafast electron scattering ( _scikit-ued_ ) and a streaming array operations package ( _npstreams_ ), establishing a software © The Author(s) 2018. This article is distributed under the terms of the Creative Commons Attribution 4.0 International License [(http://creat​iveco​mmons​.org/licen​ses/by/4.0/), which permits unrestricted use, distribution, and reproduction in any medium,](http://creativecommons.org/licenses/by/4.0/) provided you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made. _g_ _(_ _)_ g _g_ _(_ _)_ g foundation on which the community can build. _Iris_ is the first integrated solution for interacting with UES data. Methods The software ecosystem presented in this work is written in Python; the language is accessible to non-programmers, with a simple syntax and dynamic nature. The scientific Python community’s dedication to good documentation and focus on free and open-source packages are attractive features that played heavily in the decision to write iris in Python. While pure Python code typically results in poor performance, bottlenecks can easily be rewritten in a more efficient, compiled language, and seamlessly integrated with existing Python code [5]. It should be stressed that performance-critical parts of our software ecosystem are, in fact, thin layers of Python code on top of fast C libraries. The Python scientific stack is built on the _de facto_ standard _numpy_ package [29] that exports array operations rooted in compiled code, bypassing the slow nature of Python in most situations. Therefore, Python provides an ideal mix of performance and ease of development. Results and discussion Interactive data exploration The primary tool presented in this work is _iris_, first and foremost a graphical user-interface (GUI) program that allows for interactive exploration of ultrafast electron scattering data. From its GUI, users can interact with raw data, process this raw data into a reduced dataset, enabling interactive data exploration. _Iris_ ’ second role consists of a library of data structures for handling ultrafast scattering data in external Python scripts and programs. Everything that can be done in the GUI can also be done programmatically. The first step in the typical _iris_ workflow involves interacting with raw scattering patterns from a variety of possible unique formats. For this purpose, _Iris_ supports plug-ins that act as bridges between arbitrary data formats for raw data and _iris_ ’s internal representation. The second step in the typical _iris_ workflow consists of data reduction. During this phase, equivalent scattering patterns acquired with the same time-delay are reduced in parallel. This reduction operation can involve image-alignment, intensity normalization, or any operation specified by a plug-in. Scattering patterns are then concatenated into a three-dimensional array, similar to a video. Experimental metadata, such as sample temperature, photoexcitation conditions, electron energy, and more, are also preserved. Arbirary metadata can be defined by users through the use of plug-ins. The performance optimization of the data reduction pipeline is discussed in depth in “Streaming operations on arrays” section. _Iris_ handles large reduced datasets by storing them using the Hierarchical Data Format version 5 (HDF5), an archival format designed for large _n_ -dimensional numerical datasets [3, 13]. HDF5 supports transparent compression and data-corruption detection mechanisms. Most importantly, HDF5 supports data slicing, which allows to read specific portions of an HDF5 file without having to load the entire file—which can require tens of gigabytes of memory in the case of fully reduced UES datasets. The final stage of the exploration workflow—timeseries extraction—is specific to time-resolved techniques. Thanks to HDF5’s data slicing feature and careful performance optimizations within _iris_, dynamics in scattering patterns can be explored interactively, in real-time. Further data transformations are also possible, most importantly azimuthal averaging of scattering patterns from polycrystalline samples. Time-series extraction in the GUI is shown in Fig. 2 for two types of samples, singlecrystal and polycrystal. _Iris_ was designed with compatibility in mind. For input compatibility, _iris_ ’s plug-in architecture allows to interface with arbitrary data formats. Writing a plug-in requires writing some Python code: users can then use the full power of the scientific Python stack to introduce extra processing in _iris_ ’s data reduction pipeline. In terms of output compatibility, _iris_ datasets can be inspected and manipulated by a large variety of programs, thanks to HDF5’s official and unofficial bindings to programming languages such as C/C++, Fortran77/Fortran90, LabVIEW, MATLAB, Mathematica, R, Julia, Python, and many more. The HDF5 layout is described in the online documentation. Streaming operations on arrays Raw scattering datasets can reach sizes up to hundreds of gigabytes. The reduction operation of concatenating images into dense _numpy_ arrays, and then reducing—which usually involves scattering pattern alignment, intensity normalization, and finally a weighted average— is a slow process. To effectively reduce the raw data, the package _npstreams_ was created. _Npstreams_ extends the core components of the array-oriented _numpy_ package (called universal functions) to work on streams of arrays rather than dense, in-memory arrays. _Npstreams_ can _automagically_ generate streaming functions from _numpy_ universal functions. The streams of arrays can be generated on-demand (such as images being progressively loaded from disk). Stream operations require much less memory, which in turns allows for _g_ _(_ _)_ g Fig. 2 Overview of the GUI component of _iris_ . Two GUI instances show typical datasets. On the top left, Bragg peak dynamics for photoexcited single-crystal data is shown. Diffracted intensity is integrated in the red square and its time dependence is shown in the bottom panel. On the bottom right, azimuthally averaged baseline-corrected polycrystalline scattering data are presented. The pre-photoexcitation scattering patterns have been subtracted so that dynamics are more evident. Diffraction patterns are color-coded based on their time-delay, shown below. Diffracted intensity is integrated inside the blue zone and its time dependence is again shown on the bottom panel. Both integration regions can be interactively dragged, updating the time-series in real-time parallelization. In fact, in the special case of stream operations on arrays of the same size (e.g., on images), data reduction can operate in constant-memory. In the case of data reduction in _iris_, a stream of arrays is formed by progressively loading scattering patterns at same time-delay (but from different scans). Therefore, the reduction of a dataset of many time-delays and many scans to a dataset of many time-delays and a single scan can be done in parallel. In the limiting case where data processing performance is not bound by data loading time, the performance increase due to _npstreams_ alone is _linear_ in the number of processing units. Thus, an 8-core computer would experience an 8x performance increase by using _npstreams_ in parallel. Single-core performance is also improved. To measure single-core performance, benchmarks set up a sequence of n × n arrays of random floating-point numbers representing scattering patterns. Then, arrays are either directly averaged using _npstreams_, or concatenated into a dense `ndarray` which is in turns averaged using _numpy_ . The results of running this benchmark on sequence of varying lengths and arrays of varying sizes is presented in Fig. 3. While the core of _npstreams_ is concerned with autogenerating streaming functions from basic universal _numpy_ functions, some more complex streaming functions are implemented, with the aim of providing real-world examples. For instance, a streaming weighted average and streaming weighted standard deviation routines are included, based on West [33]. _Npstreams_ also includes benchmarking functionality, where users can generate benchmark results on their machine with a simple command, as shown in Fig. 4. The functionality of _npstreams_ extends beyond the requirements of _iris_ and _scikit-ued_ . Streaming array operations can deal with an infinite stream of arrays. For example, an operation can be applied until certain criteria are met, or a pipeline can be assembled which can run forever, in constant (low) memory. a _g_ _(_ _)_ g _Baseline‑removal_ The baseline-removal functionality provided by _scikit-_ _ued_ is the evolution of the approach previously published by the authors. Readers interested in the details are referred to [6]. Some extensions have been made, such as the ability to compute a background for 2D images using the iterative algorithm based on the discrete wavelet transform presented in [7]. This approach can be used to remove blemishes on images: by treating hot spots or defects as foreground, the baseline of the original image will show no hotspots. An example of this is shown in Fig. 5. b Fig. 3 Performance characterization of the _npstreams_ package in comparison with _numpy_ . The task was to average sequences of 2D arrays (representing scattering patterns). a Wall time of averaging for a sequence of 10 arrays (solid) superimposed with maximum memory usage (dashed). The vertical-dashed line marks the array size of 2048 × 2048, equivalent to a scattering pattern of 4 megapixels. b Speed-up of using _npstreams_ vs. _numpy_ for averaging a sequence of arrays of size 512 × 512 elements Reusable routines and data structures for ultrafast electron scattering data analysis The scientific Python community has access to over 50 research-oriented packages called _scikits_, extensions of the general-purpose SciPy package [17]. These software packages provide routines and algorithms for handling image processing ( _scikit-image_ [30]), performing machine-learning tasks ( _scikit-learn_ [24]), interacting with spectroscopy data ( _scikit-spectra_ ), bio-informatics ( _scikit-bio_ ), and much more. In the tradition of these scikits, we introduce _scikit-ued_, a collection of algorithms, routines, and data structures commonly needed for ultrafast electron scattering data interactions. Most operations _iris_ performs on datasets are offloaded to _scikit-ued_ . _Scikit-ued_ provides a repository of reusable components in many domains, such as image analysis, crystal structure manipulation, baseline-removal, simulation, common utilities, and more. Some of its features are described in the following sections. _Image analysis_ Scattering patterns analysis intersects with general image processing in many ways. In most cases, other libraries such as _scikit-image_ can be used. Specific tasks not widely available elsewhere have been included in _scikit-ued_ . A common data processing task, implemented in the data reduction pipeline of _iris_, is scattering pattern alignment to a reference. During the course of data acquisition, scattering patterns can drift across the detector due to fluctuations in the electron beam alignment, while other image components (e.g., beam-stop, hard edges, detector defects) will appear static. Therefore, cross-correlation techniques used in image registration generally fail at scattering pattern alignment. _Scikit-ued_ includes an advanced image-alignment algorithm, known as the masked normalized cross-correlation image registration [22]. By masking static components of scattering data, the image registration algorithm will only compare misaligned sections, greatly enhancing registration accuracy. An example of this algorithm is presented in Fig. 6. Symmetry-based operations are also implemented in _scikit-ued_ . One such operation is azimuthal averaging, a procedure during which polycrystalline scattering patterns are reduced to one radial dimension. _Scikit-ued_ includes discrete symmetry-based operations as well, most importantly discrete rotational averaging. Scattering patterns exhibiting _n_ -fold rotational symmetry can be transformed to yield a higher signal-to-noise ratio. This approach has recently been used to extract small ultrafast diffuse scattering signals from graphite [26]. An example of such symmetrization is presented in Fig. 7. _Structure manipulation_ _Scikit-ued_ includes data structures that make it easy to read and manipulate crystallographic information. The `Crystal` class is the primary data structure giving access to atomic positions, chemical composition, lattice information, and more. It can be generated from a few types of sources, with the most convenient _g_ _(_ _)_ g >>> import npstreams as ns >>> ns.benchmark () **************** NPSTREAMS PERFORMANCE BENCHMARK npstreams 1.5.3 NumPy 1.14.3 Speedup is NumPy time divided by npstreams time (Higher is better) **************** numpy.average vs npstreams.average shape = (4, 4) speedup = 1.2707x shape = (8, 8) speedup = 1.3454x shape = (16, 16) speedup = 1.5626x shape = (64, 64) speedup = 2.2815x ------------------------------------------------------------------------------- numpy.sum vs npstreams.sum shape = (4, 4) speedup = 1.2645x shape = (8, 8) speedup = 1.3963x shape = (16, 16) speedup = 1.5897x shape = (64, 64) speedup = 2.3401x ------------------------------------------------------------------------------- numpy.add vs npstreams . reduce_ufunc (numpy.add, ...) shape = (4, 4) speedup = 1.3326x shape = (8, 8) speedup = 1.4502x shape = (16, 16) speedup = 1.5985x shape = (64, 64) speedup = 3.6624x ------------------------------------------------------------------------------ ... (continued) ... Fig. 4 How to run _npstreams_ benchmarks suite from the interactive Pythoninterpreter. By default, a pre-selected set of functions from both the _numpy_ and _npstreams_ packages are compared type involving the ubiquitous Crystal Information File (CIF) format [2, 15]. Structures can also be pulled from entries in the Crystallography Open Database [9, 10], as well as generated from Protein Data Bank entries [1, 14]. A number of structures (mostly simple elemental crystals) are included with the package. Finally, `Crys-` `tal` instances can be generated from (and converted to) the Atomic Simulation Environment `Atoms` format [20]. An example of structure manipulation is presented in Fig. 8. Once a `Crystal` instance has been created, spacegroup information and symmetry operations can be determined through the library spglib [12, 27]. Using this information, crystals can also be reduced to their primitive cells. _Simulation_ _Scikit-ued_ has built-in support for calculation of crystal potentials, based on the parametrization of Kirkland [18]. The example of real-space, projected electrostatic potential of orthorhombic barium titanate (BaTiO3 ) is shown in Fig. 9. These calculations are required in the implementation of multislice simulations [4, 19]. From the parametrization of atomic potentials, the atomic form factors can also be calculated—and from them static structure factors. _Scikit-ued_ exports a routine for simulating electron diffraction patterns for polycrystalline samples based on the atomic positions of `Crys-` `tal` objects. Examples of simulated diffraction patterns from built-in _scikit-ued_ structures are presented in Fig. 10. _g_ _(_ _)_ g Fig. 5 Removing image hotspots using an iterative baseline-removal algorithm based on the discrete wavelet transform. a Original scattering pattern shows hotspots due to laser light hitting the detector. b Baseline of a . The hotspots are treated as the foreground by the iterative algorithm _Input and output_ _Scikit-ued_ provides routines to read exotic image file formats. _Scikit-ued_ can read Merlin Image Binary files ( _*._ _mib_ )—both single image and multi-images files—as well as Gatan’s proprietary DM3 and DM4 formats ( _*.dm3_, _*.dm4_ ). _Scikit-ued_ can also read all images supported by _scikit-image_, notably images encoded in the Tagged Image File Format ( _*.tiff_ ). _Miscellaneous_ Many small utilities are included in _scikit-ued_ . Fast computation of pseudo-voigt profiles is included and integrated with the polycrystalline diffraction simulation routine, based on the work by Ida et al. [16]. Calculation of thin film optical properties is also implemented, based on Tomlin [28]. Finally, a preliminary version of the non-uniform Fast Fourier Transform (NFFT) is available [11]. Additional functionality is presented in the documentation. Common features All three libraries presented herein benefit from some common features and development tools. First and foremost, all three packages are documented online (offline documentation is also available). Reference documentation is automatically generated from the source code, which limits the possibility of documentation being out-of-date with respect to the source code [23]. The documentation for all three packages also includes hand-written tutorials. The documentation for each package is hosted online by Read the Docs and links are specified in see “Availability of data and materials” section. The repositories are hosted on GitHub, a web-based code hosting service with built-in version control through Git. As the packages are free and open-source, GitHub can be used to browse source code. It also provides features not available through Git itself, most importantly an issue tracker. This issue tracker is also directly accessible from the _iris_ GUI through a help menu. Bugs and issues raised through GitHub are publicly visible and provide a place to discuss potential solutions. After changes are committed to one of the repositories, the updated package is automatically installed and tested in a remote environment—a practice known as continuous integration. Committed changes also trigger the automatic generation of a new documentation version, which is then posted online within minutes. (See figure on next page.) Fig. 6 Scattering pattern alignment based on the masked normalized cross-correlation algorithm. a Reference scattering patterns of polycrystalline chromium. b Misaligned scattering pattern. c Difference between the patterns in a and b shows structure indicative of a sideways shift. Note that the beam block has not moved. d Pixel mask of the beam block. Black pixels represent zones to be ignored by the alignment procedure. e Aligned image, registered without the mask in d . f Difference between a and e shows residual misalignment. g Aligned image, registered with the mask in d . f Difference between a and g shows successful alignment _g_ _(_ _)_ g _g_ _(_ _)_ g Fig. 7 Example of symmetrization of single-crystal scattering patterns. a Raw single-crystal scattering pattern. Inset shows the pixel mask indicating where the beam-block is located. Pixels under the mask are ignored during the symmetrization routine. c Sixfold rotational symmetrization of scattering pattern in a with beam-block masked reduces noise and enhances dynamics >>> from skued import Crystal >>> c = Crystal .from_cod (9009089) # Latest revision by default >>> print(c) < Crystal object with following unit cell: Atom O @ (0.90, 0.79, 0.80) Atom O @ (0.10, 0.21, 0.20) Atom O @ (0.10, 0.29, 0.70) Atom O @ (0.90, 0.71, 0.30) Atom O @ (0.39, 0.69, 0.29) Atom O @ (0.39, 0.81, 0.79) Atom O @ (0.61, 0.19, 0.21) Atom O @ (0.61, 0.31, 0.71) Atom V @ (0.24, 0.53, 0.53) Atom V @ (0.76, 0.48, 0.47) Atom V @ (0.24, 0.97, 0.03) Atom V @ (0.76, 0.03, 0.97) Lattice parameters: 5.743 <sup>˚</sup> A, 4.517 <sup>˚</sup> A, 5.375 <sup>˚</sup> A, 90.00 <sup>_◦_</sup>, 122.60 <sup>_◦_</sup>, 90.00 <sup>_◦_</sup> Source: COD num :9009089 rev:latest >>> print(c. spacegroup_info ()) {’hall_number ’ : 81, ’hall_symbol ’ : ’-P 2ybc ’, ’international_full ’ : ’P 1 2_1/c 1’, ’international_number ’: 14, ’international_symbol ’: ’P2_1/c’, ’pointgroup ’ : ’C2h ’} >>> print(c. chemical_composition ) {’O’: 0.666, ’V’: 0.333} Fig. 8 Generating a `Crystal` instance for vanadium dioxide from theCrystallography Open Database entry 9009089 [34], inside the interactivePython interpreter _g_ _(_ _)_ g Fig. 9 Simulated electrostatic potential of orthorhombic barium titanate (BaTiO3 ) projected onto the z = 0 plane Structure file was taken from [35] <mark>a</mark> b c Fig. 10 Simulated polycrystalline electron diffraction patterns for gold, graphite, and monoclinic M1 VO2 Finally, stable versions of all three packages are uploaded to the Python Packaging Index (PyPI), where they can be inspected and downloaded. For users of the Anaconda Python distribution, the three packages are also available for install within the conda environment, which provides pre-compiled packages. Roadmap The natural progression for _iris_ involves data exploration along different dimensions beyond time: diffracted intensity along dimensions of fluence, temperature, doping concentration, and more. The target functionality of _npstreams_ has largely been implemented. The obvious key improvement concerns performance, which could be increased by rewriting the core functionality in C, while exploiting _numpy_ ’s C interface. Future developments of _scikit-ued_ concern the simulation subpackage. Simulation of polycrystalline scattering pattern is indispensable as a tool to test methods and validate hypotheses; simulation of single-crystal scattering patterns is a natural evolution of _scikit-ued_ ’s capabilities. While the basic parametrizations of atomic properties are already implemented, as well as the computation of real-space electrostatic potential of arbitrary crystal structures (see Fig. 9), wave-propagation calculations—e.g., the multislice algorithm—remain to be implemented. See [25] for a summary of available electron scattering and microscopy simulation tools to which _scikit-ued_ could bind. Conclusion An ecosystem of three free and open-source Python packages for exploring ultrafast electron scattering data was presented. This ecosystem, governed by permissive licenses, was created with collaboration in mind, while adhering to sane software development practice. We introduced _npstreams_, a streaming array-processing library that allows for constant-memory data reduction. _Scikit-ued_, a _scipy_ extension that contains algorithms and data structures for the analysis of UES data, was also presented. Finally, the ecosystem culminates in the _iris_ package, the first integrated data exploration interface specifically tailored to the data-rich nature of UES. _Iris_ ’ plug-in functionality as well as real-time, interactive capabilities pushes the limits of what is possible in field of ultrafast electron scattering. Abbreviations UES: ultrafast electron scattering; GUI: graphical user-interface; HDF5: hierarchical data format version 5; CIF: crystal information file; COD: crystallography open database; PyPI: Python packaging index. Authors’ contributions LPRDC designed and implemented the software packages. LPRDC prepared the manuscript. MRO and MJS contributed data to showcase features of the software ecosystem. All authors read and approved the final manuscript. Author details 1 Department of Physics, McGill University, Montréal, Canada. 2 Department of Chemistry, McGill University, Montréal, Canada. Acknowledgements The authors would like to thank Samuel Palato and Hélène Seiler for their guidance concerning software design principles. The authors are also grateful to the contributors and maintainers of the several free and open-source packages on top of which this software ecosystem is built. _g_ _(_ _)_ g Competing interests The authors declare that they have no competing interests. Availability of data and materials The data presented in this manuscript are publicly available in the _scikit-ued_ repository. The software packages’ repositories are linked on the authors’ [homepage (http://www.physi​cs.mcgil​l.ca/siwic​klab/softw​are.html). All pack-](http://www.physics.mcgill.ca/siwicklab/software.html) ages are multi-platform and require the CPython interpreter version 3.6 or later. The _iris_ and _scikit-ued_ are licensed under the Massachusetts Institute of Technology (MIT) license, while _npstreams_ is licensed under the Berkeley Software Distribution (BSD) 3-clause license (same as _numpy_ ). The documentation for each package is hosted online by Read the Docs at the addresses located below: _Iris_ [: https​://iris-ued.readt​hedoc​s.io/,](https://iris-ued.readthedocs.io/) _Scikit-ued_ [: https​://sciki​t-ued.readt​](https://scikit-ued.readthedocs.io/) [hedoc​s.io/,](https://scikit-ued.readthedocs.io/) _Npstreams_ [: https​://npstr​eams.readt​hedoc​s.io/.](https://npstreams.readthedocs.io/) Funding This work was supported by the Natural Sciences and Engineering Research Council of Canada (NSERC), the Fonds de Recherche du Québec-Nature et Technologies (FRQNT), and Canada Research Chairs (CRC) program. Publisher’s Note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations. Received: 19 June 2018 Accepted: 11 September 2018 References 1. Berman, H.M., Westbrook, J., Feng, Z., Gilliland, G., Bhat, T.N., Weissig, H., Shindyalov, I.N., Bourne, P.E.: The protein data bank. Nucleic Acids Res. 28 (1), 235–242 (2000) 2. Bjrkman, T.: Cif2cell: generating geometries for electronic structure programs. Comput. Phys. Commun. 182 (5), 1183–1186 (2011) 3. Collette, A.: Python and HDF5. O’Reilly, Sebastopol (2013) 4. Cowley, J.M.: Chapter 11—multi-slice approaches. In: Cowley, J.M. (ed.) Diffraction physics (Third Edition), North-Holland Personal Library, 3rd edn, pp. 231–254. North-Holland, Amsterdam (1995) 5. Dalcin, L., Bradshaw, R., Smith, K., Citro, C., Behnel, S., Seljebotn, D.S.: Cython: the best of both worlds. Comput. Sci. Eng. 13, 31–39 (2010) 6. de Cotret, L.P.R., Siwick, B.J.: A general method for baseline-removal in ultrafast electron powder diffraction data using the dual-tree complex wavelet transform. Struct. Dyn. 4 (4), 044004 (2017) 7. Galloway, C.M., Le Ru, E.C., Etchegoin, P.G.: An iterative algorithm for background removal in spectroscopy by wavelet transforms. Appl. Spectr. 63 (12), 1370–1376 (2009) 8. Gao, M., Lu, C., Jean-Ruel, H., Liu, L.C., Marx, A., Onda, K., Koshihara, S.-Y., Nakano, Y., Shao, X., Hiramatsu, T., Saito, G., Yamochi, H., Cooney, R.R., Moriena, G., Sciaini, G., Miller, R.J.D.: Mapping molecular motions leading to charge delocalization with ultrabright electrons. Nature 496 (7445), 343–6 (2013) 9. Graulis, S., Dakevi, A., Merkys, A., Chateigner, D., Lutterotti, L., Quirs, M., Serebryanaya, N.R., Moeck, P., Downs, R.T., Le Bail, A.: Crystallography open database (cod): an open-access collection of crystal structures and platform for world-wide collaboration. Nucleic Acids Res. 40 (D1), D420–D427 (2012) 10. Gražulis, S., Chateigner, D., Downs, R.T., Yokochi, A.F.T., Quirós, M., Lut 15. Hester, J.R.: A validating CIF parser: PyCIFRW. J. Appl. Crystallogr. 39 (4), 621–625 (2006) 16. Ida, T., Ando, M., Toraya, H.: Extended pseudo voigt function for approxi mating the voigt profile. J. Appl. Crystallogr. 33 (6), 1311–1316 (2000) 17. Jones, E., Oliphant, T., Peterson, P., et al.: SciPy: open source scientific tools for Python, (2001) (Online; accessed <today>) 18. Kirkland, E.J.: Advanced computing in electron microscopy, 2nd edn. Springer, New York (2010) 19. Kirkland, E.J., Loane, R.F., Silcox, J.: Simulation of annular dark field stem images using a modified multislice method. Ultramicroscopy 23 (1), 77–96 (1987) 20. Larsen, A.H., Mortensen, J.J., Blomqvist, J., Castelli, I.E., Christensen, R., Duak, M., Friis, J., Groves, M.N., Hammer, B., Hargus, C., Hermes, E.D., Jennings, P.C., Jensen, P.B., Kermode, J., Kitchin, J.R., Kolsbjerg, E.L., Kubal, J., Kaasbjerg, K., Lysgaard, S., Maronsson, J.B., Maxson, T., Olsen, T., Pastewka, L., Peterson, A., Rostgaard, C., Schitz, J., Schtt, O., Strange, M., Thygesen, K.S., Vegge, T., Vilhelmsen, L., Walter, M., Zeng, Z., Jacobsen, K.W.: The atomic simulation environment a python library for working with atoms. J. Phys. Condensed Matter 29 (27), 273002 (2017) 21. Morrison, V.R., Chatelain, R.P., Tiwari, K.L., Hendaoui, A., Bruhacs, A., Chaker, M., Siwick, B.J.: A photoinduced metallic phase of monoclinic VO2 revealed by ultrafast electron diffraction. Science 341 (6208), 19 (2014) 22. Padfield, D.: Masked object registration in the Fourier domain. IEEE Trans. Image Proces. 21 (5), 2706–2718 (2012) 23. Pawlik, A., Segal, J., Sharp, H., Petre, M.: Crowdsourcing scientific software documentation: a case study of the numpy documentation project. Comput. Sci. Eng. 17 (1), 28–36 (2015) 24. Pedregosa, F., Varoquaux, G., Gramfort, A., Michel, V., Thirion, B., Grisel, O., Blondel, M., Prettenhofer, P., Weiss, R., Dubourg, V., Vanderplas, J., Passos, A., Cournapeau, D., Brucher, M., Perrot, M., Duchesnay, E.: Scikit-learn: machine learning in Python. J. Mach. Learn. Res. 12, 2825–2830 (2011) 25. Pryor, A., Ophus, C., Miao, J.: A streaming multi-gpu implementation of image simulation algorithms for scanning transmission electron microscopy. Adv. Struct. Chem. Imaging 3 (1), 15 (2017) 26. Stern, M.J., René de Cotret, L.P., Otto, M.R., Chatelain, R.P., Boisvert, J.-P., Sut ton, M., Siwick, B.J.: Mapping momentum-dependent electron-phonon coupling and nonequilibrium phonon dynamics with ultrafast electron diffuse scattering. Phys. Rev. B 97, 165416 (2018) 27. Togo, A.: spglib: finding and handling crystal symmetries, 2009–2018. 28. Tomlin, S.G.: Optical reflection and transmission formulae for thin films. J. Phys. D 1 (12), 1667 (1968) 29. van der Walt, S., Colbert, S.C., Varoquaux, G.: The numpy array: a structure for efficient numerical computation. Comput. Sci. Eng. 13 (2), 22–30 (2011) 30. van der Walt, S., Schönberger, J .L., Nunez-Iglesias, J., Boulogne, F., Warner, J .D., Yager, N., Gouillart, E., Yu, T a: scikit-image: image processing in python. Peer J. 2, e453 (2014) 31. Waldecker, L., Bertoni, R., Hübener, H., Brumme, T., Vasileiadis, T., Zahn, D., Rubio, A., Ernstorfer, R.: Momentum-resolved view of electron–phonon coupling in multilayer wse2 . Phys. Rev. Lett. 119, 036803 (2017) 32. Waldecker, L., Miller, T.a, Rudé, M., Bertoni, R., Osmond, J., Pruneri, V., Simp son, R.E., Ernstorfer, R.: Time-domain separation of optical properties from structural transitions in resonantly bonded materials. Nat. Mater. 14 (July), 1–6 (2015) 33. West, D.H.D.: Updating mean and variance estimates: an improved method. Commun. ACM 22 (9), 532–535 (1979) 34. Wyckoff, R.W.G.: Crystal structure, vol. 1. Interscience Publishers, New York (1963) 35. Xiao, C., Jin, C., Wang, X.: Crystal structure of dense nanocrystalline batio3 ceramics. Mater. Chem. Phys. 111 (2), 209–212 (2008) 36. Yang, J., Guehr, M., Shen, X., Li, R., Vecchione, T., Coffee, R., Corbett, J., Fry, A., Hartmann, N., Hast, C., Hegazy, K., Jobe, K., Makasyuk, I., Robinson, J., Robinson, M.S., Vetter, S., Weathersby, S., Yoneda, C., Wang, X., Centurion, M.: Diffractive imaging of coherent nuclear motion in isolated molecules. Phys. Rev. Lett. 117, 153002 (2016) terotti, L., Manakova, E., Butkus, J., Moeck, P., Le Bail, A.: Crystallography open database—an open-access collection of crystal structures. J. Appl. Crystallogr. 42 (4), 726–729 (2009) 11. Greengard, L., Lee, J.-Y.: Accelerating the nonuniform fast Fourier trans form. SIAM Rev. 46 (3), 443–454 (2004) 12. Grosse-Kunstleve, R.W.: Algorithms for deriving crystallographic space group information. Acta Crystallogr. A 55 (2 Part 2), 383–395 (1999) [13. Group, T.H.: Hierarchical data format, version 5, 1997–2018. https​://www.](https://www.hdfgroup.org/HDF5/) [hdfgr​oup.org/HDF5/.](https://www.hdfgroup.org/HDF5/) 14. Hamelryck, T., Manderick, B.: Pdb file parser and structure class imple mented in Python. Bioinformatics 19 (17), 2308–2310 (2003)

섹션 본문 38문단 · 21,378자

(제목 없음)

1This paper details a software ecosystem comprising three free and open-source Python packages for processing raw ultrafast electron scattering (UES) data and interactively exploring the processed data. The first package, iris, is graphical user-interface program and library for interactive exploration of UES data. Under the hood, iris makes use of npstreams, an extensions of numpy to streaming array-processing, for high-throughput parallel data reduction. Finally, we present scikit-ued, a library of reusable routines and data structures for analysis of UES data, including specialized image processing algorithms, simulation routines, and crystal structure manipulation operations. In this paper, some of the features or all three packages are highlighted, such as parallel data reduction, image registration, interactive exploration. The packages are fully tested and documented and are released under permissive licenses. which permits unrestricted use, distribution, and reproduction in any medium, provided you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made.

Background

2The advent of ultrafast electron diffraction (UES) has extended crystallography into the temporal dimension. Combining the spatial resolution of electron microscopy and femtosecond time-resolution, this laboratory-scale technique has shed light on a broad spectrum of phenomena, from photoinduced structural phase transitions in inorganic [21,32] and organic materials [8], to coherent nuclear motion in dilute molecular gas [36]. Beyond probing structure through elastic interactions, UES has provided a direct observation of electron-phonon couplings and phonon relaxation pathways in layered materials [26,31].

3Ultrafast electron scattering is a stroboscopic technique. Electron scattering patterns are acquired a fixed time-delay after photoexcitation with an ultrafast laser. A full view of the scattering dynamics can be assembled by acquiring electron scattering patterns for sufficient time-delays. To maximize the signal-to-noise ratio, equivalent experiments-hereafter referred to as scans-are acquired sequentially. This set of equivalent sub-experiments forms the raw experimental data. In order to extract time-dynamics, the data must be distilled, or reduced; the data reduction might involve scattering intensity normalization or alignment, and ends in averaging. A physical picture of dynamics in a sample is built by looking at in scattering intensity over time, in a fixed region of reciprocal space. A conceptual view of the flow from raw data to dynamics is presented in Fig. 1.

4The path from data acquisition to scientific insights can never be fully standardized and streamlined. However, one step common to all workflows is data exploration. This is especially important for time-resolved techniques such as UES due to the breadth and depth of information contained in a dataset. This emerging field would benefit greatly from an aggregation of efforts towards free and open-source tools that standardize and simplify analysis and interpretation of complex dynamics. In this work, we present a program built specifically for interactive data exploration, iris. We also introduce a software package of reusable routines and data structures related to ultrafast electron scattering (scikit-ued) and a streaming array operations package (npstreams), establishing a software Fig. 1 Ultrafast electron scattering data exploration workflow. To maximize signals, ultrafast electron scattering experiments consist in many identical sub-experiments (or scans), as shown on the top right. Data reduction consists in combining these sub-experiments, which usually involve image-alignment, intensity normalization, and other corrections. Each individual time-delay can be reduced in parallel. The resulting reduced data are a stack of scattering patterns, similar to a video. Scattering intensity time-series can be extracted from either a single pixel or integrated over a groups of pixels (lower right) foundation on which the community can build. Iris is the first integrated solution for interacting with UES data.

Methods

5The software ecosystem presented in this work is written in Python; the language is accessible to non-programmers, with a simple syntax and dynamic nature. The scientific Python community's dedication to good documentation and focus on free and open-source packages are attractive features that played heavily in the decision to write iris in Python. While pure Python code typically results in poor performance, bottlenecks can easily be rewritten in a more efficient, compiled language, and seamlessly integrated with existing Python code [5]. It should be stressed that performance-critical parts of our software ecosystem are, in fact, thin layers of Python code on top of fast C libraries. The Python scientific stack is built on the de facto standard numpy package [29] that exports array operations rooted in compiled code, bypassing the slow nature of Python in most situations. Therefore, Python provides an ideal mix of performance and ease of development.

Interactive data exploration

6The primary tool presented in this work is iris, first and foremost a graphical user-interface (GUI) program that allows for interactive exploration of ultrafast electron scattering data. From its GUI, users can interact with raw data, process this raw data into a reduced dataset, enabling interactive data exploration. Iris' second role consists of a library of data structures for handling ultrafast scattering data in external Python scripts and programs. Everything that can be done in the GUI can also be done programmatically. The first step in the typical iris workflow involves interacting with raw scattering patterns from a variety of possible unique formats. For this purpose, Iris supports plug-ins that act as bridges between arbitrary data formats for raw data and iris's internal representation.

7The second step in the typical iris workflow consists of data reduction. During this phase, equivalent scattering patterns acquired with the same time-delay are reduced in parallel. This reduction operation can involve image-alignment, intensity normalization, or any operation specified by a plug-in. Scattering patterns are then concatenated into a three-dimensional array, similar to a video. Experimental metadata, such as sample temperature, photoexcitation conditions, electron energy, and more, are also preserved. Arbirary metadata can be defined by users through the use of plug-ins. The performance optimization of the data reduction pipeline is discussed in depth in "Streaming operations on arrays" section.

8Iris handles large reduced datasets by storing them using the Hierarchical Data Format version 5 (HDF5), an archival format designed for large n-dimensional numerical datasets [3,13]. HDF5 supports transparent compression and data-corruption detection mechanisms. Most importantly, HDF5 supports data slicing, which allows to read specific portions of an HDF5 file without having to load the entire file-which can require tens of gigabytes of memory in the case of fully reduced UES datasets.

9The final stage of the exploration workflow-timeseries extraction-is specific to time-resolved techniques. Thanks to HDF5's data slicing feature and careful performance optimizations within iris, dynamics in scattering patterns can be explored interactively, in real-time. Further data transformations are also possible, most importantly azimuthal averaging of scattering patterns from polycrystalline samples. Time-series extraction in the GUI is shown in Fig. 2 for two types of samples, singlecrystal and polycrystal.

10Iris was designed with compatibility in mind. For input compatibility, iris's plug-in architecture allows to interface with arbitrary data formats. Writing a plug-in requires writing some Python code: users can then use the full power of the scientific Python stack to introduce extra processing in iris's data reduction pipeline. In terms of output compatibility, iris datasets can be inspected and manipulated by a large variety of programs, thanks to HDF5's official and unofficial bindings to programming languages such as C/C++, Fortran77/Fortran90, LabVIEW, MATLAB, Mathematica, R, Julia, Python, and many more. The HDF5 layout is described in the online documentation.

Streaming operations on arrays

11Raw scattering datasets can reach sizes up to hundreds of gigabytes. The reduction operation of concatenating images into dense numpy arrays, and then reducing-which usually involves scattering pattern alignment, intensity normalization, and finally a weighted averageis a slow process.

12To effectively reduce the raw data, the package npstreams was created. Npstreams extends the core components of the array-oriented numpy package (called universal functions) to work on streams of arrays rather than dense, in-memory arrays. Npstreams can automagically generate streaming functions from numpy universal functions. The streams of arrays can be generated on-demand (such as images being progressively loaded from disk). Stream operations require much less memory, which in turns allows for parallelization. In fact, in the special case of stream operations on arrays of the same size (e.g., on images), data reduction can operate in constant-memory.

13In the case of data reduction in iris, a stream of arrays is formed by progressively loading scattering patterns at same time-delay (but from different scans). Therefore, the reduction of a dataset of many time-delays and many scans to a dataset of many time-delays and a single scan can be done in parallel. In the limiting case where data processing performance is not bound by data loading time, the performance increase due to npstreams alone is linear in the number of processing units. Thus, an 8-core computer would experience an 8x performance increase by using npstreams in parallel.

14Single-core performance is also improved. To measure single-core performance, benchmarks set up a sequence of n × n arrays of random floating-point numbers representing scattering patterns. Then, arrays are either directly averaged using npstreams, or concatenated into a dense ndarray which is in turns averaged using numpy. The results of running this benchmark on sequence of varying lengths and arrays of varying sizes is presented in Fig. 3.

15While the core of npstreams is concerned with autogenerating streaming functions from basic universal numpy functions, some more complex streaming functions are implemented, with the aim of providing real-world examples. For instance, a streaming weighted average and streaming weighted standard deviation routines are included, based on West [33].

16Npstreams also includes benchmarking functionality, where users can generate benchmark results on their machine with a simple command, as shown in Fig. 4.

17The functionality of npstreams extends beyond the requirements of iris and scikit-ued. Streaming array operations can deal with an infinite stream of arrays. For example, an operation can be applied until certain criteria are met, or a pipeline can be assembled which can run forever, in constant (low) memory.

Reusable routines and data structures for ultrafast electron scattering data analysis

18The scientific Python community has access to over 50 research-oriented packages called scikits, extensions of the general-purpose SciPy package [17]. These software packages provide routines and algorithms for handling image processing (scikit-image [30]), performing machine-learning tasks (scikit-learn [24]), interacting with spectroscopy data (scikit-spectra), bio-informatics (scikit-bio), and much more. In the tradition of these scikits, we introduce scikit-ued, a collection of algorithms, routines, and data structures commonly needed for ultrafast electron scattering data interactions. Most operations iris performs on datasets are offloaded to scikit-ued.

19Scikit-ued provides a repository of reusable components in many domains, such as image analysis, crystal structure manipulation, baseline-removal, simulation, common utilities, and more. Some of its features are described in the following sections.

Baseline-removal

20The baseline-removal functionality provided by scikitued is the evolution of the approach previously published by the authors. Readers interested in the details are referred to [6]. Some extensions have been made, such as the ability to compute a background for 2D images using the iterative algorithm based on the discrete wavelet transform presented in [7]. This approach can be used to remove blemishes on images: by treating hot spots or defects as foreground, the baseline of the original image will show no hotspots. An example of this is shown in Fig. 5.

Image analysis

21Scattering patterns analysis intersects with general image processing in many ways. In most cases, other libraries such as scikit-image can be used. Specific tasks not widely available elsewhere have been included in scikit-ued.

22A common data processing task, implemented in the data reduction pipeline of iris, is scattering pattern alignment to a reference. During the course of data acquisition, scattering patterns can drift across the detector due to fluctuations in the electron beam alignment, while other image components (e.g., beam-stop, hard edges, detector defects) will appear static. Therefore, cross-correlation techniques used in image registration generally fail at scattering pattern alignment. Scikit-ued includes an advanced image-alignment algorithm, known as the masked normalized cross-correlation image registration [22]. By masking static components of scattering data, the image registration algorithm will only compare misaligned sections, greatly enhancing registration accuracy. An example of this algorithm is presented in Fig. 6.

23Symmetry-based operations are also implemented in scikit-ued. One such operation is azimuthal averaging, a procedure during which polycrystalline scattering patterns are reduced to one radial dimension. Scikit-ued includes discrete symmetry-based operations as well, most importantly discrete rotational averaging. Scattering patterns exhibiting n-fold rotational symmetry can be transformed to yield a higher signal-to-noise ratio. This approach has recently been used to extract small ultrafast diffuse scattering signals from graphite [26]. An example of such symmetrization is presented in Fig. 7.

Structure manipulation

24Scikit-ued includes data structures that make it easy to read and manipulate crystallographic information. The Crystal class is the primary data structure giving access to atomic positions, chemical composition, lattice information, and more. It can be generated from a few types of sources, with the most convenient a b Fig. 3 Performance characterization of the npstreams package in comparison with numpy. The task was to average sequences of 2D arrays (representing scattering patterns). a Wall time of averaging for a sequence of 10 arrays (solid) superimposed with maximum memory usage (dashed). The vertical-dashed line marks the array size of 2048 × 2048 , equivalent to a scattering pattern of 4 megapixels. b Speed-up of using npstreams vs. numpy for averaging a sequence of arrays of size 512 × 512 elements type involving the ubiquitous Crystal Information File (CIF) format [2,15]. Structures can also be pulled from entries in the Crystallography Open Database [9,10], as well as generated from Protein Data Bank entries [1,14]. A number of structures (mostly simple elemental crystals) are included with the package. Finally, Crystal instances can be generated from (and converted to) the Atomic Simulation Environment Atoms format [20]. An example of structure manipulation is presented in Fig. 8.

25Once a Crystal instance has been created, spacegroup information and symmetry operations can be determined through the library spglib [12,27]. Using this information, crystals can also be reduced to their primitive cells.

Simulation

26Scikit-ued has built-in support for calculation of crystal potentials, based on the parametrization of Kirkland [18]. The example of real-space, projected electrostatic potential of orthorhombic barium titanate (BaTiO 3 ) is shown in Fig. 9. These calculations are required in the implementation of multislice simulations [4,19].

27From the parametrization of atomic potentials, the atomic form factors can also be calculated-and from them static structure factors. Scikit-ued exports a routine for simulating electron diffraction patterns for polycrystalline samples based on the atomic positions of Crystal objects. Examples of simulated diffraction patterns from built-in scikit-ued structures are presented in Fig. 10.

28>>> import npstreams as ns >>> ns . benchmark () *************************************************** **************************** * NPSTREAMS PERFORMANCE BENCHMARK npstreams 1.5.3 NumPy 1.14.3 Speedup is NumPy time divided by npstreams time (Higher is better) *************************************************** **************************** * numpy . average vs npstreams . average

Input and output

29Scikit-ued provides routines to read exotic image file formats. Scikit-ued can read Merlin Image Binary files (*. mib)-both single image and multi-images files-as well as Gatan's proprietary DM3 and DM4 formats (*.dm3, *.dm4). Scikit-ued can also read all images supported by scikit-image, notably images encoded in the Tagged Image File Format (*.tiff).

Miscellaneous

30Many small utilities are included in scikit-ued. Fast computation of pseudo-voigt profiles is included and integrated with the polycrystalline diffraction simulation routine, based on the work by Ida et al. [16]. Calculation of thin film optical properties is also implemented, based on Tomlin [28]. Finally, a preliminary version of the non-uniform Fast Fourier Transform (NFFT) is available [11]. Additional functionality is presented in the documentation.

Common features

31All three libraries presented herein benefit from some common features and development tools.

32First and foremost, all three packages are documented online (offline documentation is also available). Reference documentation is automatically generated from the source code, which limits the possibility of documentation being out-of-date with respect to the source code [23]. The documentation for all three packages also includes hand-written tutorials. The documentation for each package is hosted online by Read the Docs and links are specified in see "Availability of data and materials" section.

33The repositories are hosted on GitHub, a web-based code hosting service with built-in version control through Git. As the packages are free and open-source, GitHub can be used to browse source code. It also provides features not available through Git itself, most importantly an issue tracker. This issue tracker is also directly accessible from the iris GUI through a help menu. Bugs and issues raised through GitHub are publicly visible and provide a place to discuss potential solutions.

34After changes are committed to one of the repositories, the updated package is automatically installed and tested in a remote environment-a practice known as continuous integration. Committed changes also trigger the automatic generation of a new documentation version, which is then posted online within minutes. Finally, stable versions of all three packages are uploaded to the Python Packaging Index (PyPI), where they can be inspected and downloaded. For users of the Anaconda Python distribution, the three packages are also available for install within the conda environment, which provides pre-compiled packages.

Roadmap

35The natural progression for iris involves data exploration along different dimensions beyond time: diffracted intensity along dimensions of fluence, temperature, doping concentration, and more.

36The target functionality of npstreams has largely been implemented. The obvious key improvement concerns performance, which could be increased by rewriting the core functionality in C, while exploiting numpy's C interface.

37Future developments of scikit-ued concern the simulation subpackage. Simulation of polycrystalline scattering pattern is indispensable as a tool to test methods and validate hypotheses; simulation of single-crystal scattering patterns is a natural evolution of scikit-ued's capabilities. While the basic parametrizations of atomic properties are already implemented, as well as the computation of real-space electrostatic potential of arbitrary crystal structures (see Fig. 9), wave-propagation calculations-e.g., the multislice algorithm-remain to be implemented. See [25] for a summary of available electron scattering and microscopy simulation tools to which scikit-ued could bind.

Conclusion

38An ecosystem of three free and open-source Python packages for exploring ultrafast electron scattering data was presented. This ecosystem, governed by permissive licenses, was created with collaboration in mind, while adhering to sane software development practice. We introduced npstreams, a streaming array-processing library that allows for constant-memory data reduction. Scikit-ued, a scipy extension that contains algorithms and data structures for the analysis of UES data, was also presented. Finally, the ecosystem culminates in the iris package, the first integrated data exploration interface specifically tailored to the data-rich nature of UES. Iris' plug-in functionality as well as real-time, interactive capabilities pushes the limits of what is possible in field of ultrafast electron scattering.

참고문헌 34건

  1. Masked Object Registration in the Fourier Domain IEEE Transactions on Image Processing · Institute of Electrical and Electronics Engineers · 2011 10.1109/tip.2011.2181402
  2. Budget Malaise May Hit DOE's One Big Growth Area Science · American Association for the Advancement of Science · 2013 10.1126/science.341.6141.19
  3. Extended pseudo-Voigt function for approximating the Voigt profile Journal of Applied Crystallography · Wiley · 2000 10.1107/s0021889800010219
  4. CIF2Cell: Generating geometries for electronic structure programs Computer Physics Communications · Elsevier BV · 2011 10.1016/j.cpc.2011.01.013
  5. Accelerating the Nonuniform Fast Fourier Transform SIAM Review · Society for Industrial and Applied Mathematics · 2004 10.1137/s003614450343200x
  6. scikit-image: image processing in Python PeerJ · PeerJ, Inc. · 2014 10.7717/peerj.453
  7. Crystal structure of dense nanocrystalline BaTiO3 ceramics Materials Chemistry and Physics · Elsevier BV · 2008 10.1016/j.matchemphys.2008.01.020
  8. Advanced Computing in Electron Microscopy Springer eBooks · Springer Nature · 2020 10.1007/978-3-030-33260-0
  9. A photoinduced metal-like phase of monoclinic VO <sub>2</sub> revealed by ultrafast electron diffraction Science · American Association for the Advancement of Science · 2014 10.1126/science.1253779
  10. An Iterative Algorithm for Background Removal in Spectroscopy by Wavelet Transforms Applied Spectroscopy · SAGE Publishing · 2009 10.1366/000370209790108905
  11. Simulation of annular dark field stem images using a modified multislice method Ultramicroscopy · Elsevier BV · 1987 10.1016/0304-3991(87)90229-4
  12. Optical reflection and transmission formulae for thin films Journal of Physics D Applied Physics · Institute of Physics · 1968 10.1088/0022-3727/1/12/312
  13. Updating mean and variance estimates Communications of the ACM · Association for Computing Machinery · 1979 10.1145/359146.359153
  14. Scikit-learn: Machine Learning in Python arXiv (Cornell University) · Cornell University · 2012 10.48550/arxiv.1201.0490
  15. Crystallography Open Database (COD): an open-access collection of crystal structures and platform for world-wide collaboration Nucleic Acids Research · Oxford University Press · 2011 10.1093/nar/gkr900
  16. Cython: The Best of Both Worlds Computing in Science & Engineering · AIP Publishing · 2010 10.1109/mcse.2010.118
  17. Time-domain separation of optical properties from structural transitions in resonantly bonded materials Nature Materials · Nature Portfolio · 2015 10.1038/nmat4359
  18. Mapping molecular motions leading to charge delocalization with ultrabright electrons Nature · Nature Portfolio · 2013 10.1038/nature12044
  19. A validating CIF parser:<i>PyCIFRW</i> Journal of Applied Crystallography · Wiley · 2006 10.1107/s0021889806015627
  20. The Protein Data Bank Nucleic Acids Research · Oxford University Press · 2000 10.1093/nar/28.1.235
  21. The NumPy Array: A Structure for Efficient Numerical Computation Computing in Science & Engineering · AIP Publishing · 2011 10.1109/mcse.2011.37
  22. Crowdsourcing Scientific Software Documentation: A Case Study of the NumPy Documentation Project Computing in Science & Engineering · AIP Publishing · 2014 10.1109/mcse.2014.93
  23. PDB file parser and structure class implemented in Python Bioinformatics · Oxford University Press · 2003 10.1093/bioinformatics/btg299
  24. Crystallography Open Database – an open-access collection of crystal structures Journal of Applied Crystallography · Wiley · 2009 10.1107/s0021889809016690
  25. Algorithms for deriving crystallographic space-group information Acta Crystallographica Section A Foundations of Crystallography · Wiley · 1999 10.1107/s0108767398010186
  26. Multi-slice approaches Elsevier eBooks · Elsevier BV · 1995 10.1016/b978-044482218-5/50013-4
  27. Diffractive Imaging of Coherent Nuclear Motion in Isolated Molecules Physical Review Letters · American Physical Society · 2016 10.1103/physrevlett.117.153002
  28. A general method for baseline-removal in ultrafast electron powder diffraction data using the dual-tree complex wavelet transform Structural Dynamics · AIP Publishing · 2016 10.1063/1.4972518
  29. The atomic simulation environment—a Python library for working with atoms Journal of Physics Condensed Matter · IOP Publishing · 2017 10.1088/1361-648x/aa680e
  30. Momentum-Resolved View of Electron-Phonon Coupling in Multilayer <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" display="inline"><mml:msub><mml:mi>WSe</mml:mi><mml:mn>2</mml:mn></mml:msub></mml:math> Physical Review Letters · American Physical Society · 2017 10.1103/physrevlett.119.036803
  31. A streaming multi-GPU implementation of image simulation algorithms for scanning transmission electron microscopy Advanced Structural and Chemical Imaging · Springer Science+Business Media · 2017 10.1186/s40679-017-0048-z
  32. Mapping momentum-dependent electron-phonon coupling and nonequilibrium phonon dynamics with ultrafast electron diffuse scattering Physical review. B./Physical review. B · American Physical Society · 2018 10.1103/physrevb.97.165416
  33. Deleted Work 1955
  34. Advanced Computing in Electron Microscopy 2010 10.1007/978-1-4419-6533-2