pytxs 0.0.1__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.
- pytxs-0.0.1/.flake8 +17 -0
- pytxs-0.0.1/LICENSE.rst +32 -0
- pytxs-0.0.1/MANIFEST.in +6 -0
- pytxs-0.0.1/PKG-INFO +80 -0
- pytxs-0.0.1/README.rst +54 -0
- pytxs-0.0.1/docs/Makefile +19 -0
- pytxs-0.0.1/docs/fig/fig_plot_diffs.png +0 -0
- pytxs-0.0.1/docs/fig/fig_setup_beamline.png +0 -0
- pytxs-0.0.1/docs/fig/fig_txs_plot_abs.png +0 -0
- pytxs-0.0.1/docs/fig/fig_txs_plot_azim_regroup.png +0 -0
- pytxs-0.0.1/docs/make.bat +35 -0
- pytxs-0.0.1/docs/source/analysis.rst +23 -0
- pytxs-0.0.1/docs/source/conf.py +182 -0
- pytxs-0.0.1/docs/source/datared.rst +67 -0
- pytxs-0.0.1/docs/source/help.rst +5 -0
- pytxs-0.0.1/docs/source/import.rst +140 -0
- pytxs-0.0.1/docs/source/index.rst +138 -0
- pytxs-0.0.1/docs/source/license.rst +32 -0
- pytxs-0.0.1/docs/source/mask.rst +39 -0
- pytxs-0.0.1/docs/source/reference/analysis/index.rst +9 -0
- pytxs-0.0.1/docs/source/reference/analysis/plot.rst +5 -0
- pytxs-0.0.1/docs/source/reference/analysis/svd.rst +5 -0
- pytxs-0.0.1/docs/source/reference/analysis/utils.rst +5 -0
- pytxs-0.0.1/docs/source/reference/azav.rst +5 -0
- pytxs-0.0.1/docs/source/reference/common.rst +5 -0
- pytxs-0.0.1/docs/source/reference/corr.rst +5 -0
- pytxs-0.0.1/docs/source/reference/datared.rst +5 -0
- pytxs-0.0.1/docs/source/reference/datasets.rst +6 -0
- pytxs-0.0.1/docs/source/reference/heating.rst +5 -0
- pytxs-0.0.1/docs/source/reference/live.rst +5 -0
- pytxs-0.0.1/docs/source/reference/plot.rst +5 -0
- pytxs-0.0.1/docs/source/reference/utils.rst +5 -0
- pytxs-0.0.1/docs/source/reference.rst +16 -0
- pytxs-0.0.1/pyproject.toml +61 -0
- pytxs-0.0.1/pytxs.egg-info/PKG-INFO +80 -0
- pytxs-0.0.1/pytxs.egg-info/SOURCES.txt +78 -0
- pytxs-0.0.1/pytxs.egg-info/dependency_links.txt +1 -0
- pytxs-0.0.1/pytxs.egg-info/entry_points.txt +3 -0
- pytxs-0.0.1/pytxs.egg-info/requires.txt +12 -0
- pytxs-0.0.1/pytxs.egg-info/top_level.txt +1 -0
- pytxs-0.0.1/requirements-dev.txt +21 -0
- pytxs-0.0.1/setup.cfg +4 -0
- pytxs-0.0.1/setup.py +15 -0
- pytxs-0.0.1/txs/__init__.py +53 -0
- pytxs-0.0.1/txs/_version.py +21 -0
- pytxs-0.0.1/txs/analysis/__init__.py +0 -0
- pytxs-0.0.1/txs/analysis/plot.py +299 -0
- pytxs-0.0.1/txs/analysis/svd.py +331 -0
- pytxs-0.0.1/txs/analysis/utils.py +473 -0
- pytxs-0.0.1/txs/app/MainWindow.py +515 -0
- pytxs-0.0.1/txs/app/PlotBase.py +87 -0
- pytxs-0.0.1/txs/app/PlotHeatmap.py +145 -0
- pytxs-0.0.1/txs/app/ProcessWorker.py +138 -0
- pytxs-0.0.1/txs/app/__init__.py +0 -0
- pytxs-0.0.1/txs/app/__main__.py +118 -0
- pytxs-0.0.1/txs/app/actions.py +78 -0
- pytxs-0.0.1/txs/app/mainwindow.ui +2118 -0
- pytxs-0.0.1/txs/app/plot.py +448 -0
- pytxs-0.0.1/txs/app/tests/test_ProcessWorker.py +57 -0
- pytxs-0.0.1/txs/app/utils.py +41 -0
- pytxs-0.0.1/txs/app/widgets.py +60 -0
- pytxs-0.0.1/txs/azav.py +1031 -0
- pytxs-0.0.1/txs/common.py +52 -0
- pytxs-0.0.1/txs/corr.py +152 -0
- pytxs-0.0.1/txs/datared.py +825 -0
- pytxs-0.0.1/txs/datasets.py +1124 -0
- pytxs-0.0.1/txs/detectors/__init__.py +0 -0
- pytxs-0.0.1/txs/detectors/jungfrau.py +675 -0
- pytxs-0.0.1/txs/heating.py +268 -0
- pytxs-0.0.1/txs/live.py +378 -0
- pytxs-0.0.1/txs/plot.py +1234 -0
- pytxs-0.0.1/txs/tests/conftest.py +36 -0
- pytxs-0.0.1/txs/tests/test_azav.py +100 -0
- pytxs-0.0.1/txs/tests/test_corr.py +0 -0
- pytxs-0.0.1/txs/tests/test_datared.py +26 -0
- pytxs-0.0.1/txs/tests/test_datasets.py +61 -0
- pytxs-0.0.1/txs/tests/test_utils.py +15 -0
- pytxs-0.0.1/txs/utils.py +835 -0
- pytxs-0.0.1/txs/xes.py +38 -0
- pytxs-0.0.1/versioneer.py +2277 -0
pytxs-0.0.1/.flake8
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
[flake8]
|
|
2
|
+
ignore=E203,E303,E301,F405,E221,F403,E251,E902,W503,W504,E731,W605,F401
|
|
3
|
+
exclude=
|
|
4
|
+
.git,
|
|
5
|
+
__pycache__,
|
|
6
|
+
conf.py,
|
|
7
|
+
old,
|
|
8
|
+
build,
|
|
9
|
+
dist,
|
|
10
|
+
deprecated,
|
|
11
|
+
*/tests/*,
|
|
12
|
+
setup.py,
|
|
13
|
+
conf.py,
|
|
14
|
+
.coveragerc,
|
|
15
|
+
__main__.py,
|
|
16
|
+
*__init__.py,
|
|
17
|
+
venv*
|
pytxs-0.0.1/LICENSE.rst
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
License
|
|
2
|
+
===============================================================================
|
|
3
|
+
|
|
4
|
+
txs
|
|
5
|
+
-------------------------------------------------------------------------------
|
|
6
|
+
|
|
7
|
+
txs is available under the `MIT License`_::
|
|
8
|
+
|
|
9
|
+
txs: time-resolved x-ray scattering/spectroscopy data analysis tools
|
|
10
|
+
|
|
11
|
+
Copyright (C) 2021-2022 ESRF - The European Synchrotron, Grenoble, France
|
|
12
|
+
|
|
13
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
14
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
15
|
+
in the Software without restriction, including without limitation the rights
|
|
16
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
17
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
18
|
+
furnished to do so, subject to the following conditions:
|
|
19
|
+
|
|
20
|
+
The above copyright notice and this permission notice shall be included in
|
|
21
|
+
all copies or substantial portions of the Software.
|
|
22
|
+
|
|
23
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
24
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
25
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
26
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
27
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
28
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
29
|
+
THE SOFTWARE.
|
|
30
|
+
|
|
31
|
+
.. _MIT License: http://opensource.org/licenses/MIT
|
|
32
|
+
|
pytxs-0.0.1/MANIFEST.in
ADDED
pytxs-0.0.1/PKG-INFO
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: pytxs
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Summary: time-resolved x-ray scattering
|
|
5
|
+
Author-email: Matteo Levantino <matteo.levantino@esrf.fr>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://gitlab.esrf.fr/levantin/txs
|
|
8
|
+
Classifier: Intended Audience :: Science/Research
|
|
9
|
+
Classifier: Topic :: Scientific/Engineering :: Physics
|
|
10
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Requires-Python: >=3.8
|
|
13
|
+
Description-Content-Type: text/x-rst
|
|
14
|
+
License-File: LICENSE.rst
|
|
15
|
+
Requires-Dist: numpy>=1.10
|
|
16
|
+
Requires-Dist: h5py>3.0
|
|
17
|
+
Requires-Dist: tqdm
|
|
18
|
+
Requires-Dist: fabio
|
|
19
|
+
Requires-Dist: pyFAI
|
|
20
|
+
Requires-Dist: xraydb>=4.3.4
|
|
21
|
+
Requires-Dist: datastorage
|
|
22
|
+
Provides-Extra: gui
|
|
23
|
+
Requires-Dist: PyQt5; extra == "gui"
|
|
24
|
+
Requires-Dist: matplotlib; extra == "gui"
|
|
25
|
+
Requires-Dist: silx; extra == "gui"
|
|
26
|
+
|
|
27
|
+
====
|
|
28
|
+
txs
|
|
29
|
+
====
|
|
30
|
+
|
|
31
|
+
**txs** is a free and open-source python package for the analysis
|
|
32
|
+
of time-resolved x-ray scattering/spectroscopy data.
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
GETTING txs
|
|
36
|
+
------------
|
|
37
|
+
|
|
38
|
+
You can run txs on all major platforms. For download and installation:
|
|
39
|
+
|
|
40
|
+
.. code-block:: bash
|
|
41
|
+
|
|
42
|
+
pip install git+https://gitlab.esrf.fr/levantin/txs.git
|
|
43
|
+
|
|
44
|
+
For installing a specific version (e.g. version 0.1.0):
|
|
45
|
+
|
|
46
|
+
.. code-block:: bash
|
|
47
|
+
|
|
48
|
+
pip install git+https://gitlab.esrf.fr/levantin/txs.git@0.1.0
|
|
49
|
+
|
|
50
|
+
For upgrading txs to the last version/commit:
|
|
51
|
+
|
|
52
|
+
.. code-block:: bash
|
|
53
|
+
|
|
54
|
+
pip install --upgrade git+https://gitlab.esrf.fr/levantin/txs.git
|
|
55
|
+
|
|
56
|
+
For forcing the reinstallation of all packages (including dependencies):
|
|
57
|
+
|
|
58
|
+
.. code-block:: bash
|
|
59
|
+
|
|
60
|
+
pip install --force-reinstall git+https://gitlab.esrf.fr/levantin/txs.git
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
DOCUMENTATION
|
|
64
|
+
-------------
|
|
65
|
+
|
|
66
|
+
* Homepage: https://levantin.gitlab-pages.esrf.fr/txs
|
|
67
|
+
* Quick guide: https://confluence.esrf.fr/display/ID09KB/txs+Python+package
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
SOURCE CODE
|
|
71
|
+
-----------
|
|
72
|
+
|
|
73
|
+
* Source code: https://gitlab.esrf.fr/levantin/txs
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
LICENSE
|
|
77
|
+
-------
|
|
78
|
+
|
|
79
|
+
txs is available under MIT License. See LICENSE.rst for more details.
|
|
80
|
+
|
pytxs-0.0.1/README.rst
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
====
|
|
2
|
+
txs
|
|
3
|
+
====
|
|
4
|
+
|
|
5
|
+
**txs** is a free and open-source python package for the analysis
|
|
6
|
+
of time-resolved x-ray scattering/spectroscopy data.
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
GETTING txs
|
|
10
|
+
------------
|
|
11
|
+
|
|
12
|
+
You can run txs on all major platforms. For download and installation:
|
|
13
|
+
|
|
14
|
+
.. code-block:: bash
|
|
15
|
+
|
|
16
|
+
pip install git+https://gitlab.esrf.fr/levantin/txs.git
|
|
17
|
+
|
|
18
|
+
For installing a specific version (e.g. version 0.1.0):
|
|
19
|
+
|
|
20
|
+
.. code-block:: bash
|
|
21
|
+
|
|
22
|
+
pip install git+https://gitlab.esrf.fr/levantin/txs.git@0.1.0
|
|
23
|
+
|
|
24
|
+
For upgrading txs to the last version/commit:
|
|
25
|
+
|
|
26
|
+
.. code-block:: bash
|
|
27
|
+
|
|
28
|
+
pip install --upgrade git+https://gitlab.esrf.fr/levantin/txs.git
|
|
29
|
+
|
|
30
|
+
For forcing the reinstallation of all packages (including dependencies):
|
|
31
|
+
|
|
32
|
+
.. code-block:: bash
|
|
33
|
+
|
|
34
|
+
pip install --force-reinstall git+https://gitlab.esrf.fr/levantin/txs.git
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
DOCUMENTATION
|
|
38
|
+
-------------
|
|
39
|
+
|
|
40
|
+
* Homepage: https://levantin.gitlab-pages.esrf.fr/txs
|
|
41
|
+
* Quick guide: https://confluence.esrf.fr/display/ID09KB/txs+Python+package
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
SOURCE CODE
|
|
45
|
+
-----------
|
|
46
|
+
|
|
47
|
+
* Source code: https://gitlab.esrf.fr/levantin/txs
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
LICENSE
|
|
51
|
+
-------
|
|
52
|
+
|
|
53
|
+
txs is available under MIT License. See LICENSE.rst for more details.
|
|
54
|
+
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Minimal makefile for Sphinx documentation
|
|
2
|
+
#
|
|
3
|
+
|
|
4
|
+
# You can set these variables from the command line.
|
|
5
|
+
SPHINXOPTS =
|
|
6
|
+
SPHINXBUILD = sphinx-build
|
|
7
|
+
SOURCEDIR = source
|
|
8
|
+
BUILDDIR = build
|
|
9
|
+
|
|
10
|
+
# Put it first so that "make" without argument is like "make help".
|
|
11
|
+
help:
|
|
12
|
+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
|
13
|
+
|
|
14
|
+
.PHONY: help Makefile
|
|
15
|
+
|
|
16
|
+
# Catch-all target: route all unknown targets to Sphinx using the new
|
|
17
|
+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
|
|
18
|
+
%: Makefile
|
|
19
|
+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
@ECHO OFF
|
|
2
|
+
|
|
3
|
+
pushd %~dp0
|
|
4
|
+
|
|
5
|
+
REM Command file for Sphinx documentation
|
|
6
|
+
|
|
7
|
+
if "%SPHINXBUILD%" == "" (
|
|
8
|
+
set SPHINXBUILD=sphinx-build
|
|
9
|
+
)
|
|
10
|
+
set SOURCEDIR=source
|
|
11
|
+
set BUILDDIR=build
|
|
12
|
+
|
|
13
|
+
if "%1" == "" goto help
|
|
14
|
+
|
|
15
|
+
%SPHINXBUILD% >NUL 2>NUL
|
|
16
|
+
if errorlevel 9009 (
|
|
17
|
+
echo.
|
|
18
|
+
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
|
|
19
|
+
echo.installed, then set the SPHINXBUILD environment variable to point
|
|
20
|
+
echo.to the full path of the 'sphinx-build' executable. Alternatively you
|
|
21
|
+
echo.may add the Sphinx directory to PATH.
|
|
22
|
+
echo.
|
|
23
|
+
echo.If you don't have Sphinx installed, grab it from
|
|
24
|
+
echo.http://sphinx-doc.org/
|
|
25
|
+
exit /b 1
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
|
|
29
|
+
goto end
|
|
30
|
+
|
|
31
|
+
:help
|
|
32
|
+
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
|
|
33
|
+
|
|
34
|
+
:end
|
|
35
|
+
popd
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
Analyze the processed data
|
|
2
|
+
==========================
|
|
3
|
+
|
|
4
|
+
.. note::
|
|
5
|
+
|
|
6
|
+
The following code snippets assumes that you have processed the
|
|
7
|
+
data using the procedure described earlier in the
|
|
8
|
+
:doc:`previous section <datared>`.
|
|
9
|
+
|
|
10
|
+
Subtract the heating signal
|
|
11
|
+
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
12
|
+
|
|
13
|
+
.. code:: python
|
|
14
|
+
|
|
15
|
+
import txs
|
|
16
|
+
|
|
17
|
+
ai = txs.get_ai(
|
|
18
|
+
15e3, # the incoming X-ray energy (in eV)
|
|
19
|
+
0.15, # the sample-to-detector distance (in m)
|
|
20
|
+
center=(968, 969), # the beam center on the detector (in pixels)
|
|
21
|
+
detector='rayonix', # the detector being used
|
|
22
|
+
binning=(2, 2), # the pixel binning being used
|
|
23
|
+
)
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
#
|
|
3
|
+
# Configuration file for the Sphinx documentation builder.
|
|
4
|
+
#
|
|
5
|
+
# This file does only contain a selection of the most common options. For a
|
|
6
|
+
# full list see the documentation:
|
|
7
|
+
# http://www.sphinx-doc.org/en/master/config
|
|
8
|
+
|
|
9
|
+
# -- Path setup --------------------------------------------------------------
|
|
10
|
+
|
|
11
|
+
# If extensions (or modules to document with autodoc) are in another directory,
|
|
12
|
+
# add these directories to sys.path here. If the directory is relative to the
|
|
13
|
+
# documentation root, use os.path.abspath to make it absolute, like shown here.
|
|
14
|
+
#
|
|
15
|
+
import os
|
|
16
|
+
import sys
|
|
17
|
+
sys.path.insert(0, os.path.abspath('../..'))
|
|
18
|
+
sys.path.insert(0, os.path.abspath('../../txs'))
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
# -- Project information -----------------------------------------------------
|
|
22
|
+
|
|
23
|
+
project = 'txs'
|
|
24
|
+
copyright = '2023, Matteo Levantino'
|
|
25
|
+
author = 'Matteo Levantino'
|
|
26
|
+
|
|
27
|
+
# The short X.Y version
|
|
28
|
+
version = ''
|
|
29
|
+
# The full version, including alpha/beta/rc tags
|
|
30
|
+
release = '0.0.1'
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
# -- General configuration ---------------------------------------------------
|
|
34
|
+
|
|
35
|
+
# If your documentation needs a minimal Sphinx version, state it here.
|
|
36
|
+
#
|
|
37
|
+
# needs_sphinx = '1.0'
|
|
38
|
+
|
|
39
|
+
# Add any Sphinx extension module names here, as strings. They can be
|
|
40
|
+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
|
|
41
|
+
# ones.
|
|
42
|
+
extensions = [
|
|
43
|
+
'sphinx.ext.autodoc',
|
|
44
|
+
'sphinx.ext.viewcode',
|
|
45
|
+
'sphinx.ext.napoleon',
|
|
46
|
+
'sphinx_rtd_theme',
|
|
47
|
+
'sphinx_copybutton',
|
|
48
|
+
]
|
|
49
|
+
|
|
50
|
+
# Add any paths that contain templates here, relative to this directory.
|
|
51
|
+
templates_path = ['_templates']
|
|
52
|
+
|
|
53
|
+
# The suffix(es) of source filenames.
|
|
54
|
+
# You can specify multiple suffix as a list of string:
|
|
55
|
+
#
|
|
56
|
+
# source_suffix = ['.rst', '.md']
|
|
57
|
+
source_suffix = '.rst'
|
|
58
|
+
|
|
59
|
+
# The master toctree document.
|
|
60
|
+
master_doc = 'index'
|
|
61
|
+
|
|
62
|
+
# The language for content autogenerated by Sphinx. Refer to documentation
|
|
63
|
+
# for a list of supported languages.
|
|
64
|
+
#
|
|
65
|
+
# This is also used if you do content translation via gettext catalogs.
|
|
66
|
+
# Usually you set "language" from the command line for these cases.
|
|
67
|
+
language = 'en'
|
|
68
|
+
|
|
69
|
+
# List of patterns, relative to source directory, that match files and
|
|
70
|
+
# directories to ignore when looking for source files.
|
|
71
|
+
# This pattern also affects html_static_path and html_extra_path.
|
|
72
|
+
exclude_patterns = []
|
|
73
|
+
|
|
74
|
+
# The name of the Pygments (syntax highlighting) style to use.
|
|
75
|
+
pygments_style = None
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
# -- Options for HTML output -------------------------------------------------
|
|
79
|
+
|
|
80
|
+
# The theme to use for HTML and HTML Help pages. See the documentation for
|
|
81
|
+
# a list of builtin themes.
|
|
82
|
+
#
|
|
83
|
+
html_theme = 'sphinx_rtd_theme'
|
|
84
|
+
|
|
85
|
+
# Theme options are theme-specific and customize the look and feel of a theme
|
|
86
|
+
# further. For a list of options available for each theme, see the
|
|
87
|
+
# documentation.
|
|
88
|
+
#
|
|
89
|
+
# html_theme_options = {}
|
|
90
|
+
|
|
91
|
+
# Add any paths that contain custom static files (such as style sheets) here,
|
|
92
|
+
# relative to this directory. They are copied after the builtin static files,
|
|
93
|
+
# so a file named "default.css" will overwrite the builtin "default.css".
|
|
94
|
+
html_static_path = ['_static']
|
|
95
|
+
|
|
96
|
+
# Custom sidebar templates, must be a dictionary that maps document names
|
|
97
|
+
# to template names.
|
|
98
|
+
#
|
|
99
|
+
# The default sidebars (for documents that don't match any pattern) are
|
|
100
|
+
# defined by theme itself. Builtin themes are using these templates by
|
|
101
|
+
# default: ``['localtoc.html', 'relations.html', 'sourcelink.html',
|
|
102
|
+
# 'searchbox.html']``.
|
|
103
|
+
#
|
|
104
|
+
# html_sidebars = {}
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
# -- Options for HTMLHelp output ---------------------------------------------
|
|
108
|
+
|
|
109
|
+
# Output file base name for HTML help builder.
|
|
110
|
+
htmlhelp_basename = 'txsdoc'
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
# -- Options for LaTeX output ------------------------------------------------
|
|
114
|
+
|
|
115
|
+
latex_elements = {
|
|
116
|
+
# The paper size ('letterpaper' or 'a4paper').
|
|
117
|
+
#
|
|
118
|
+
# 'papersize': 'letterpaper',
|
|
119
|
+
|
|
120
|
+
# The font size ('10pt', '11pt' or '12pt').
|
|
121
|
+
#
|
|
122
|
+
# 'pointsize': '10pt',
|
|
123
|
+
|
|
124
|
+
# Additional stuff for the LaTeX preamble.
|
|
125
|
+
#
|
|
126
|
+
# 'preamble': '',
|
|
127
|
+
|
|
128
|
+
# Latex figure (float) alignment
|
|
129
|
+
#
|
|
130
|
+
# 'figure_align': 'htbp',
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
# Grouping the document tree into LaTeX files. List of tuples
|
|
134
|
+
# (source start file, target name, title,
|
|
135
|
+
# author, documentclass [howto, manual, or own class]).
|
|
136
|
+
latex_documents = [
|
|
137
|
+
(master_doc, 'txs.tex', 'txs Documentation',
|
|
138
|
+
'Matteo Levantino', 'manual'),
|
|
139
|
+
]
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
# -- Options for manual page output ------------------------------------------
|
|
143
|
+
|
|
144
|
+
# One entry per manual page. List of tuples
|
|
145
|
+
# (source start file, name, description, authors, manual section).
|
|
146
|
+
man_pages = [
|
|
147
|
+
(master_doc, 'txs', 'txs Documentation',
|
|
148
|
+
[author], 1)
|
|
149
|
+
]
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
# -- Options for Texinfo output ----------------------------------------------
|
|
153
|
+
|
|
154
|
+
# Grouping the document tree into Texinfo files. List of tuples
|
|
155
|
+
# (source start file, target name, title, author,
|
|
156
|
+
# dir menu entry, description, category)
|
|
157
|
+
texinfo_documents = [
|
|
158
|
+
(master_doc, 'txs', 'txs Documentation',
|
|
159
|
+
author, 'txs', 'One line description of project.',
|
|
160
|
+
'Miscellaneous'),
|
|
161
|
+
]
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
# -- Options for Epub output -------------------------------------------------
|
|
165
|
+
|
|
166
|
+
# Bibliographic Dublin Core info.
|
|
167
|
+
epub_title = project
|
|
168
|
+
|
|
169
|
+
# The unique identifier of the text. This can be a ISBN number
|
|
170
|
+
# or the project homepage.
|
|
171
|
+
#
|
|
172
|
+
# epub_identifier = ''
|
|
173
|
+
|
|
174
|
+
# A unique identification for the text.
|
|
175
|
+
#
|
|
176
|
+
# epub_uid = ''
|
|
177
|
+
|
|
178
|
+
# A list of files that should not be packed into the epub file.
|
|
179
|
+
epub_exclude_files = ['search.html']
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
# -- Extension configuration -------------------------------------------------
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
Data reduction
|
|
2
|
+
==============
|
|
3
|
+
|
|
4
|
+
The data reduction methods in the :py:mod:`datared` allow to obtain
|
|
5
|
+
X-ray scattering difference patterns based on the result of the azimuthal
|
|
6
|
+
integration as obtained in the :doc:`previous section <import>`.
|
|
7
|
+
|
|
8
|
+
The data reduction proceeds as follows:
|
|
9
|
+
|
|
10
|
+
#. Identify each scattering pattern with its associated time delay.
|
|
11
|
+
#. Normalize each pattern based on the signal in a given q region.
|
|
12
|
+
#. Computes the differences by subtracting the reference signal to each pattern.
|
|
13
|
+
#. Computes the average of the differences for each time delay.
|
|
14
|
+
#. Optionally, apply a filter to discard outliers.
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
Performing data reduction
|
|
18
|
+
^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
19
|
+
Most of the work done by the :py:func:`datared.datared` function is automatic
|
|
20
|
+
and the function can be used as follows:
|
|
21
|
+
|
|
22
|
+
.. code:: python
|
|
23
|
+
|
|
24
|
+
import txs
|
|
25
|
+
|
|
26
|
+
# from previous section
|
|
27
|
+
dset = ...
|
|
28
|
+
azav = ...
|
|
29
|
+
|
|
30
|
+
dred = txs.datared.datared(azav, "<your reference delay, e.g. '-20us'>")
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
Plot the result
|
|
34
|
+
^^^^^^^^^^^^^^^
|
|
35
|
+
Helper functions are available in :py:mod:`plot` to quickly plot the
|
|
36
|
+
data. For the difference patterns, :py:func:`plot.plot_diffs` may be used.
|
|
37
|
+
|
|
38
|
+
.. code:: python
|
|
39
|
+
|
|
40
|
+
txs.plot_diffs(dred)
|
|
41
|
+
|
|
42
|
+
Resulting in a `matplotlib <https://matplotlib.org/>`_ figure:
|
|
43
|
+
|
|
44
|
+
.. image:: ../fig/fig_plot_diffs.png
|
|
45
|
+
:width: 600
|
|
46
|
+
:alt: Difference patterns at various time delays
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
The resulting *dred* object
|
|
50
|
+
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
51
|
+
The *dred* object is a Python dictionary containing the reduced dataset as well
|
|
52
|
+
the content of the *azav* object generated in the `last section <import>`_
|
|
53
|
+
|
|
54
|
+
The import entries are:
|
|
55
|
+
|
|
56
|
+
* *q*, the scattering angle amplitudes vector.
|
|
57
|
+
* *t*, the time delays as strings.
|
|
58
|
+
* | *diff_av*, the averaged - and potentially filtered - difference patterns
|
|
59
|
+
| for each time delay. The axes of the array are (q, time delays).
|
|
60
|
+
* *diff_err*, the errors associated with *diff_av*.
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
Additional options
|
|
64
|
+
^^^^^^^^^^^^^^^^^^
|
|
65
|
+
.. toctree::
|
|
66
|
+
:maxdepth: 1
|
|
67
|
+
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
Import and inspect data
|
|
2
|
+
=======================
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
Creating an azimuthal integrator
|
|
6
|
+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
7
|
+
The txs software makes use of
|
|
8
|
+
`pyFAI <https://pyfai.readthedocs.io/en/v2023.1/>`_
|
|
9
|
+
to perform the azimuthal integration on the images.
|
|
10
|
+
|
|
11
|
+
Hence, the first step to process your data is to create a so-called
|
|
12
|
+
`AzimuthalIntegrator <https://pyfai.readthedocs.io/en/v2023.1/api/pyFAI.html#module-pyFAI.azimuthalIntegrator>`_
|
|
13
|
+
object.
|
|
14
|
+
|
|
15
|
+
The azimuthal integrator takes information about the detector and the
|
|
16
|
+
geometry of the setup to compute the position of the pixels corresponding
|
|
17
|
+
to the same scattering angle.
|
|
18
|
+
|
|
19
|
+
In txs, the :py:func:`utils.get_ai` helper function is provided to ease
|
|
20
|
+
the creation of this object:
|
|
21
|
+
|
|
22
|
+
.. code:: python
|
|
23
|
+
|
|
24
|
+
import txs
|
|
25
|
+
|
|
26
|
+
ai = txs.get_ai(
|
|
27
|
+
15e3, # the incoming X-ray energy (in eV)
|
|
28
|
+
0.15, # the sample-to-detector distance (in m)
|
|
29
|
+
center=(968, 969), # the beam center on the detector (in pixels)
|
|
30
|
+
detector='rayonix', # the detector being used
|
|
31
|
+
binning=(2, 2), # the pixel binning being used
|
|
32
|
+
)
|
|
33
|
+
|
|
34
|
+
.. note::
|
|
35
|
+
|
|
36
|
+
The creation of the AzimuthalIntegrator object is expected to be
|
|
37
|
+
automatized in the future on ID09 at the ESRF by using the metadata
|
|
38
|
+
that are recorded during the experiment.
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
Using .edf files (old setup)
|
|
42
|
+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
43
|
+
Prior to the installation of BLISS software at the ESRF, the detector
|
|
44
|
+
images were recorded in the .edf file format.
|
|
45
|
+
|
|
46
|
+
The raw images can be visualized using the
|
|
47
|
+
`FabIO viewer <https://www.silx.org/doc/fabio/latest/man/fabio_viewer.html>`_.
|
|
48
|
+
|
|
49
|
+
To perform the **azimuthal integration** for these experiments,
|
|
50
|
+
the :py:func:`azav.integrate1d_dataset` function is
|
|
51
|
+
to be used by providing the data folder as well as the file extension
|
|
52
|
+
as such:
|
|
53
|
+
|
|
54
|
+
.. code:: python
|
|
55
|
+
|
|
56
|
+
azav = txs.int1d_dset(
|
|
57
|
+
"<data_folder>", # the scan folder containing the images
|
|
58
|
+
ai, # the previously created AzimuthalIntegrator object
|
|
59
|
+
extension="edf",
|
|
60
|
+
method='csr_ocl', # faster, multi-threaded integration
|
|
61
|
+
sample_thickness=1.2e-3, # sample thickness in m (for transmission)
|
|
62
|
+
sample_material='H2O'
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
Using BLISS dataset
|
|
67
|
+
^^^^^^^^^^^^^^^^^^^
|
|
68
|
+
The folder hierarchy in BLISS and associated HDF5 files makes possible to
|
|
69
|
+
access the data in multiple ways.
|
|
70
|
+
The recommanded method is to import the 'dataset' HDF5 file using the
|
|
71
|
+
:py:class:`datasets.BlissDataset` class:
|
|
72
|
+
|
|
73
|
+
.. code:: python
|
|
74
|
+
|
|
75
|
+
dset = txs.BlissDataset(
|
|
76
|
+
"path_to/<sample_name>_<dataset_number>.h5"
|
|
77
|
+
)
|
|
78
|
+
|
|
79
|
+
The resulting *dset* object is an iterator over the scans and the images which
|
|
80
|
+
contains also metadata related to the experiment:
|
|
81
|
+
|
|
82
|
+
.. code:: python
|
|
83
|
+
|
|
84
|
+
dset.scans # -> ['1.1', '1.2', '2.1', '3.1',...]
|
|
85
|
+
|
|
86
|
+
# to obtain the metadata for scans '1.2'
|
|
87
|
+
dset.metdata(1, 2)
|
|
88
|
+
|
|
89
|
+
Hence, for a given scan '2.1', the images can be accessed and plotted
|
|
90
|
+
as follows:
|
|
91
|
+
|
|
92
|
+
.. code:: python
|
|
93
|
+
|
|
94
|
+
import matplotlib.pyplot as plt
|
|
95
|
+
|
|
96
|
+
plt.imshow(dset["2.1"][0]) # plot the first image
|
|
97
|
+
plt.imshow(dset["2.1"][4]) # plot the fifth's image
|
|
98
|
+
|
|
99
|
+
The **azimuthal integration** is done similarly as above by using the
|
|
100
|
+
:py:func:`azav.integrate1d_dataset` function:
|
|
101
|
+
|
|
102
|
+
.. code:: python
|
|
103
|
+
|
|
104
|
+
azav = txs.azav.integrate1d_dataset(
|
|
105
|
+
dset["2.1"].folder, # the folder of scan 2.1 containing the images
|
|
106
|
+
extension='h5', # default value, so it can be ommited
|
|
107
|
+
ai, # the previously created AzimuthalIntegrator object
|
|
108
|
+
method='csr_ocl', # faster, multi-threaded integration
|
|
109
|
+
sample_thickness=1.2e-3, # sample thickness in m (for transmission)
|
|
110
|
+
sample_material='H2O'
|
|
111
|
+
)
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
The resulting *azav* object
|
|
115
|
+
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
116
|
+
The *azav* object obtained above is a Python dictionary that contains
|
|
117
|
+
the 1D scattering patterns with their associated errors as well as
|
|
118
|
+
other information about the data and the methods used to process them.
|
|
119
|
+
|
|
120
|
+
The scattering vector magnitude q, the intensities and errors are
|
|
121
|
+
contained in the `q`, `i` and `e` keys of the *azav* dictionary, respectively.
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
Plotting possibilities
|
|
125
|
+
^^^^^^^^^^^^^^^^^^^^^^
|
|
126
|
+
Some plotting functions are available to quickly plot useful information.
|
|
127
|
+
For the azimuthal integration, the function :py:func:`plot.plot_azim_regroup`
|
|
128
|
+
allows to view the projection map used by the azimuthal integrator:
|
|
129
|
+
|
|
130
|
+
.. image:: ../fig/fig_txs_plot_azim_regroup.png
|
|
131
|
+
:width: 600
|
|
132
|
+
:alt: projection map of the azimuthal integrator
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
Additional options
|
|
136
|
+
^^^^^^^^^^^^^^^^^^
|
|
137
|
+
.. toctree::
|
|
138
|
+
:maxdepth: 1
|
|
139
|
+
|
|
140
|
+
mask
|