settings.py 3.73 KB
Newer Older
payno's avatar
payno committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# coding: utf-8
# /*##########################################################################
#
# Copyright (c) 2015-2020 European Synchrotron Radiation Facility
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
# ###########################################################################*/

"""
module to convert from (bliss) .h5 to (nexus tomo compliant) .nx
"""

30
__authors__ = ["H. Payno"]
payno's avatar
payno committed
31
32
33
34
35
36
__license__ = "MIT"
__date__ = "13/05/2020"


### HDF5 settings

37
38
39
40
41
H5_VALID_CAMERA_NAMES = None
# now camera names are deduce using converter `get_nx_detectors`
# and `guess_nx_detector` functions. But you can provide A LIST of
# detector name (unix shell-style wildcards are managed) like
# ("pcolinux*", "basler", "frelon*", ...)
42

43
H5_ROT_ANGLE_KEYS = (
Tomas Farago's avatar
Tomas Farago committed
44
    "rotm",
payno's avatar
payno committed
45
    "mhsrot",
46
    "hsrot",
47
48
49
50
51
    "mrsrot",
    "hrsrot",
    "srot",
    "diffrz",
)
payno's avatar
payno committed
52

53
54
H5_X_TRANS_KEYS = ("sx", "d3tx")
"""Keys used to find the x translation"""
payno's avatar
payno committed
55

56
57
H5_Y_TRANS_KEYS = ("sy", "d3ty")
"""Keys used to find the y translation"""
payno's avatar
payno committed
58

59
60
H5_Z_TRANS_KEYS = ("sz", "d3tz")
"""Keys used to find the z translation"""
payno's avatar
payno committed
61

62
63
H5_Y_ROT_KEY = "instrument/positioners/yrot"
"""Key used to find the estimated center of rotation for half acquisition"""
payno's avatar
payno committed
64

65
H5_ACQ_EXPO_TIME_KEYS = ("acq_expo_time",)
payno's avatar
payno committed
66

67
68
69
70
71
72
73
H5_INIT_TITLES = (
    "pcotomo:basic",
    "tomo:basic",
    "tomo:fullturn",
    "sequence_of_scans",
    "tomo:halfturn",
)
74
75
"""if a scan starts by one of those string then is considered as
initialization scan"""
payno's avatar
payno committed
76
77
78
79

H5_ZSERIE_INIT_TITLES = ("tomo:zseries",)
"""specific titles for zserie. Will extend H5_INIT_TITLES"""

80
H5_DARK_TITLES = ("dark images", "dark")
81
82
"""if a scan starts by one of those string then is considered as
dark scan"""
83
H5_REF_TITLES = ("reference images", "ref", "refend")
84
85
"""if a scan starts by one of those string then is considered as
reference scan"""
86
H5_PROJ_TITLES = ("projections", "ascan diffrz 0 180 1600 0.1")
87
88
"""if a scan starts by one of those string then is considered as
projection scan"""
89
H5_ALIGNMENT_TITLES = ("static images", "ascan diffrz 180 0 4 0.1")
90
91
"""if a scan starts by one of those string then is considered as
alignment scan"""
payno's avatar
payno committed
92

93
94
95
96
97
98
99
H5_X_PIXEL_SIZE = (
    "technique/optic/sample_pixel_size ",
    "technique/optic/sample_pixel_size",
    "technique/detector/pixel_size",
)
"""Possible path to th pixel size."""
# warning: we can have two cases: one with an empty space at the end or not
100

101
102
103
104
105
H5_Y_PIXEL_SIZE = (
    "technique/optic/sample_pixel_size ",
    "technique/optic/sample_pixel_size",
    "technique/detector/pixel_size",
)
106

payno's avatar
payno committed
107
108
### EDF settings

109
EDF_MOTOR_POS = "motor_pos"
payno's avatar
payno committed
110

111
EDF_MOTOR_MNE = "motor_mne"
payno's avatar
payno committed
112
113
114
115
116
117
118
119
120

EDF_ROT_ANGLE = "srot"

EDF_X_TRANS = "sx"

EDF_Y_TRANS = "sy"

EDF_Z_TRANS = "sz"

121
122
# EDF_TO_IGNORE = ['HST', '_slice_']
EDF_TO_IGNORE = ("_slice_",)
payno's avatar
payno committed
123

124
EDF_DARK_NAMES = ("darkend", "dark")
payno's avatar
payno committed
125

126
EDF_REFS_NAMES = ("ref", "refHST")