ewoksid02 0.0.1a0__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.
- ewoksid02-0.0.1a0/LICENSE.md +20 -0
- ewoksid02-0.0.1a0/PKG-INFO +76 -0
- ewoksid02-0.0.1a0/README.md +7 -0
- ewoksid02-0.0.1a0/pyproject.toml +89 -0
- ewoksid02-0.0.1a0/setup.cfg +4 -0
- ewoksid02-0.0.1a0/src/ewoksid02/__init__.py +0 -0
- ewoksid02-0.0.1a0/src/ewoksid02/ocl/__init__.py +0 -0
- ewoksid02-0.0.1a0/src/ewoksid02/resources/__init__.py +8 -0
- ewoksid02-0.0.1a0/src/ewoksid02/resources/saxs_loop.json +80 -0
- ewoksid02-0.0.1a0/src/ewoksid02/resources/template_saxs.yaml +38 -0
- ewoksid02-0.0.1a0/src/ewoksid02/scripts/__init__.py +0 -0
- ewoksid02-0.0.1a0/src/ewoksid02/scripts/__main__.py +70 -0
- ewoksid02-0.0.1a0/src/ewoksid02/scripts/parsers.py +224 -0
- ewoksid02-0.0.1a0/src/ewoksid02/scripts/saxs/__init__.py +0 -0
- ewoksid02-0.0.1a0/src/ewoksid02/scripts/saxs/main.py +256 -0
- ewoksid02-0.0.1a0/src/ewoksid02/scripts/saxs/slurm_python_post_script.py +3 -0
- ewoksid02-0.0.1a0/src/ewoksid02/scripts/saxs/slurm_python_pre_script.py +5 -0
- ewoksid02-0.0.1a0/src/ewoksid02/scripts/utils.py +21 -0
- ewoksid02-0.0.1a0/src/ewoksid02/scripts/xpcs/__init__.py +0 -0
- ewoksid02-0.0.1a0/src/ewoksid02/scripts/xpcs/__main__.py +3 -0
- ewoksid02-0.0.1a0/src/ewoksid02/tasks/__init__.py +1 -0
- ewoksid02-0.0.1a0/src/ewoksid02/tasks/averagetask.py +178 -0
- ewoksid02-0.0.1a0/src/ewoksid02/tasks/azimuthaltask.py +288 -0
- ewoksid02-0.0.1a0/src/ewoksid02/tasks/cavingtask.py +222 -0
- ewoksid02-0.0.1a0/src/ewoksid02/tasks/id02processingtask.py +1765 -0
- ewoksid02-0.0.1a0/src/ewoksid02/tasks/looptask.py +554 -0
- ewoksid02-0.0.1a0/src/ewoksid02/tasks/normalizationtask.py +255 -0
- ewoksid02-0.0.1a0/src/ewoksid02/tasks/scalerstask.py +45 -0
- ewoksid02-0.0.1a0/src/ewoksid02/tasks/secondaryscatteringtask.py +178 -0
- ewoksid02-0.0.1a0/src/ewoksid02/tasks/sumtask.py +45 -0
- ewoksid02-0.0.1a0/src/ewoksid02/tests/__init__.py +3 -0
- ewoksid02-0.0.1a0/src/ewoksid02/tests/conftest.py +583 -0
- ewoksid02-0.0.1a0/src/ewoksid02/tests/test_2scat_node.py +135 -0
- ewoksid02-0.0.1a0/src/ewoksid02/tests/test_ave_node.py +111 -0
- ewoksid02-0.0.1a0/src/ewoksid02/tests/test_azim_node.py +94 -0
- ewoksid02-0.0.1a0/src/ewoksid02/tests/test_caving_node.py +129 -0
- ewoksid02-0.0.1a0/src/ewoksid02/tests/test_norm_node.py +146 -0
- ewoksid02-0.0.1a0/src/ewoksid02/tests/test_saxs.py +53 -0
- ewoksid02-0.0.1a0/src/ewoksid02/tests/test_sumtask.py +10 -0
- ewoksid02-0.0.1a0/src/ewoksid02/tests/utils.py +304 -0
- ewoksid02-0.0.1a0/src/ewoksid02/utils/__init__.py +22 -0
- ewoksid02-0.0.1a0/src/ewoksid02/utils/average.py +158 -0
- ewoksid02-0.0.1a0/src/ewoksid02/utils/blissdata.py +1542 -0
- ewoksid02-0.0.1a0/src/ewoksid02/utils/caving.py +563 -0
- ewoksid02-0.0.1a0/src/ewoksid02/utils/cupyutils.py +37 -0
- ewoksid02-0.0.1a0/src/ewoksid02/utils/io.py +333 -0
- ewoksid02-0.0.1a0/src/ewoksid02/utils/normalization.py +582 -0
- ewoksid02-0.0.1a0/src/ewoksid02/utils/pyfai.py +467 -0
- ewoksid02-0.0.1a0/src/ewoksid02/utils/secondaryscattering.py +556 -0
- ewoksid02-0.0.1a0/src/ewoksid02.egg-info/PKG-INFO +76 -0
- ewoksid02-0.0.1a0/src/ewoksid02.egg-info/SOURCES.txt +53 -0
- ewoksid02-0.0.1a0/src/ewoksid02.egg-info/dependency_links.txt +1 -0
- ewoksid02-0.0.1a0/src/ewoksid02.egg-info/entry_points.txt +5 -0
- ewoksid02-0.0.1a0/src/ewoksid02.egg-info/requires.txt +33 -0
- ewoksid02-0.0.1a0/src/ewoksid02.egg-info/top_level.txt +1 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# MIT License
|
|
2
|
+
|
|
3
|
+
**Copyright (c) 2024 European Synchrotron Radiation Facility**
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
6
|
+
this software and associated documentation files (the "Software"), to deal in
|
|
7
|
+
the Software without restriction, including without limitation the rights to
|
|
8
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
9
|
+
the Software, and to permit persons to whom the Software is furnished to do so,
|
|
10
|
+
subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
17
|
+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
18
|
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
19
|
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
20
|
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: ewoksid02
|
|
3
|
+
Version: 0.0.1a0
|
|
4
|
+
Summary: Data processing SAXS and XPCS workflows for ID02
|
|
5
|
+
Author-email: ESRF <edgar.gutierrez-fernandez@esrf.fr>
|
|
6
|
+
License: # MIT License
|
|
7
|
+
|
|
8
|
+
**Copyright (c) 2024 European Synchrotron Radiation Facility**
|
|
9
|
+
|
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
11
|
+
this software and associated documentation files (the "Software"), to deal in
|
|
12
|
+
the Software without restriction, including without limitation the rights to
|
|
13
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
14
|
+
the Software, and to permit persons to whom the Software is furnished to do so,
|
|
15
|
+
subject to the following conditions:
|
|
16
|
+
|
|
17
|
+
The above copyright notice and this permission notice shall be included in all
|
|
18
|
+
copies or substantial portions of the Software.
|
|
19
|
+
|
|
20
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
22
|
+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
23
|
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
24
|
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
25
|
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
26
|
+
|
|
27
|
+
Project-URL: Homepage, https://gitlab.esrf.fr/workflow/ewoksapps/ewoksid02/
|
|
28
|
+
Project-URL: Documentation, https://ewoksid02.readthedocs.io/
|
|
29
|
+
Project-URL: Repository, https://gitlab.esrf.fr/workflow/ewoksapps/ewoksid02/
|
|
30
|
+
Project-URL: Issues, https://gitlab.esrf.fr/workflow/ewoksapps/ewoksid02/issues
|
|
31
|
+
Project-URL: Changelog, https://gitlab.esrf.fr/workflow/ewoksapps/ewoksid02/-/blob/main/CHANGELOG.md
|
|
32
|
+
Keywords: ewoks
|
|
33
|
+
Classifier: Intended Audience :: Science/Research
|
|
34
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
35
|
+
Classifier: Programming Language :: Python :: 3
|
|
36
|
+
Requires-Python: >=3.8
|
|
37
|
+
Description-Content-Type: text/markdown
|
|
38
|
+
License-File: LICENSE.md
|
|
39
|
+
Requires-Dist: ewoks
|
|
40
|
+
Requires-Dist: ewokscore
|
|
41
|
+
Requires-Dist: ewoksjob[blissworker]
|
|
42
|
+
Requires-Dist: ewoksjob[slurm]
|
|
43
|
+
Requires-Dist: ewoksppf
|
|
44
|
+
Requires-Dist: h5py
|
|
45
|
+
Requires-Dist: numpy<2
|
|
46
|
+
Requires-Dist: scipy
|
|
47
|
+
Requires-Dist: silx
|
|
48
|
+
Requires-Dist: pyfai
|
|
49
|
+
Requires-Dist: blissdata
|
|
50
|
+
Requires-Dist: numexpr!=2.8.6
|
|
51
|
+
Requires-Dist: psutil
|
|
52
|
+
Requires-Dist: pyyaml
|
|
53
|
+
Provides-Extra: test
|
|
54
|
+
Requires-Dist: pytest>=7; extra == "test"
|
|
55
|
+
Provides-Extra: dev
|
|
56
|
+
Requires-Dist: ewoksid02[test]; extra == "dev"
|
|
57
|
+
Requires-Dist: black>=25; extra == "dev"
|
|
58
|
+
Requires-Dist: flake8>=4; extra == "dev"
|
|
59
|
+
Provides-Extra: doc
|
|
60
|
+
Requires-Dist: ewoksid02[test]; extra == "doc"
|
|
61
|
+
Requires-Dist: sphinx>=4.5; extra == "doc"
|
|
62
|
+
Requires-Dist: sphinx-autodoc-typehints>=1.16; extra == "doc"
|
|
63
|
+
Requires-Dist: pydata-sphinx-theme; extra == "doc"
|
|
64
|
+
Requires-Dist: nbsphinx; extra == "doc"
|
|
65
|
+
Requires-Dist: ipython; extra == "doc"
|
|
66
|
+
Provides-Extra: cupy
|
|
67
|
+
Requires-Dist: cupy; extra == "cupy"
|
|
68
|
+
Dynamic: license-file
|
|
69
|
+
|
|
70
|
+
# ewoksid02
|
|
71
|
+
|
|
72
|
+
Data processing SAXS and XPCS workflows for ID02
|
|
73
|
+
|
|
74
|
+
## Documentation
|
|
75
|
+
|
|
76
|
+
https://ewoksid02.readthedocs.io/
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = [
|
|
3
|
+
"setuptools>=61",
|
|
4
|
+
]
|
|
5
|
+
build-backend = "setuptools.build_meta"
|
|
6
|
+
|
|
7
|
+
[project]
|
|
8
|
+
name = "ewoksid02"
|
|
9
|
+
version = "0.0.1-alpha"
|
|
10
|
+
keywords = [
|
|
11
|
+
'ewoks'
|
|
12
|
+
]
|
|
13
|
+
|
|
14
|
+
authors = [{name = "ESRF", email = "edgar.gutierrez-fernandez@esrf.fr"}]
|
|
15
|
+
description = "Data processing SAXS and XPCS workflows for ID02"
|
|
16
|
+
readme = {file = "README.md", content-type = "text/markdown"}
|
|
17
|
+
license = {file = "LICENSE.md"}
|
|
18
|
+
classifiers = [
|
|
19
|
+
'Intended Audience :: Science/Research',
|
|
20
|
+
'License :: OSI Approved :: MIT License',
|
|
21
|
+
'Programming Language :: Python :: 3',
|
|
22
|
+
]
|
|
23
|
+
requires-python = ">=3.8"
|
|
24
|
+
dependencies = [
|
|
25
|
+
"ewoks",
|
|
26
|
+
"ewokscore",
|
|
27
|
+
"ewoksjob[blissworker]",
|
|
28
|
+
"ewoksjob[slurm]",
|
|
29
|
+
"ewoksppf",
|
|
30
|
+
"h5py",
|
|
31
|
+
"numpy<2",
|
|
32
|
+
"scipy",
|
|
33
|
+
"silx",
|
|
34
|
+
"pyfai",
|
|
35
|
+
"blissdata",
|
|
36
|
+
"numexpr !=2.8.6",
|
|
37
|
+
"psutil",
|
|
38
|
+
"pyyaml",
|
|
39
|
+
]
|
|
40
|
+
|
|
41
|
+
[project.urls]
|
|
42
|
+
Homepage = "https://gitlab.esrf.fr/workflow/ewoksapps/ewoksid02/"
|
|
43
|
+
Documentation = "https://ewoksid02.readthedocs.io/"
|
|
44
|
+
Repository = "https://gitlab.esrf.fr/workflow/ewoksapps/ewoksid02/"
|
|
45
|
+
Issues = "https://gitlab.esrf.fr/workflow/ewoksapps/ewoksid02/issues"
|
|
46
|
+
Changelog = "https://gitlab.esrf.fr/workflow/ewoksapps/ewoksid02/-/blob/main/CHANGELOG.md"
|
|
47
|
+
|
|
48
|
+
[project.optional-dependencies]
|
|
49
|
+
test = [
|
|
50
|
+
'pytest >=7',
|
|
51
|
+
]
|
|
52
|
+
dev = [
|
|
53
|
+
"ewoksid02[test]",
|
|
54
|
+
'black >=25',
|
|
55
|
+
'flake8 >=4',
|
|
56
|
+
]
|
|
57
|
+
doc = [
|
|
58
|
+
"ewoksid02[test]",
|
|
59
|
+
'sphinx >=4.5',
|
|
60
|
+
'sphinx-autodoc-typehints >=1.16',
|
|
61
|
+
'pydata-sphinx-theme',
|
|
62
|
+
'nbsphinx',
|
|
63
|
+
'ipython',
|
|
64
|
+
]
|
|
65
|
+
cupy = [
|
|
66
|
+
'cupy',
|
|
67
|
+
]
|
|
68
|
+
|
|
69
|
+
[tool.setuptools]
|
|
70
|
+
package-dir = {''= 'src'}
|
|
71
|
+
|
|
72
|
+
[tool.setuptools.packages.find]
|
|
73
|
+
where = ["src"]
|
|
74
|
+
namespaces = false
|
|
75
|
+
|
|
76
|
+
[tool.setuptools.package-data]
|
|
77
|
+
"ewoksid02.tests.data"= ['*/*']
|
|
78
|
+
"*"= ['resources/*.*']
|
|
79
|
+
|
|
80
|
+
[project.entry-points."ewoks.tasks.class"]
|
|
81
|
+
"ewoksid02.tasks.*" = "ewoksid02"
|
|
82
|
+
|
|
83
|
+
[project.scripts]
|
|
84
|
+
ewoksid02 = "ewoksid02.scripts.__main__:main"
|
|
85
|
+
|
|
86
|
+
[tool.coverage.run]
|
|
87
|
+
omit = [
|
|
88
|
+
"*/tests/*"
|
|
89
|
+
]
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
{
|
|
2
|
+
"directed": true,
|
|
3
|
+
"multigraph": false,
|
|
4
|
+
"graph": {
|
|
5
|
+
"id": "saxs_loop",
|
|
6
|
+
"schema_version": "1.1"
|
|
7
|
+
},
|
|
8
|
+
"nodes": [
|
|
9
|
+
{
|
|
10
|
+
"task_type": "class",
|
|
11
|
+
"task_identifier": "ewoksid02.tasks.normalizationtask.NormalizationTask",
|
|
12
|
+
"force_start_node": true,
|
|
13
|
+
"default_inputs" : [{"name": "reading_node", "value": true}],
|
|
14
|
+
"id": "norm"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"task_type": "class",
|
|
18
|
+
"task_identifier": "ewoksid02.tasks.secondaryscatteringtask.SecondaryScatteringTask",
|
|
19
|
+
"id": "2scat"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"task_type": "class",
|
|
23
|
+
"task_identifier": "ewoksid02.tasks.cavingtask.CavingBeamstopTask",
|
|
24
|
+
"id": "cave"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"task_type": "class",
|
|
28
|
+
"task_identifier": "ewoksid02.tasks.azimuthaltask.AzimuthalTask",
|
|
29
|
+
"id": "azim"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"task_type": "class",
|
|
33
|
+
"task_identifier": "ewoksid02.tasks.averagetask.AverageTask",
|
|
34
|
+
"id": "ave"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"task_type": "class",
|
|
38
|
+
"task_identifier": "ewoksid02.tasks.scalerstask.ScalersTask",
|
|
39
|
+
"id": "scalers"
|
|
40
|
+
}
|
|
41
|
+
],
|
|
42
|
+
"links": [
|
|
43
|
+
{
|
|
44
|
+
"map_all_data": true,
|
|
45
|
+
"source": "norm",
|
|
46
|
+
"target": "2scat",
|
|
47
|
+
"conditions": [
|
|
48
|
+
{
|
|
49
|
+
"source_output": "continue_pipeline",
|
|
50
|
+
"value": true
|
|
51
|
+
}
|
|
52
|
+
]
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"map_all_data": true,
|
|
56
|
+
"source": "2scat",
|
|
57
|
+
"target": "cave"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"map_all_data": true,
|
|
61
|
+
"source": "cave",
|
|
62
|
+
"target": "azim"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"map_all_data": true,
|
|
66
|
+
"source": "azim",
|
|
67
|
+
"target": "ave"
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"map_all_data": true,
|
|
71
|
+
"source": "ave",
|
|
72
|
+
"target": "scalers"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"map_all_data": true,
|
|
76
|
+
"source": "scalers",
|
|
77
|
+
"target": "norm"
|
|
78
|
+
}
|
|
79
|
+
]
|
|
80
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
###########################
|
|
2
|
+
## ewoksid02 template SAXS.yaml
|
|
3
|
+
###########################
|
|
4
|
+
|
|
5
|
+
# File parameters
|
|
6
|
+
bliss_filenames:
|
|
7
|
+
- /data/visitor/xxx/id02/xxx/RAW_DATA/xxx/.../file1.h5
|
|
8
|
+
#- /data/visitor/xxx/id02/xxx/RAW_DATA/xxx/.../file2.h5
|
|
9
|
+
detectors:
|
|
10
|
+
- eiger2
|
|
11
|
+
scans:
|
|
12
|
+
- 1
|
|
13
|
+
tag: t1
|
|
14
|
+
output_root:
|
|
15
|
+
|
|
16
|
+
# Processing parameters
|
|
17
|
+
to_process: "norm 2scat cave azim ave"
|
|
18
|
+
to_save: "norm 2scat cave azim ave"
|
|
19
|
+
datatype: "float32"
|
|
20
|
+
max_slice_size: 34
|
|
21
|
+
save_variance: False
|
|
22
|
+
algorithm_norm: cython
|
|
23
|
+
algorithm_2scat:
|
|
24
|
+
algorithm_cave:
|
|
25
|
+
|
|
26
|
+
# Correction parameters
|
|
27
|
+
filename_flatfield:
|
|
28
|
+
filename_darkcurrent:
|
|
29
|
+
filename_maskgaps:
|
|
30
|
+
filename_maskbeamstop:
|
|
31
|
+
filename_window_wagon:
|
|
32
|
+
window_roi_size: 120
|
|
33
|
+
|
|
34
|
+
# Submit parameters
|
|
35
|
+
submit: True
|
|
36
|
+
slurm_job_parameters:
|
|
37
|
+
time_limit: 01:00:00
|
|
38
|
+
memory_per_cpu: 50GB
|
|
File without changes
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import argparse
|
|
2
|
+
import os
|
|
3
|
+
import shutil
|
|
4
|
+
import sys
|
|
5
|
+
|
|
6
|
+
from ..utils import AVAILABLE_TEMPLATES, TEMPLATE_MESSAGE
|
|
7
|
+
from .parsers import add_saxs_arguments, add_xpcs_arguments
|
|
8
|
+
from .saxs.main import main as main_saxs
|
|
9
|
+
from .xpcs.__main__ import main as main_xpcs
|
|
10
|
+
|
|
11
|
+
TECHNIQUES = [
|
|
12
|
+
"saxs",
|
|
13
|
+
"xpcs",
|
|
14
|
+
]
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def main(argv=None):
|
|
18
|
+
"""Main function to run the offline scripts
|
|
19
|
+
|
|
20
|
+
Inputs:
|
|
21
|
+
- argv: command line arguments
|
|
22
|
+
"""
|
|
23
|
+
if argv is None:
|
|
24
|
+
argv = sys.argv
|
|
25
|
+
|
|
26
|
+
parser = argparse.ArgumentParser(
|
|
27
|
+
prog="ewoksid02",
|
|
28
|
+
description="Run data processing pipelines for SAXS or XPCS.",
|
|
29
|
+
usage="ewoksid02 {saxs | xpcs | templates} [...]",
|
|
30
|
+
)
|
|
31
|
+
subparsers = parser.add_subparsers(dest="command", required=True)
|
|
32
|
+
|
|
33
|
+
subparser_saxs = subparsers.add_parser("saxs", help="Trigger SAXS pipelines")
|
|
34
|
+
add_saxs_arguments(subparser_saxs)
|
|
35
|
+
|
|
36
|
+
subparser_xpcs = subparsers.add_parser("xpcs", help="Trigger XPCS pipelines")
|
|
37
|
+
add_xpcs_arguments(subparser_xpcs)
|
|
38
|
+
|
|
39
|
+
subparser_templates = subparsers.add_parser( # noqa
|
|
40
|
+
"templates", help="Download available templates for ID02 offline pipelines"
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
if len(argv) == 1:
|
|
44
|
+
parser.print_help()
|
|
45
|
+
sys.exit(1)
|
|
46
|
+
|
|
47
|
+
if argv[1] == "templates":
|
|
48
|
+
print(TEMPLATE_MESSAGE)
|
|
49
|
+
for _, template_info in AVAILABLE_TEMPLATES.items():
|
|
50
|
+
os.makedirs(template_info["directory"], exist_ok=True)
|
|
51
|
+
shutil.copy(template_info["path"], template_info["future_path"])
|
|
52
|
+
return
|
|
53
|
+
|
|
54
|
+
args = parser.parse_args(argv[1:])
|
|
55
|
+
if args.command == "saxs":
|
|
56
|
+
if len(args.FILES) == 0:
|
|
57
|
+
subparser_saxs.print_help()
|
|
58
|
+
sys.exit(1)
|
|
59
|
+
main_saxs(args)
|
|
60
|
+
elif args.command == "xpcs":
|
|
61
|
+
main_xpcs(args)
|
|
62
|
+
elif args.command == "templates":
|
|
63
|
+
print(TEMPLATE_MESSAGE)
|
|
64
|
+
for _, template_info in AVAILABLE_TEMPLATES.items():
|
|
65
|
+
os.makedirs(template_info["directory"], exist_ok=True)
|
|
66
|
+
shutil.copy(template_info["path"], template_info["future_path"])
|
|
67
|
+
return
|
|
68
|
+
else:
|
|
69
|
+
parser.print_help()
|
|
70
|
+
sys.exit(1)
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
def add_celery_arguments(parser):
|
|
2
|
+
"""Add to parser arguments related to celery queue and submit"""
|
|
3
|
+
parser.add_argument(
|
|
4
|
+
"-q",
|
|
5
|
+
"--queue",
|
|
6
|
+
dest="queue",
|
|
7
|
+
default=None,
|
|
8
|
+
help="Queue name for the job submission (default: None)",
|
|
9
|
+
)
|
|
10
|
+
parser.add_argument(
|
|
11
|
+
"--no-submit",
|
|
12
|
+
dest="submit",
|
|
13
|
+
action="store_false",
|
|
14
|
+
help="Do not submit anything",
|
|
15
|
+
default=None,
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def add_workflow_flags(parser):
|
|
20
|
+
"""Add to parser arguments related to process and save flags."""
|
|
21
|
+
parser.add_argument(
|
|
22
|
+
"--to_process",
|
|
23
|
+
dest="to_process",
|
|
24
|
+
default=None,
|
|
25
|
+
help="Steps to process",
|
|
26
|
+
)
|
|
27
|
+
parser.add_argument(
|
|
28
|
+
"--to_save",
|
|
29
|
+
dest="to_save",
|
|
30
|
+
default=None,
|
|
31
|
+
help="Steps to save",
|
|
32
|
+
)
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
def add_main_arguments(parser):
|
|
36
|
+
"""Add to parser common arguments to run the offline pipeline."""
|
|
37
|
+
parser.add_argument(
|
|
38
|
+
"FILES",
|
|
39
|
+
metavar="FILES",
|
|
40
|
+
help="List of BLISS files read and reprocess",
|
|
41
|
+
nargs="+",
|
|
42
|
+
)
|
|
43
|
+
parser.add_argument(
|
|
44
|
+
"-n",
|
|
45
|
+
"--scan",
|
|
46
|
+
dest="scan_nb",
|
|
47
|
+
nargs="+",
|
|
48
|
+
help="Number of scan to process",
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
parser.add_argument(
|
|
52
|
+
"-d",
|
|
53
|
+
"--detector",
|
|
54
|
+
dest="detector_name",
|
|
55
|
+
default=None,
|
|
56
|
+
help="Name of the Lima detector which data to process",
|
|
57
|
+
)
|
|
58
|
+
parser.add_argument(
|
|
59
|
+
"-t",
|
|
60
|
+
"--tag",
|
|
61
|
+
dest="tag",
|
|
62
|
+
default=None,
|
|
63
|
+
help="Tag to be added on each processing filename. The workflow will not overwrite files",
|
|
64
|
+
)
|
|
65
|
+
parser.add_argument(
|
|
66
|
+
"--r",
|
|
67
|
+
"--output-root",
|
|
68
|
+
dest="output_root",
|
|
69
|
+
help="Root directory for the output files",
|
|
70
|
+
default=None,
|
|
71
|
+
)
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
def add_common_saxs_arguments(parser):
|
|
75
|
+
"""Add to parser common arguments to SAXS/WAXS pipeline"""
|
|
76
|
+
parser.add_argument(
|
|
77
|
+
"--metadata",
|
|
78
|
+
dest="filename_metadata",
|
|
79
|
+
default=None,
|
|
80
|
+
help="File with metadata used for processing",
|
|
81
|
+
)
|
|
82
|
+
parser.add_argument(
|
|
83
|
+
"--max",
|
|
84
|
+
dest="max_slice_size",
|
|
85
|
+
default=None,
|
|
86
|
+
type=int,
|
|
87
|
+
help="Maximum number of slices to process at once. Default: 100",
|
|
88
|
+
)
|
|
89
|
+
parser.add_argument(
|
|
90
|
+
"--dummy",
|
|
91
|
+
dest="dummy",
|
|
92
|
+
default=None,
|
|
93
|
+
help="Dummy value",
|
|
94
|
+
)
|
|
95
|
+
parser.add_argument(
|
|
96
|
+
"--delta-dummy",
|
|
97
|
+
dest="delta_dummy",
|
|
98
|
+
default=None,
|
|
99
|
+
help="Delta dummy value",
|
|
100
|
+
)
|
|
101
|
+
parser.add_argument(
|
|
102
|
+
"-l",
|
|
103
|
+
"--log-level",
|
|
104
|
+
dest="log_level",
|
|
105
|
+
default=None,
|
|
106
|
+
help="Logging level.",
|
|
107
|
+
)
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
def add_normalization_arguments(parser):
|
|
111
|
+
"""Add to parser arguments for NormalizationTask"""
|
|
112
|
+
help = "Normalization: "
|
|
113
|
+
parser.add_argument(
|
|
114
|
+
"--dark",
|
|
115
|
+
dest="dark_current_filename",
|
|
116
|
+
default=None,
|
|
117
|
+
help=help + "Filename of the dark current file",
|
|
118
|
+
)
|
|
119
|
+
parser.add_argument(
|
|
120
|
+
"--flat",
|
|
121
|
+
dest="flat_field_filename",
|
|
122
|
+
default=None,
|
|
123
|
+
help=help + "Filename of the flat field file",
|
|
124
|
+
)
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
def add_masking_arguments(parser):
|
|
128
|
+
"""Add to parser arguments for CavingTask"""
|
|
129
|
+
help = "Caving: "
|
|
130
|
+
parser.add_argument(
|
|
131
|
+
"--mask-gaps",
|
|
132
|
+
dest="mask_gaps_filename",
|
|
133
|
+
default=None,
|
|
134
|
+
help=help + "Filename of the mask with detector gaps",
|
|
135
|
+
)
|
|
136
|
+
parser.add_argument(
|
|
137
|
+
"--mask-beamstop",
|
|
138
|
+
dest="mask_beamstop_filename",
|
|
139
|
+
default=None,
|
|
140
|
+
help=help + "Filename of the mask with the beamstop",
|
|
141
|
+
)
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
def add_secondary_scattering_arguments(parser):
|
|
145
|
+
"""Add to parser arguments for SecondaryScatteringTask"""
|
|
146
|
+
help = "Secondary Scattering: "
|
|
147
|
+
parser.add_argument(
|
|
148
|
+
"--window-pattern",
|
|
149
|
+
dest="window_pattern_filename",
|
|
150
|
+
default=None,
|
|
151
|
+
help=help + "Filename of the window pattern file",
|
|
152
|
+
)
|
|
153
|
+
parser.add_argument(
|
|
154
|
+
"--window-roi",
|
|
155
|
+
dest="window_roi_size",
|
|
156
|
+
default=None,
|
|
157
|
+
help=help + "Subdata distance for secondary scattering correction",
|
|
158
|
+
)
|
|
159
|
+
parser.add_argument(
|
|
160
|
+
"--flip-vertical",
|
|
161
|
+
dest="flip_vertical",
|
|
162
|
+
action="store_true",
|
|
163
|
+
default=None,
|
|
164
|
+
help=help + "Flip the image vertically (default: False)",
|
|
165
|
+
)
|
|
166
|
+
parser.add_argument(
|
|
167
|
+
"--flip-horizontal",
|
|
168
|
+
dest="flip_horizontal",
|
|
169
|
+
action="store_true",
|
|
170
|
+
default=None,
|
|
171
|
+
help=help + "Flip the image horizontally (default: False)",
|
|
172
|
+
)
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
def add_azimuthal_arguments(parser):
|
|
176
|
+
"""Add to parser arguments for AzimuthalTask"""
|
|
177
|
+
help = "Azimuthal: "
|
|
178
|
+
parser.add_argument(
|
|
179
|
+
"--npt-rad",
|
|
180
|
+
dest="npt_rad",
|
|
181
|
+
default=None,
|
|
182
|
+
help=help + "Number of radial bins",
|
|
183
|
+
)
|
|
184
|
+
parser.add_argument(
|
|
185
|
+
"--npt-azim",
|
|
186
|
+
dest="npt_azim",
|
|
187
|
+
default=None,
|
|
188
|
+
help=help + "Number of azimuthal bins",
|
|
189
|
+
)
|
|
190
|
+
parser.add_argument(
|
|
191
|
+
"--unit",
|
|
192
|
+
dest="unit",
|
|
193
|
+
default=None,
|
|
194
|
+
help=help + "Unit for azimuthal averaging",
|
|
195
|
+
)
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
def add_average_arguments(parser):
|
|
199
|
+
"""Add to parser arguments for AverageTask"""
|
|
200
|
+
help = "Average: "
|
|
201
|
+
parser.add_argument(
|
|
202
|
+
"--azim-range",
|
|
203
|
+
dest="azimuth_range",
|
|
204
|
+
default=None,
|
|
205
|
+
help=help + "Azimuthal limits for the average",
|
|
206
|
+
)
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
def add_saxs_arguments(parser):
|
|
210
|
+
"""Add all arguments needed for SAXS/WAXS pipeline"""
|
|
211
|
+
add_main_arguments(parser)
|
|
212
|
+
add_common_saxs_arguments(parser)
|
|
213
|
+
add_celery_arguments(parser)
|
|
214
|
+
add_normalization_arguments(parser)
|
|
215
|
+
add_masking_arguments(parser)
|
|
216
|
+
add_secondary_scattering_arguments(parser)
|
|
217
|
+
add_azimuthal_arguments(parser)
|
|
218
|
+
add_average_arguments(parser)
|
|
219
|
+
add_workflow_flags(parser)
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
def add_xpcs_arguments(parser):
|
|
223
|
+
"""Add all arguments needed for XPCS pipeline"""
|
|
224
|
+
add_main_arguments(parser)
|
|
File without changes
|