ChessAnalysisPipeline 0.0.12__tar.gz → 0.0.14__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.
Potentially problematic release.
This version of ChessAnalysisPipeline might be problematic. Click here for more details.
- {ChessAnalysisPipeline-0.0.12 → ChessAnalysisPipeline-0.0.14}/CHAP/__init__.py +2 -0
- {ChessAnalysisPipeline-0.0.12 → ChessAnalysisPipeline-0.0.14}/CHAP/common/__init__.py +7 -2
- {ChessAnalysisPipeline-0.0.12 → ChessAnalysisPipeline-0.0.14}/CHAP/common/models/map.py +95 -70
- ChessAnalysisPipeline-0.0.14/CHAP/common/processor.py +1396 -0
- {ChessAnalysisPipeline-0.0.12 → ChessAnalysisPipeline-0.0.14}/CHAP/common/reader.py +168 -131
- {ChessAnalysisPipeline-0.0.12 → ChessAnalysisPipeline-0.0.14}/CHAP/common/writer.py +166 -96
- {ChessAnalysisPipeline-0.0.12 → ChessAnalysisPipeline-0.0.14}/CHAP/edd/__init__.py +2 -0
- {ChessAnalysisPipeline-0.0.12 → ChessAnalysisPipeline-0.0.14}/CHAP/edd/models.py +94 -48
- {ChessAnalysisPipeline-0.0.12 → ChessAnalysisPipeline-0.0.14}/CHAP/edd/processor.py +625 -169
- {ChessAnalysisPipeline-0.0.12 → ChessAnalysisPipeline-0.0.14}/CHAP/edd/utils.py +186 -6
- {ChessAnalysisPipeline-0.0.12 → ChessAnalysisPipeline-0.0.14}/CHAP/pipeline.py +35 -3
- {ChessAnalysisPipeline-0.0.12 → ChessAnalysisPipeline-0.0.14}/CHAP/runner.py +40 -13
- {ChessAnalysisPipeline-0.0.12 → ChessAnalysisPipeline-0.0.14}/CHAP/tomo/models.py +18 -9
- {ChessAnalysisPipeline-0.0.12 → ChessAnalysisPipeline-0.0.14}/CHAP/tomo/processor.py +1134 -902
- {ChessAnalysisPipeline-0.0.12 → ChessAnalysisPipeline-0.0.14}/CHAP/utils/fit.py +98 -45
- {ChessAnalysisPipeline-0.0.12 → ChessAnalysisPipeline-0.0.14}/CHAP/utils/general.py +196 -63
- {ChessAnalysisPipeline-0.0.12 → ChessAnalysisPipeline-0.0.14}/CHAP/utils/scanparsers.py +403 -94
- {ChessAnalysisPipeline-0.0.12 → ChessAnalysisPipeline-0.0.14/ChessAnalysisPipeline.egg-info}/PKG-INFO +1 -1
- {ChessAnalysisPipeline-0.0.12/ChessAnalysisPipeline.egg-info → ChessAnalysisPipeline-0.0.14}/PKG-INFO +1 -1
- {ChessAnalysisPipeline-0.0.12 → ChessAnalysisPipeline-0.0.14}/setup.py +1 -1
- ChessAnalysisPipeline-0.0.12/CHAP/common/processor.py +0 -705
- {ChessAnalysisPipeline-0.0.12 → ChessAnalysisPipeline-0.0.14}/CHAP/TaskManager.py +0 -0
- {ChessAnalysisPipeline-0.0.12 → ChessAnalysisPipeline-0.0.14}/CHAP/common/models/__init__.py +0 -0
- {ChessAnalysisPipeline-0.0.12 → ChessAnalysisPipeline-0.0.14}/CHAP/common/models/integration.py +0 -0
- {ChessAnalysisPipeline-0.0.12 → ChessAnalysisPipeline-0.0.14}/CHAP/edd/reader.py +0 -0
- {ChessAnalysisPipeline-0.0.12 → ChessAnalysisPipeline-0.0.14}/CHAP/edd/writer.py +0 -0
- {ChessAnalysisPipeline-0.0.12 → ChessAnalysisPipeline-0.0.14}/CHAP/inference/__init__.py +0 -0
- {ChessAnalysisPipeline-0.0.12 → ChessAnalysisPipeline-0.0.14}/CHAP/inference/processor.py +0 -0
- {ChessAnalysisPipeline-0.0.12 → ChessAnalysisPipeline-0.0.14}/CHAP/inference/reader.py +0 -0
- {ChessAnalysisPipeline-0.0.12 → ChessAnalysisPipeline-0.0.14}/CHAP/inference/writer.py +0 -0
- {ChessAnalysisPipeline-0.0.12 → ChessAnalysisPipeline-0.0.14}/CHAP/processor.py +0 -0
- {ChessAnalysisPipeline-0.0.12 → ChessAnalysisPipeline-0.0.14}/CHAP/reader.py +0 -0
- {ChessAnalysisPipeline-0.0.12 → ChessAnalysisPipeline-0.0.14}/CHAP/saxswaxs/__init__.py +0 -0
- {ChessAnalysisPipeline-0.0.12 → ChessAnalysisPipeline-0.0.14}/CHAP/saxswaxs/processor.py +0 -0
- {ChessAnalysisPipeline-0.0.12 → ChessAnalysisPipeline-0.0.14}/CHAP/saxswaxs/reader.py +0 -0
- {ChessAnalysisPipeline-0.0.12 → ChessAnalysisPipeline-0.0.14}/CHAP/saxswaxs/writer.py +0 -0
- {ChessAnalysisPipeline-0.0.12 → ChessAnalysisPipeline-0.0.14}/CHAP/server.py +0 -0
- {ChessAnalysisPipeline-0.0.12 → ChessAnalysisPipeline-0.0.14}/CHAP/sin2psi/__init__.py +0 -0
- {ChessAnalysisPipeline-0.0.12 → ChessAnalysisPipeline-0.0.14}/CHAP/sin2psi/processor.py +0 -0
- {ChessAnalysisPipeline-0.0.12 → ChessAnalysisPipeline-0.0.14}/CHAP/sin2psi/reader.py +0 -0
- {ChessAnalysisPipeline-0.0.12 → ChessAnalysisPipeline-0.0.14}/CHAP/sin2psi/writer.py +0 -0
- {ChessAnalysisPipeline-0.0.12 → ChessAnalysisPipeline-0.0.14}/CHAP/tomo/__init__.py +0 -0
- {ChessAnalysisPipeline-0.0.12 → ChessAnalysisPipeline-0.0.14}/CHAP/tomo/reader.py +0 -0
- {ChessAnalysisPipeline-0.0.12 → ChessAnalysisPipeline-0.0.14}/CHAP/tomo/writer.py +0 -0
- {ChessAnalysisPipeline-0.0.12 → ChessAnalysisPipeline-0.0.14}/CHAP/utils/__init__.py +0 -0
- {ChessAnalysisPipeline-0.0.12 → ChessAnalysisPipeline-0.0.14}/CHAP/utils/material.py +0 -0
- {ChessAnalysisPipeline-0.0.12 → ChessAnalysisPipeline-0.0.14}/CHAP/utils/parfile.py +0 -0
- {ChessAnalysisPipeline-0.0.12 → ChessAnalysisPipeline-0.0.14}/CHAP/writer.py +0 -0
- {ChessAnalysisPipeline-0.0.12 → ChessAnalysisPipeline-0.0.14}/ChessAnalysisPipeline.egg-info/SOURCES.txt +0 -0
- {ChessAnalysisPipeline-0.0.12 → ChessAnalysisPipeline-0.0.14}/ChessAnalysisPipeline.egg-info/dependency_links.txt +0 -0
- {ChessAnalysisPipeline-0.0.12 → ChessAnalysisPipeline-0.0.14}/ChessAnalysisPipeline.egg-info/entry_points.txt +0 -0
- {ChessAnalysisPipeline-0.0.12 → ChessAnalysisPipeline-0.0.14}/ChessAnalysisPipeline.egg-info/requires.txt +0 -0
- {ChessAnalysisPipeline-0.0.12 → ChessAnalysisPipeline-0.0.14}/ChessAnalysisPipeline.egg-info/top_level.txt +0 -0
- {ChessAnalysisPipeline-0.0.12 → ChessAnalysisPipeline-0.0.14}/LICENSE +0 -0
- {ChessAnalysisPipeline-0.0.12 → ChessAnalysisPipeline-0.0.14}/MLaaS/__init__.py +0 -0
- {ChessAnalysisPipeline-0.0.12 → ChessAnalysisPipeline-0.0.14}/MLaaS/ktrain.py +0 -0
- {ChessAnalysisPipeline-0.0.12 → ChessAnalysisPipeline-0.0.14}/MLaaS/mnist_img.py +0 -0
- {ChessAnalysisPipeline-0.0.12 → ChessAnalysisPipeline-0.0.14}/MLaaS/tfaas_client.py +0 -0
- {ChessAnalysisPipeline-0.0.12 → ChessAnalysisPipeline-0.0.14}/README.md +0 -0
- {ChessAnalysisPipeline-0.0.12 → ChessAnalysisPipeline-0.0.14}/setup.cfg +0 -0
|
@@ -9,14 +9,18 @@ validating input data in some `Processor`s.
|
|
|
9
9
|
|
|
10
10
|
from CHAP.common.reader import (
|
|
11
11
|
BinaryFileReader,
|
|
12
|
-
|
|
12
|
+
H5Reader,
|
|
13
13
|
MapReader,
|
|
14
14
|
NexusReader,
|
|
15
|
+
SpecReader,
|
|
15
16
|
URLReader,
|
|
16
17
|
YAMLReader,
|
|
17
18
|
)
|
|
18
19
|
from CHAP.common.processor import (
|
|
20
|
+
AnimationProcessor,
|
|
19
21
|
AsyncProcessor,
|
|
22
|
+
BinarizeProcessor,
|
|
23
|
+
ImageProcessor,
|
|
20
24
|
IntegrationProcessor,
|
|
21
25
|
IntegrateMapProcessor,
|
|
22
26
|
MapProcessor,
|
|
@@ -30,9 +34,10 @@ from CHAP.common.processor import (
|
|
|
30
34
|
)
|
|
31
35
|
from CHAP.common.writer import (
|
|
32
36
|
ExtractArchiveWriter,
|
|
37
|
+
FileTreeWriter,
|
|
38
|
+
MatplotlibAnimationWriter,
|
|
33
39
|
MatplotlibFigureWriter,
|
|
34
40
|
NexusWriter,
|
|
35
41
|
YAMLWriter,
|
|
36
42
|
TXTWriter,
|
|
37
|
-
FileTreeWriter,
|
|
38
43
|
)
|
|
@@ -32,7 +32,7 @@ class Sample(BaseModel):
|
|
|
32
32
|
:ivar name: The name of the sample.
|
|
33
33
|
:type name: str
|
|
34
34
|
:ivar description: A description of the sample.
|
|
35
|
-
:type description:
|
|
35
|
+
:type description: str, optional
|
|
36
36
|
"""
|
|
37
37
|
name: constr(min_length=1)
|
|
38
38
|
description: Optional[str]
|
|
@@ -45,9 +45,12 @@ class SpecScans(BaseModel):
|
|
|
45
45
|
:type spec_file: str
|
|
46
46
|
:ivar scan_numbers: List of scan numbers to use.
|
|
47
47
|
:type scan_numbers: list[int]
|
|
48
|
+
:ivar par_file: Path to a non-default SMB par file.
|
|
49
|
+
:type par_file: str, optional
|
|
48
50
|
"""
|
|
49
51
|
spec_file: FilePath
|
|
50
52
|
scan_numbers: conlist(item_type=conint(gt=0), min_items=1)
|
|
53
|
+
par_file: Optional[FilePath]
|
|
51
54
|
|
|
52
55
|
@validator('spec_file', allow_reuse=True)
|
|
53
56
|
def validate_spec_file(cls, spec_file, values):
|
|
@@ -95,6 +98,23 @@ class SpecScans(BaseModel):
|
|
|
95
98
|
f'No scan number {scan_number} in {spec_file}')
|
|
96
99
|
return scan_numbers
|
|
97
100
|
|
|
101
|
+
@validator('par_file', allow_reuse=True)
|
|
102
|
+
def validate_par_file(cls, par_file, values):
|
|
103
|
+
"""Validate the specified SMB par file.
|
|
104
|
+
|
|
105
|
+
:param par_file: Path to a non-default SMB par file.
|
|
106
|
+
:type par_file: str
|
|
107
|
+
:raises ValueError: If the SMB par file is invalid.
|
|
108
|
+
:return: Absolute path to the SMB par file, if it is valid.
|
|
109
|
+
:rtype: str
|
|
110
|
+
"""
|
|
111
|
+
if par_file is None or not par_file:
|
|
112
|
+
return ''
|
|
113
|
+
par_file = os.path.abspath(par_file)
|
|
114
|
+
if not os.path.isfile(par_file):
|
|
115
|
+
raise ValueError(f'Invalid SMB par file {par_file}')
|
|
116
|
+
return par_file
|
|
117
|
+
|
|
98
118
|
@property
|
|
99
119
|
def scanparsers(self):
|
|
100
120
|
"""A list of `ScanParser`s for each of the scans specified by
|
|
@@ -107,25 +127,29 @@ class SpecScans(BaseModel):
|
|
|
107
127
|
"""This method returns a `ScanParser` for the specified scan
|
|
108
128
|
number in the specified SPEC file.
|
|
109
129
|
|
|
110
|
-
:param scan_number: Scan number to get a `ScanParser` for
|
|
130
|
+
:param scan_number: Scan number to get a `ScanParser` for.
|
|
111
131
|
:type scan_number: int
|
|
112
|
-
:return: `ScanParser` for the specified scan number
|
|
132
|
+
:return: `ScanParser` for the specified scan number.
|
|
113
133
|
:rtype: ScanParser
|
|
114
134
|
"""
|
|
115
|
-
|
|
135
|
+
if self.par_file:
|
|
136
|
+
return get_scanparser(
|
|
137
|
+
self.spec_file, scan_number, par_file=self.par_file)
|
|
138
|
+
else:
|
|
139
|
+
return get_scanparser(self.spec_file, scan_number)
|
|
116
140
|
|
|
117
141
|
def get_index(self, scan_number:int, scan_step_index:int, map_config):
|
|
118
142
|
"""This method returns a tuple representing the index of a
|
|
119
143
|
specific step in a specific SPEC scan within a map.
|
|
120
144
|
|
|
121
|
-
:param scan_number: Scan number to get index for
|
|
145
|
+
:param scan_number: Scan number to get index for.
|
|
122
146
|
:type scan_number: int
|
|
123
|
-
:param scan_step_index: Scan step index to get index for
|
|
147
|
+
:param scan_step_index: Scan step index to get index for.
|
|
124
148
|
:type scan_step_index: int
|
|
125
|
-
:param map_config: Map configuration to get index for
|
|
149
|
+
:param map_config: Map configuration to get index for.
|
|
126
150
|
:type map_config: MapConfig
|
|
127
151
|
:return: Index for the specified scan number and scan step
|
|
128
|
-
index within the specified map configuration
|
|
152
|
+
index within the specified map configuration.
|
|
129
153
|
:rtype: tuple
|
|
130
154
|
"""
|
|
131
155
|
index = ()
|
|
@@ -144,14 +168,15 @@ class SpecScans(BaseModel):
|
|
|
144
168
|
"""Return the raw data from the specified detectors at the
|
|
145
169
|
specified scan number and scan step index.
|
|
146
170
|
|
|
147
|
-
:param detectors: List of detector prefixes to get raw data
|
|
171
|
+
:param detectors: List of detector prefixes to get raw data
|
|
172
|
+
for.
|
|
148
173
|
:type detectors: list[str]
|
|
149
|
-
:param scan_number: Scan number to get data for
|
|
174
|
+
:param scan_number: Scan number to get data for.
|
|
150
175
|
:type scan_number: int
|
|
151
|
-
:param scan_step_index: Scan step index to get data for
|
|
176
|
+
:param scan_step_index: Scan step index to get data for.
|
|
152
177
|
:type scan_step_index: int
|
|
153
178
|
:return: Data from the specified detectors for the specified
|
|
154
|
-
scan number and scan step index
|
|
179
|
+
scan number and scan step index.
|
|
155
180
|
:rtype: list[np.ndarray]
|
|
156
181
|
"""
|
|
157
182
|
return get_detector_data(
|
|
@@ -169,10 +194,13 @@ def get_available_scan_numbers(spec_file:str):
|
|
|
169
194
|
|
|
170
195
|
|
|
171
196
|
@cache
|
|
172
|
-
def get_scanparser(spec_file:str, scan_number:int):
|
|
197
|
+
def get_scanparser(spec_file:str, scan_number:int, par_file=None):
|
|
173
198
|
if scan_number not in get_available_scan_numbers(spec_file):
|
|
174
199
|
return None
|
|
175
|
-
|
|
200
|
+
if par_file is None:
|
|
201
|
+
return ScanParser(spec_file, scan_number)
|
|
202
|
+
else:
|
|
203
|
+
return ScanParser(spec_file, scan_number, par_file=par_file)
|
|
176
204
|
|
|
177
205
|
|
|
178
206
|
@lru_cache(maxsize=10)
|
|
@@ -216,7 +244,7 @@ class PointByPointScanData(BaseModel):
|
|
|
216
244
|
any of the values for `label` reserved for certain data needed
|
|
217
245
|
to perform corrections.
|
|
218
246
|
|
|
219
|
-
:param label: The value of `label` to validate
|
|
247
|
+
:param label: The value of `label` to validate.
|
|
220
248
|
:type label: str
|
|
221
249
|
:raises ValueError: If `label` is one of the reserved values.
|
|
222
250
|
:return: The original supplied value `label`, if it is
|
|
@@ -239,8 +267,6 @@ class PointByPointScanData(BaseModel):
|
|
|
239
267
|
:raises TypeError: If the station is not compatible with the
|
|
240
268
|
value of the `data_type` attribute for this instance of
|
|
241
269
|
PointByPointScanData.
|
|
242
|
-
:return: None
|
|
243
|
-
:rtype: None
|
|
244
270
|
"""
|
|
245
271
|
if (station.lower() not in ('id1a3', 'id3a')
|
|
246
272
|
and self.data_type == 'smb_par'):
|
|
@@ -256,15 +282,13 @@ class PointByPointScanData(BaseModel):
|
|
|
256
282
|
|
|
257
283
|
:param spec_scans: A list of `SpecScans` whose raw data will
|
|
258
284
|
be checked for the presence of the data represented by
|
|
259
|
-
this instance of `PointByPointScanData
|
|
285
|
+
this instance of `PointByPointScanData`.
|
|
260
286
|
:type spec_scans: list[SpecScans]
|
|
261
287
|
:param scan_step_index: A specific scan step index to validate,
|
|
262
288
|
defaults to `'all'`.
|
|
263
289
|
:type scan_step_index: Union[Literal['all'],int], optional
|
|
264
290
|
:raises RuntimeError: If the data represented by this instance of
|
|
265
291
|
`PointByPointScanData` is missing for the specified scan steps.
|
|
266
|
-
:return: None
|
|
267
|
-
:rtype: None
|
|
268
292
|
"""
|
|
269
293
|
for scans in spec_scans:
|
|
270
294
|
for scan_number in scans.scan_numbers:
|
|
@@ -300,7 +324,7 @@ class PointByPointScanData(BaseModel):
|
|
|
300
324
|
:type scan_step_index: int
|
|
301
325
|
:return: The value recorded of the data represented by this
|
|
302
326
|
instance of `PointByPointScanData` at the scan step
|
|
303
|
-
requested
|
|
327
|
+
requested.
|
|
304
328
|
:rtype: float
|
|
305
329
|
"""
|
|
306
330
|
if self.data_type == 'spec_motor':
|
|
@@ -336,7 +360,7 @@ def get_spec_motor_value(spec_file:str, scan_number:int,
|
|
|
336
360
|
:type scan_step_index: int
|
|
337
361
|
:param spec_mnemonic: The menmonic of a SPEC motor.
|
|
338
362
|
:type spec_mnemonic: str
|
|
339
|
-
:return: The value of the motor at the scan step requested
|
|
363
|
+
:return: The value of the motor at the scan step requested.
|
|
340
364
|
:rtype: float
|
|
341
365
|
"""
|
|
342
366
|
scanparser = get_scanparser(spec_file, scan_number)
|
|
@@ -373,7 +397,7 @@ def get_spec_counter_value(spec_file:str, scan_number:int,
|
|
|
373
397
|
:type scan_step_index: int
|
|
374
398
|
:param spec_column_label: The label of a SPEC data column.
|
|
375
399
|
:type spec_column_label: str
|
|
376
|
-
:return: The value of the counter at the scan step requested
|
|
400
|
+
:return: The value of the counter at the scan step requested.
|
|
377
401
|
:rtype: float
|
|
378
402
|
"""
|
|
379
403
|
scanparser = get_scanparser(spec_file, scan_number)
|
|
@@ -393,7 +417,7 @@ def get_smb_par_value(spec_file:str, scan_number:int, par_name:str):
|
|
|
393
417
|
:param scan_number: The number of the scan in which the requested
|
|
394
418
|
scan step occurs.
|
|
395
419
|
:type scan_number: int
|
|
396
|
-
:param par_name: The name of the column in the .par file
|
|
420
|
+
:param par_name: The name of the column in the .par file.
|
|
397
421
|
:type par_name: str
|
|
398
422
|
:return: The value of the .par file value for the scan requested.
|
|
399
423
|
:rtype: float
|
|
@@ -406,13 +430,13 @@ def validate_data_source_for_map_config(data_source, values):
|
|
|
406
430
|
"""Confirm that an instance of PointByPointScanData is valid for
|
|
407
431
|
the station and scans provided by a map configuration dictionary.
|
|
408
432
|
|
|
409
|
-
:param data_source:
|
|
433
|
+
:param data_source: The input object to validate.
|
|
410
434
|
:type data_source: PintByPointScanData
|
|
411
|
-
:param values:
|
|
435
|
+
:param values: The map configuration dictionary.
|
|
412
436
|
:type values: dict
|
|
413
|
-
:raises Exception:
|
|
437
|
+
:raises Exception: If `data_source` cannot be validated for
|
|
414
438
|
`values`.
|
|
415
|
-
:return: `data_source`,
|
|
439
|
+
:return: `data_source`, if it is valid.
|
|
416
440
|
:rtype: PointByPointScanData
|
|
417
441
|
"""
|
|
418
442
|
if data_source is not None:
|
|
@@ -437,15 +461,15 @@ class IndependentDimension(PointByPointScanData):
|
|
|
437
461
|
:ivar name: Represents the name with which these raw data were
|
|
438
462
|
recorded at time of data collection.
|
|
439
463
|
:type name: str
|
|
440
|
-
:
|
|
441
|
-
`MapConfig` along this axis, defaults to 0
|
|
464
|
+
:ivar start: Sarting index for slicing all datasets of a
|
|
465
|
+
`MapConfig` along this axis, defaults to `0`.
|
|
442
466
|
:type start: int, optional
|
|
443
|
-
:
|
|
467
|
+
:ivar end: Ending index for slicing all datasets of a `MapConfig`
|
|
444
468
|
along this axis, defaults to the total number of unique values
|
|
445
|
-
along this axis in the associated `MapConfig
|
|
469
|
+
along this axis in the associated `MapConfig`.
|
|
446
470
|
:type end: int, optional
|
|
447
|
-
:
|
|
448
|
-
this axis, defaults to 1
|
|
471
|
+
:ivar step: Step for slicing all datasets of a `MapConfig` along
|
|
472
|
+
this axis, defaults to `1`.
|
|
449
473
|
:type step: int, optional
|
|
450
474
|
"""
|
|
451
475
|
start: Optional[conint(ge=0)] = 0
|
|
@@ -489,7 +513,7 @@ class CorrectionsData(PointByPointScanData):
|
|
|
489
513
|
"""Return a list of all the labels reserved for
|
|
490
514
|
corrections-related scalar data.
|
|
491
515
|
|
|
492
|
-
:return: A list of reserved labels
|
|
516
|
+
:return: A list of reserved labels.
|
|
493
517
|
:rtype: list[str]
|
|
494
518
|
"""
|
|
495
519
|
return list(cls.__fields__['label'].type_.__args__)
|
|
@@ -499,10 +523,10 @@ class PresampleIntensity(CorrectionsData):
|
|
|
499
523
|
"""Class representing a source of raw data for the intensity of
|
|
500
524
|
the beam that is incident on the sample.
|
|
501
525
|
|
|
502
|
-
:ivar label: Must be `
|
|
503
|
-
:type label: Literal[
|
|
504
|
-
:ivar units: Must be `
|
|
505
|
-
:type units: Literal[
|
|
526
|
+
:ivar label: Must be `'presample_intensity"`.
|
|
527
|
+
:type label: Literal['presample_intensity']
|
|
528
|
+
:ivar units: Must be `'counts'`.
|
|
529
|
+
:type units: Literal['counts']
|
|
506
530
|
:ivar data_type: Represents how these data were recorded at time
|
|
507
531
|
of data collection.
|
|
508
532
|
:type data_type: Literal['scan_column', 'smb_par']
|
|
@@ -518,10 +542,10 @@ class PostsampleIntensity(CorrectionsData):
|
|
|
518
542
|
"""Class representing a source of raw data for the intensity of
|
|
519
543
|
the beam that has passed through the sample.
|
|
520
544
|
|
|
521
|
-
:ivar label: Must be `
|
|
522
|
-
:type label: Literal[
|
|
523
|
-
:ivar units: Must be `
|
|
524
|
-
:type units: Literal[
|
|
545
|
+
:ivar label: Must be `'postsample_intensity'`.
|
|
546
|
+
:type label: Literal['postsample_intensity']
|
|
547
|
+
:ivar units: Must be `'counts'`.
|
|
548
|
+
:type units: Literal['counts']
|
|
525
549
|
:ivar data_type: Represents how these data were recorded at time
|
|
526
550
|
of data collection.
|
|
527
551
|
:type data_type: Literal['scan_column', 'smb_par']
|
|
@@ -539,10 +563,10 @@ class DwellTimeActual(CorrectionsData):
|
|
|
539
563
|
can vary slightly point-to-point from the dwell time specified in
|
|
540
564
|
the command).
|
|
541
565
|
|
|
542
|
-
:ivar label: Must be `
|
|
543
|
-
:type label: Literal[
|
|
544
|
-
:ivar units: Must be `
|
|
545
|
-
:type units: Literal[
|
|
566
|
+
:ivar label: Must be `'dwell_time_actual'`.
|
|
567
|
+
:type label: Literal['dwell_time_actual']
|
|
568
|
+
:ivar units: Must be `'counts'`.
|
|
569
|
+
:type units: Literal['counts']
|
|
546
570
|
:ivar data_type: Represents how these data were recorded at time
|
|
547
571
|
of data collection.
|
|
548
572
|
:type data_type: Literal['scan_column', 'smb_par']
|
|
@@ -559,11 +583,11 @@ class SpecConfig(BaseModel):
|
|
|
559
583
|
|
|
560
584
|
:ivar station: The name of the station at which the data was
|
|
561
585
|
collected.
|
|
562
|
-
:type station: Literal['id1a3','id3a','id3b']
|
|
586
|
+
:type station: Literal['id1a3', 'id3a', 'id3b']
|
|
563
587
|
:ivar spec_scans: A list of the SPEC scans that compose the set.
|
|
564
588
|
:type spec_scans: list[SpecScans]
|
|
565
589
|
"""
|
|
566
|
-
station: Literal['id1a3','id3a','id3b']
|
|
590
|
+
station: Literal['id1a3', 'id3a', 'id3b']
|
|
567
591
|
experiment_type: Literal['SAXSWAXS', 'EDD', 'XRF', 'TOMO']
|
|
568
592
|
spec_scans: conlist(item_type=SpecScans, min_items=1)
|
|
569
593
|
|
|
@@ -620,7 +644,7 @@ class MapConfig(BaseModel):
|
|
|
620
644
|
:type title: str
|
|
621
645
|
:ivar station: The name of the station at which the map was
|
|
622
646
|
collected.
|
|
623
|
-
:type station: Literal['id1a3','id3a','id3b']
|
|
647
|
+
:type station: Literal['id1a3', 'id3a', 'id3b']
|
|
624
648
|
:ivar spec_scans: A list of the SPEC scans that compose the map.
|
|
625
649
|
:type spec_scans: list[SpecScans]
|
|
626
650
|
:ivar independent_dimensions: A list of the sources of data
|
|
@@ -630,27 +654,27 @@ class MapConfig(BaseModel):
|
|
|
630
654
|
:ivar presample_intensity: A source of point-by-point presample
|
|
631
655
|
beam intensity data. Required when applying a CorrectionConfig
|
|
632
656
|
tool.
|
|
633
|
-
:type presample_intensity:
|
|
657
|
+
:type presample_intensity: PresampleIntensity, optional
|
|
634
658
|
:ivar dwell_time_actual: A source of point-by-point actual dwell
|
|
635
659
|
times for SPEC scans. Required when applying a
|
|
636
660
|
CorrectionConfig tool.
|
|
637
|
-
:type dwell_time_actual:
|
|
661
|
+
:type dwell_time_actual: DwellTimeActual, optional
|
|
638
662
|
:ivar presample_intensity: A source of point-by-point postsample
|
|
639
663
|
beam intensity data. Required when applying a CorrectionConfig
|
|
640
|
-
tool with `correction_type=
|
|
641
|
-
`correction_type=
|
|
642
|
-
:type presample_intensity:
|
|
664
|
+
tool with `correction_type='flux_absorption'` or
|
|
665
|
+
`correction_type='flux_absorption_background'`.
|
|
666
|
+
:type presample_intensity: PresampleIntensity, optional
|
|
643
667
|
:ivar scalar_data: A list of the sources of data representing
|
|
644
668
|
other scalar raw data values collected at each point on the
|
|
645
669
|
map. In the NeXus file representation of the map, datasets for
|
|
646
|
-
these values will be included
|
|
647
|
-
:type
|
|
670
|
+
these values will be included, defaults to `[]`.
|
|
671
|
+
:type scalar_data: list[PointByPointScanData], optional
|
|
648
672
|
:ivar map_type: Type of map, structured or unstructured,
|
|
649
673
|
defaults to `'structured'`.
|
|
650
|
-
:type map_type:
|
|
674
|
+
:type map_type: Literal['structured', 'unstructured'], optional
|
|
651
675
|
"""
|
|
652
676
|
title: constr(strip_whitespace=True, min_length=1)
|
|
653
|
-
station: Literal['id1a3','id3a','id3b']
|
|
677
|
+
station: Literal['id1a3', 'id3a', 'id3b']
|
|
654
678
|
experiment_type: Literal['SAXSWAXS', 'EDD', 'XRF', 'TOMO']
|
|
655
679
|
sample: Sample
|
|
656
680
|
spec_scans: conlist(item_type=SpecScans, min_items=1)
|
|
@@ -793,7 +817,7 @@ class MapConfig(BaseModel):
|
|
|
793
817
|
"""Return a dictionary of the values of each independent
|
|
794
818
|
dimension across the map.
|
|
795
819
|
"""
|
|
796
|
-
if not hasattr(self,
|
|
820
|
+
if not hasattr(self, '_coords'):
|
|
797
821
|
coords = {}
|
|
798
822
|
for dim in self.independent_dimensions:
|
|
799
823
|
coords[dim.label] = []
|
|
@@ -814,7 +838,7 @@ class MapConfig(BaseModel):
|
|
|
814
838
|
"""Return a tuple of the independent dimension labels for the
|
|
815
839
|
map.
|
|
816
840
|
"""
|
|
817
|
-
if not hasattr(self,
|
|
841
|
+
if not hasattr(self, '_dims'):
|
|
818
842
|
self._dims = [
|
|
819
843
|
dim.label for dim in self.independent_dimensions[::-1]]
|
|
820
844
|
return self._dims
|
|
@@ -825,7 +849,7 @@ class MapConfig(BaseModel):
|
|
|
825
849
|
object, the scan number, and scan step index for every point
|
|
826
850
|
on the map.
|
|
827
851
|
"""
|
|
828
|
-
if not hasattr(self,
|
|
852
|
+
if not hasattr(self, '_scan_step_indices'):
|
|
829
853
|
scan_step_indices = []
|
|
830
854
|
for scans in self.spec_scans:
|
|
831
855
|
for scan_number in scans.scan_numbers:
|
|
@@ -841,7 +865,7 @@ class MapConfig(BaseModel):
|
|
|
841
865
|
"""Return the shape of the map -- a tuple representing the
|
|
842
866
|
number of unique values of each dimension across the map.
|
|
843
867
|
"""
|
|
844
|
-
if not hasattr(self,
|
|
868
|
+
if not hasattr(self, '_shape'):
|
|
845
869
|
if self.map_type == 'structured':
|
|
846
870
|
self._shape = tuple(
|
|
847
871
|
[len(v) for k, v in self.coords.items()][::-1])
|
|
@@ -910,11 +934,11 @@ class MapConfig(BaseModel):
|
|
|
910
934
|
single point in the map.
|
|
911
935
|
|
|
912
936
|
:param data: The device configuration to return a value of raw
|
|
913
|
-
data for
|
|
937
|
+
data for.
|
|
914
938
|
:type data: PointByPointScanData
|
|
915
|
-
:param map_index: The map index to return raw data for
|
|
939
|
+
:param map_index: The map index to return raw data for.
|
|
916
940
|
:type map_index: tuple
|
|
917
|
-
:return: Raw data value
|
|
941
|
+
:return: Raw data value.
|
|
918
942
|
"""
|
|
919
943
|
scans, scan_number, scan_step_index = \
|
|
920
944
|
self.get_scan_step_index(map_index)
|
|
@@ -925,11 +949,12 @@ def import_scanparser(station, experiment):
|
|
|
925
949
|
"""Given the name of a CHESS station and experiment type, import
|
|
926
950
|
the corresponding subclass of `ScanParser` as `ScanParser`.
|
|
927
951
|
|
|
928
|
-
:param station: The station name
|
|
952
|
+
:param station: The station name
|
|
953
|
+
('IDxx', not the beamline acronym).
|
|
929
954
|
:type station: str
|
|
930
|
-
:param experiment: The experiment type
|
|
931
|
-
:type experiment: Literal[
|
|
932
|
-
|
|
955
|
+
:param experiment: The experiment type.
|
|
956
|
+
:type experiment: Literal[
|
|
957
|
+
'SAXSWAXS', 'EDD', 'XRF', 'Tomo', 'Powder']
|
|
933
958
|
"""
|
|
934
959
|
|
|
935
960
|
station = station.lower()
|