@@ -311,15 +311,17 @@ class PointByPointScanData(CHAPBaseModel):
311
311
:type units: str
312
312
:ivar data_type: Represents how these data were recorded at time
313
313
of data collection.
314
- :type data_type: Literal['spec_motor', 'scan_column', 'smb_par']
314
+ :type data_type: Literal['spec_motor', 'spec_motor_absolute',
315
+ 'scan_column', 'smb_par', 'expression', 'detector_log_timestamps']
315
316
:ivar name: Represents the name with which these raw data were
316
317
recorded at time of data collection.
317
318
:type name: str
318
319
"""
319
320
label : constr (min_length = 1 )
320
321
units : constr (strip_whitespace = True , min_length = 1 )
321
- data_type : Literal ['spec_motor' , 'spec_motor_absolute' , 'scan_column' ,
322
- 'smb_par' , 'expression' , 'detector_log_timestamps' ]
322
+ data_type : Literal [
323
+ 'spec_motor' , 'spec_motor_absolute' , 'scan_column' , 'smb_par' ,
324
+ 'expression' , 'detector_log_timestamps' ]
323
325
name : constr (strip_whitespace = True , min_length = 1 )
324
326
ndigits : Optional [conint (ge = 0 )] = None
325
327
@@ -359,7 +361,7 @@ def validate_for_station(self, station):
359
361
f'{ self .__class__ .__name__ } .data_type may not be "smb_par" '
360
362
f'when station is "{ station } "' )
361
363
if (not station .lower () == 'id3b'
362
- and self .data_type == 'detector_log_timestamps' ):
364
+ and self .data_type == 'detector_log_timestamps' ):
363
365
raise TypeError (
364
366
f'{ self .__class__ .__name__ } .data_type may not be'
365
367
+ f' "detector_log_timestamps" when station is "{ station } "' )
@@ -493,7 +495,6 @@ def get_value(
493
495
return timestamps
494
496
return None
495
497
496
-
497
498
@cache
498
499
def get_spec_motor_value (
499
500
spec_file , scan_number , scan_step_index , spec_mnemonic ,
@@ -548,7 +549,6 @@ def get_spec_motor_value(
548
549
motor_value = np .round (motor_value , ndigits )
549
550
return motor_value
550
551
551
-
552
552
@cache
553
553
def get_spec_counter_value (
554
554
spec_file , scan_number , scan_step_index , spec_column_label ):
@@ -573,7 +573,6 @@ def get_spec_counter_value(
573
573
return scanparser .spec_scan_data [spec_column_label ][scan_step_index ]
574
574
return scanparser .spec_scan_data [spec_column_label ]
575
575
576
-
577
576
@cache
578
577
def get_smb_par_value (spec_file , scan_number , par_name ):
579
578
"""Return the value recorded for a specific scan in SMB-tyle .par
@@ -593,7 +592,6 @@ def get_smb_par_value(spec_file, scan_number, par_name):
593
592
scanparser = get_scanparser (spec_file , scan_number )
594
593
return scanparser .pars [par_name ]
595
594
596
-
597
595
def get_expression_value (
598
596
spec_scans , scan_number , scan_step_index , expression ,
599
597
scalar_data ):
@@ -797,10 +795,11 @@ class SpecConfig(CHAPBaseModel):
797
795
:type spec_scans: list[SpecScans]
798
796
:ivar experiment_type: Experiment type.
799
797
:type experiment_type: Literal['EDD', 'GIWAXS', 'SAXSWAXS', 'TOMO',
800
- 'XRF']
798
+ 'XRF', 'HDRM' ]
801
799
"""
802
- station : Literal ['id1a3' , 'id3a' , 'id3b' ]
803
- experiment_type : Literal ['EDD' , 'GIWAXS' , 'SAXSWAXS' , 'TOMO' , 'XRF' ]
800
+ station : Literal ['id1a3' , 'id3a' , 'id3b' , 'id4b' ]
801
+ experiment_type : Literal [
802
+ 'EDD' , 'GIWAXS' , 'SAXSWAXS' , 'TOMO' , 'XRF' , 'HDRM' ]
804
803
spec_scans : conlist (item_type = SpecScans , min_length = 1 )
805
804
806
805
@model_validator (mode = 'before' )
@@ -854,6 +853,8 @@ def validate_experiment_type(cls, experiment_type, info):
854
853
allowed_experiment_types = ['EDD' , 'TOMO' ]
855
854
elif station == 'id3b' :
856
855
allowed_experiment_types = ['GIWAXS' , 'SAXSWAXS' , 'TOMO' , 'XRF' ]
856
+ elif station == 'id4b' :
857
+ allowed_experiment_types = ['HDRM' ]
857
858
else :
858
859
allowed_experiment_types = []
859
860
if experiment_type not in allowed_experiment_types :
@@ -873,10 +874,10 @@ class MapConfig(CHAPBaseModel):
873
874
:type title: str
874
875
:ivar station: The name of the station at which the map was
875
876
collected.
876
- :type station: Literal['id1a3', 'id3a', 'id3b']
877
+ :type station: Literal['id1a3', 'id3a', 'id3b', id4b ]
877
878
:ivar experiment_type: Experiment type.
878
879
:type experiment_type: Literal['EDD', 'GIWAXS', 'SAXSWAXS', 'TOMO',
879
- 'XRF']
880
+ 'XRF', 'HDRM' ]
880
881
:ivar sample: The sample metadata configuration.
881
882
:type sample: CHAP.commom.models.map.Sample
882
883
:ivar spec_scans: A list of the SPEC scans that compose the map.
@@ -907,8 +908,9 @@ class MapConfig(CHAPBaseModel):
907
908
:type attrs: dict, optional
908
909
"""
909
910
title : constr (strip_whitespace = True , min_length = 1 )
910
- station : Literal ['id1a3' , 'id3a' , 'id3b' ]
911
- experiment_type : Literal ['EDD' , 'GIWAXS' , 'SAXSWAXS' , 'TOMO' , 'XRF' ]
911
+ station : Literal ['id1a3' , 'id3a' , 'id3b' , 'id4b' ]
912
+ experiment_type : Literal [
913
+ 'EDD' , 'GIWAXS' , 'SAXSWAXS' , 'TOMO' , 'XRF' , 'HDRM' ]
912
914
sample : Sample
913
915
spec_scans : conlist (item_type = SpecScans , min_length = 1 )
914
916
scalar_data : Optional [conlist (item_type = PointByPointScanData )] = []
@@ -980,6 +982,8 @@ def validate_experiment_type(cls, experiment_type, info):
980
982
allowed_experiment_types = ['EDD' , 'TOMO' ]
981
983
elif station == 'id3b' :
982
984
allowed_experiment_types = ['GIWAXS' , 'SAXSWAXS' , 'TOMO' , 'XRF' ]
985
+ elif station == 'id4b' :
986
+ allowed_experiment_types = ['HDRM' ]
983
987
else :
984
988
allowed_experiment_types = []
985
989
if experiment_type not in allowed_experiment_types :
@@ -1252,7 +1256,7 @@ def import_scanparser(station, experiment):
1252
1256
:type station: str
1253
1257
:param experiment: The experiment type.
1254
1258
:type experiment: Literal[
1255
- 'EDD', 'GIWAXS', 'SAXSWAXS', 'TOMO', 'XRF']
1259
+ 'EDD', 'GIWAXS', 'SAXSWAXS', 'TOMO', 'XRF', 'HDRM' ]
1256
1260
"""
1257
1261
# Third party modules
1258
1262
from chess_scanparsers import choose_scanparser
0 commit comments